1 | <?php |
||
16 | class NonStaticMagicMethodsSniffTest extends BaseSniffTest |
||
|
|||
17 | { |
||
18 | /** |
||
19 | * Sniffed file |
||
20 | * |
||
21 | * @var PHP_CodeSniffer_File |
||
22 | */ |
||
23 | protected $_sniffFile; |
||
24 | |||
25 | /** |
||
26 | * setUp |
||
27 | * |
||
28 | * @return void |
||
29 | */ |
||
30 | public function setUp() |
||
36 | |||
37 | |||
38 | /** |
||
39 | * testCorrectImplementation |
||
40 | * |
||
41 | * @group MagicMethods |
||
42 | * |
||
43 | * @dataProvider dataCorrectImplementation |
||
44 | * |
||
45 | * @param int $line The line number. |
||
46 | * |
||
47 | * @return void |
||
48 | */ |
||
49 | public function testCorrectImplementation($line) |
||
53 | |||
54 | /** |
||
55 | * Data provider. |
||
56 | * |
||
57 | * @see testCorrectImplementation() |
||
58 | * |
||
59 | * @return array |
||
60 | */ |
||
61 | public function dataCorrectImplementation() |
||
147 | |||
148 | |||
149 | /** |
||
150 | * testWrongMethodVisibility |
||
151 | * |
||
152 | * @group MagicMethods |
||
153 | * |
||
154 | * @dataProvider dataWrongMethodVisibility |
||
155 | * |
||
156 | * @param int $line The line number. |
||
157 | * |
||
158 | * @return void |
||
159 | */ |
||
160 | public function testWrongMethodVisibility($methodName, $desiredVisibility, $testVisibility, $line) |
||
164 | |||
165 | /** |
||
166 | * Data provider. |
||
167 | * |
||
168 | * @see testWrongMethodVisibility() |
||
169 | * |
||
170 | * @return array |
||
171 | */ |
||
172 | public function dataWrongMethodVisibility() |
||
225 | |||
226 | |||
227 | /** |
||
228 | * testWrongStaticMethod |
||
229 | * |
||
230 | * @group MagicMethods |
||
231 | * |
||
232 | * @dataProvider dataWrongStaticMethod |
||
233 | * |
||
234 | * @param int $line The line number. |
||
235 | * |
||
236 | * @return void |
||
237 | */ |
||
238 | public function testWrongStaticMethod($methodName, $line) |
||
242 | |||
243 | /** |
||
244 | * Data provider. |
||
245 | * |
||
246 | * @see testWrongStaticMethod() |
||
247 | * |
||
248 | * @return array |
||
249 | */ |
||
250 | public function dataWrongStaticMethod() |
||
282 | |||
283 | |||
284 | /** |
||
285 | * testWrongNonStaticMethod |
||
286 | * |
||
287 | * @group MagicMethods |
||
288 | * |
||
289 | * @dataProvider dataWrongNonStaticMethod |
||
290 | * |
||
291 | * @param int $line The line number. |
||
292 | * |
||
293 | * @return void |
||
294 | */ |
||
295 | public function testWrongNonStaticMethod($methodName, $line) |
||
299 | |||
300 | /** |
||
301 | * Data provider. |
||
302 | * |
||
303 | * @see testWrongNonStaticMethod() |
||
304 | * |
||
305 | * @return array |
||
306 | */ |
||
307 | public function dataWrongNonStaticMethod() |
||
324 | |||
325 | } |
||
326 |
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.