Subversion-Projekte lars-tiefland.php_share

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
1 lars 1
<?php
2
/**
3
 * Unit test class for the OperatorBracket sniff.
4
 *
5
 * PHP version 5
6
 *
7
 * @category  PHP
8
 * @package   PHP_CodeSniffer
9
 * @author    Greg Sherwood <gsherwood@squiz.net>
10
 * @author    Marc McIntyre <mmcintyre@squiz.net>
11
 * @copyright 2006 Squiz Pty Ltd (ABN 77 084 670 600)
12
 * @license   http://matrix.squiz.net/developer/tools/php_cs/licence BSD Licence
13
 * @version   CVS: $Id: OperatorBracketUnitTest.php 267856 2008-10-27 04:36:24Z squiz $
14
 * @link      http://pear.php.net/package/PHP_CodeSniffer
15
 */
16
 
17
/**
18
 * Unit test class for the OperatorBracket sniff.
19
 *
20
 * A sniff unit test checks a .inc file for expected violations of a single
21
 * coding standard. Expected errors and warnings are stored in this class.
22
 *
23
 * @category  PHP
24
 * @package   PHP_CodeSniffer
25
 * @author    Greg Sherwood <gsherwood@squiz.net>
26
 * @author    Marc McIntyre <mmcintyre@squiz.net>
27
 * @copyright 2006 Squiz Pty Ltd (ABN 77 084 670 600)
28
 * @license   http://matrix.squiz.net/developer/tools/php_cs/licence BSD Licence
29
 * @version   Release: 1.2.1
30
 * @link      http://pear.php.net/package/PHP_CodeSniffer
31
 */
32
class Squiz_Tests_Formatting_OperatorBracketUnitTest extends AbstractSniffUnitTest
33
{
34
 
35
 
36
    /**
37
     * Returns the lines where errors should occur.
38
     *
39
     * The key of the array should represent the line number and the value
40
     * should represent the number of errors that should occur on that line.
41
     *
42
     * @param string $testFile The name of the file being tested.
43
     *
44
     * @return array(int => int)
45
     */
46
    public function getErrorList($testFile='OperatorBracketUnitTest.inc')
47
    {
48
        switch ($testFile) {
49
        case 'OperatorBracketUnitTest.inc':
50
            return array(
51
                    3   => 1,
52
                    6   => 1,
53
                    9   => 1,
54
                    12  => 1,
55
                    15  => 1,
56
                    18  => 2,
57
                    20  => 1,
58
                    25  => 1,
59
                    28  => 1,
60
                    31  => 1,
61
                    34  => 1,
62
                    37  => 1,
63
                    40  => 1,
64
                    43  => 2,
65
                    45  => 1,
66
                    47  => 5,
67
                    48  => 1,
68
                    50  => 2,
69
                    55  => 2,
70
                    56  => 1,
71
                    63  => 2,
72
                    64  => 1,
73
                    67  => 1,
74
                    86  => 1,
75
                    90  => 1,
76
                    109 => 1,
77
                   );
78
            break;
79
        case 'OperatorBracketUnitTest.js':
80
            return array(
81
                    5  => 1,
82
                    8  => 1,
83
                    11 => 1,
84
                    14 => 1,
85
                    24 => 1,
86
                    30 => 1,
87
                    33 => 1,
88
                    36 => 1,
89
                    39 => 1,
90
                    46 => 1,
91
                    47 => 1,
92
                    63 => 1,
93
                   );
94
             break;
95
        default:
96
            return array();
97
            break;
98
        }//end switch
99
 
100
    }//end getErrorList()
101
 
102
 
103
    /**
104
     * Returns the lines where warnings should occur.
105
     *
106
     * The key of the array should represent the line number and the value
107
     * should represent the number of warnings that should occur on that line.
108
     *
109
     * @return array(int => int)
110
     */
111
    public function getWarningList()
112
    {
113
        return array();
114
 
115
    }//end getWarningList()
116
 
117
 
118
}//end class
119
 
120
?>