Subversion Repositories Applications.framework

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
5 aurelien 1
<?php
2
/**
3
 * Unit test class for the UnnecessaryStringConcat sniff.
4
 *
5
 * PHP version 5
6
 *
7
 * @category  PHP
8
 * @package   PHP_CodeSniffer
9
 * @author    Greg Sherwood <gsherwood@squiz.net>
10
 * @copyright 2006 Squiz Pty Ltd (ABN 77 084 670 600)
11
 * @license   http://matrix.squiz.net/developer/tools/php_cs/licence BSD Licence
12
 * @version   CVS: $Id: UnnecessaryStringConcatUnitTest.php,v 1.1 2008/12/05 04:39:00 squiz Exp $
13
 * @link      http://pear.php.net/package/PHP_CodeSniffer
14
 */
15
 
16
/**
17
 * Unit test class for the UnnecessaryStringConcat sniff.
18
 *
19
 * A sniff unit test checks a .inc file for expected violations of a single
20
 * coding standard. Expected errors and warnings are stored in this class.
21
 *
22
 * @category  PHP
23
 * @package   PHP_CodeSniffer
24
 * @author    Greg Sherwood <gsherwood@squiz.net>
25
 * @copyright 2006 Squiz Pty Ltd (ABN 77 084 670 600)
26
 * @license   http://matrix.squiz.net/developer/tools/php_cs/licence BSD Licence
27
 * @version   Release: 1.2.0RC1
28
 * @link      http://pear.php.net/package/PHP_CodeSniffer
29
 */
30
class Generic_Tests_Strings_UnnecessaryStringConcatUnitTest extends AbstractSniffUnitTest
31
{
32
 
33
 
34
    /**
35
     * Returns the lines where errors should occur.
36
     *
37
     * The key of the array should represent the line number and the value
38
     * should represent the number of errors that should occur on that line.
39
     *
40
     * @param string $testFile The name of the file being tested.
41
     *
42
     * @return array(int => int)
43
     */
44
    public function getErrorList($testFile='UnnecessaryStringConcatUnitTest.inc')
45
    {
46
        switch ($testFile) {
47
        case 'UnnecessaryStringConcatUnitTest.inc':
48
            return array(
49
                    2 => 1,
50
                    6 => 1,
51
                    9 => 1,
52
                   );
53
            break;
54
        case 'UnnecessaryStringConcatUnitTest.js':
55
            return array(
56
                    1  => 1,
57
                    8  => 1,
58
                    11 => 1,
59
                   );
60
            break;
61
        default:
62
            return array();
63
            break;
64
        }
65
 
66
    }//end getErrorList()
67
 
68
 
69
    /**
70
     * Returns the lines where warnings should occur.
71
     *
72
     * The key of the array should represent the line number and the value
73
     * should represent the number of warnings that should occur on that line.
74
     *
75
     * @return array(int => int)
76
     */
77
    public function getWarningList()
78
    {
79
        return array();
80
 
81
    }//end getWarningList()
82
 
83
 
84
}//end class
85
 
86
?>