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 OperatorSpacing 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: OperatorSpacingUnitTest.php 267858 2008-10-27 05:00:29Z squiz $
14
 * @link      http://pear.php.net/package/PHP_CodeSniffer
15
 */
16
 
17
/**
18
 * Unit test class for the OperatorSpacing 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_WhiteSpace_OperatorSpacingUnitTest 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='OperatorSpacingUnitTest.inc')
47
    {
48
        switch ($testFile) {
49
        case 'OperatorSpacingUnitTest.inc':
50
            return array(
51
                    4  => 1,
52
                    5  => 2,
53
                    6  => 1,
54
                    7  => 1,
55
                    8  => 2,
56
                    11 => 1,
57
                    12 => 2,
58
                    13 => 1,
59
                    14 => 1,
60
                    15 => 2,
61
                    18 => 1,
62
                    19 => 2,
63
                    20 => 1,
64
                    21 => 1,
65
                    22 => 2,
66
                    25 => 1,
67
                    26 => 2,
68
                    27 => 1,
69
                    28 => 1,
70
                    29 => 2,
71
                    32 => 1,
72
                    33 => 2,
73
                    34 => 1,
74
                    35 => 1,
75
                    36 => 2,
76
                    40 => 2,
77
                    42 => 2,
78
                    44 => 2,
79
                    45 => 1,
80
                    46 => 2,
81
                    53 => 2,
82
                    54 => 1,
83
                    59 => 10,
84
                    64 => 1,
85
                    77 => 4,
86
                    78 => 1,
87
                    79 => 1,
88
                    80 => 2,
89
                    81 => 1,
90
                    84 => 6,
91
                    85 => 6,
92
                    87 => 4,
93
                    88 => 5,
94
                    90 => 4,
95
                    91 => 5,
96
                   );
97
            break;
98
        case 'OperatorSpacingUnitTest.js':
99
            return array(
100
                    4  => 1,
101
                    5  => 2,
102
                    6  => 1,
103
                    7  => 1,
104
                    8  => 2,
105
                    11 => 1,
106
                    12 => 2,
107
                    13 => 1,
108
                    14 => 1,
109
                    15 => 2,
110
                    18 => 1,
111
                    19 => 2,
112
                    20 => 1,
113
                    21 => 1,
114
                    22 => 2,
115
                    25 => 1,
116
                    26 => 2,
117
                    27 => 1,
118
                    28 => 1,
119
                    29 => 2,
120
                    32 => 1,
121
                    33 => 2,
122
                    34 => 1,
123
                    35 => 1,
124
                    36 => 2,
125
                    40 => 2,
126
                    42 => 2,
127
                    44 => 2,
128
                    45 => 1,
129
                    46 => 2,
130
                   );
131
            break;
132
        default:
133
            return array();
134
            break;
135
        }//end switch
136
 
137
    }//end getErrorList()
138
 
139
 
140
    /**
141
     * Returns the lines where warnings should occur.
142
     *
143
     * The key of the array should represent the line number and the value
144
     * should represent the number of warnings that should occur on that line.
145
     *
146
     * @return array(int => int)
147
     */
148
    public function getWarningList()
149
    {
150
        return array();
151
 
152
    }//end getWarningList()
153
 
154
 
155
}//end class
156
 
157
?>