~ubuntu-branches/ubuntu/wily/php-codesniffer/wily

« back to all changes in this revision

Viewing changes to PHP_CodeSniffer-2.3.3/CodeSniffer/Standards/Squiz/Tests/WhiteSpace/OperatorSpacingUnitTest.php

  • Committer: Package Import Robot
  • Author(s): David Prévot, Greg Sherwood
  • Date: 2015-06-24 13:41:36 UTC
  • mfrom: (1.1.9)
  • Revision ID: package-import@ubuntu.com-20150624134136-dv60dnl6s20tdxwr
Tags: 2.3.3-1
[ Greg Sherwood ]
Prepare for 2.3.3 release

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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-2014 Squiz Pty Ltd (ABN 77 084 670 600)
 
12
 * @license   https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence
 
13
 * @link      http://pear.php.net/package/PHP_CodeSniffer
 
14
 */
 
15
 
 
16
/**
 
17
 * Unit test class for the OperatorSpacing 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
 * @author    Marc McIntyre <mmcintyre@squiz.net>
 
26
 * @copyright 2006-2014 Squiz Pty Ltd (ABN 77 084 670 600)
 
27
 * @license   https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence
 
28
 * @version   Release: 2.3.3
 
29
 * @link      http://pear.php.net/package/PHP_CodeSniffer
 
30
 */
 
31
class Squiz_Tests_WhiteSpace_OperatorSpacingUnitTest extends AbstractSniffUnitTest
 
32
{
 
33
 
 
34
 
 
35
    /**
 
36
     * Returns the lines where errors should occur.
 
37
     *
 
38
     * The key of the array should represent the line number and the value
 
39
     * should represent the number of errors that should occur on that line.
 
40
     *
 
41
     * @param string $testFile The name of the file being tested.
 
42
     *
 
43
     * @return array<int, int>
 
44
     */
 
45
    public function getErrorList($testFile='OperatorSpacingUnitTest.inc')
 
46
    {
 
47
        switch ($testFile) {
 
48
        case 'OperatorSpacingUnitTest.inc':
 
49
            return array(
 
50
                    4   => 1,
 
51
                    5   => 2,
 
52
                    6   => 1,
 
53
                    7   => 1,
 
54
                    8   => 2,
 
55
                    11  => 1,
 
56
                    12  => 2,
 
57
                    13  => 1,
 
58
                    14  => 1,
 
59
                    15  => 2,
 
60
                    18  => 1,
 
61
                    19  => 2,
 
62
                    20  => 1,
 
63
                    21  => 1,
 
64
                    22  => 2,
 
65
                    25  => 1,
 
66
                    26  => 2,
 
67
                    27  => 1,
 
68
                    28  => 1,
 
69
                    29  => 2,
 
70
                    32  => 1,
 
71
                    33  => 2,
 
72
                    34  => 1,
 
73
                    35  => 1,
 
74
                    36  => 2,
 
75
                    40  => 2,
 
76
                    42  => 2,
 
77
                    44  => 2,
 
78
                    45  => 1,
 
79
                    46  => 2,
 
80
                    53  => 4,
 
81
                    54  => 3,
 
82
                    59  => 10,
 
83
                    64  => 1,
 
84
                    77  => 4,
 
85
                    78  => 1,
 
86
                    79  => 1,
 
87
                    80  => 2,
 
88
                    81  => 1,
 
89
                    84  => 6,
 
90
                    85  => 6,
 
91
                    87  => 4,
 
92
                    88  => 5,
 
93
                    90  => 4,
 
94
                    91  => 5,
 
95
                    128 => 4,
 
96
                    132 => 1,
 
97
                    133 => 1,
 
98
                    135 => 1,
 
99
                    136 => 1,
 
100
                    140 => 1,
 
101
                    141 => 1,
 
102
                   );
 
103
            break;
 
104
        case 'OperatorSpacingUnitTest.js':
 
105
            return array(
 
106
                    4  => 1,
 
107
                    5  => 2,
 
108
                    6  => 1,
 
109
                    7  => 1,
 
110
                    8  => 2,
 
111
                    11 => 1,
 
112
                    12 => 2,
 
113
                    13 => 1,
 
114
                    14 => 1,
 
115
                    15 => 2,
 
116
                    18 => 1,
 
117
                    19 => 2,
 
118
                    20 => 1,
 
119
                    21 => 1,
 
120
                    22 => 2,
 
121
                    25 => 1,
 
122
                    26 => 2,
 
123
                    27 => 1,
 
124
                    28 => 1,
 
125
                    29 => 2,
 
126
                    32 => 1,
 
127
                    33 => 2,
 
128
                    34 => 1,
 
129
                    35 => 1,
 
130
                    36 => 2,
 
131
                    40 => 2,
 
132
                    42 => 2,
 
133
                    44 => 2,
 
134
                    45 => 1,
 
135
                    46 => 2,
 
136
                    55 => 4,
 
137
                    65 => 1,
 
138
                    66 => 1,
 
139
                    68 => 1,
 
140
                    69 => 1,
 
141
                    73 => 1,
 
142
                    74 => 1,
 
143
                   );
 
144
            break;
 
145
        default:
 
146
            return array();
 
147
            break;
 
148
        }//end switch
 
149
 
 
150
    }//end getErrorList()
 
151
 
 
152
 
 
153
    /**
 
154
     * Returns the lines where warnings should occur.
 
155
     *
 
156
     * The key of the array should represent the line number and the value
 
157
     * should represent the number of warnings that should occur on that line.
 
158
     *
 
159
     * @return array<int, int>
 
160
     */
 
161
    public function getWarningList()
 
162
    {
 
163
        return array();
 
164
 
 
165
    }//end getWarningList()
 
166
 
 
167
 
 
168
}//end class