77
88class VariableAnalysisTest extends BaseTestCase {
99 public function testFunctionWithoutParamsErrors () {
10- $ fixtureFile = __DIR__ . ' /fixtures/ FunctionWithoutParamFixture.php ' ;
10+ $ fixtureFile = $ this -> getFixture ( ' FunctionWithoutParamFixture.php ') ;
1111 $ phpcsFile = $ this ->prepareLocalFileForSniffs ($ this ->getSniffFiles (), $ fixtureFile );
1212 $ phpcsFile ->process ();
1313 $ lines = $ this ->getErrorLineNumbersFromFile ($ phpcsFile );
@@ -16,7 +16,7 @@ public function testFunctionWithoutParamsErrors() {
1616 }
1717
1818 public function testFunctionWithoutParamsWarnings () {
19- $ fixtureFile = __DIR__ . ' /fixtures/ FunctionWithoutParamFixture.php ' ;
19+ $ fixtureFile = $ this -> getFixture ( ' FunctionWithoutParamFixture.php ') ;
2020 $ phpcsFile = $ this ->prepareLocalFileForSniffs ($ this ->getSniffFiles (), $ fixtureFile );
2121 $ phpcsFile ->process ();
2222 $ lines = $ this ->getWarningLineNumbersFromFile ($ phpcsFile );
@@ -38,7 +38,7 @@ public function testFunctionWithoutParamsWarnings() {
3838 }
3939
4040 public function testFunctionWithDefaultParamErrors () {
41- $ fixtureFile = __DIR__ . ' /fixtures/ FunctionWithDefaultParamFixture.php ' ;
41+ $ fixtureFile = $ this -> getFixture ( ' FunctionWithDefaultParamFixture.php ') ;
4242 $ phpcsFile = $ this ->prepareLocalFileForSniffs ($ this ->getSniffFiles (), $ fixtureFile );
4343 $ phpcsFile ->process ();
4444 $ lines = $ this ->getErrorLineNumbersFromFile ($ phpcsFile );
@@ -47,7 +47,7 @@ public function testFunctionWithDefaultParamErrors() {
4747 }
4848
4949 public function testFunctionWithDefaultParamWarnings () {
50- $ fixtureFile = __DIR__ . ' /fixtures/ FunctionWithDefaultParamFixture.php ' ;
50+ $ fixtureFile = $ this -> getFixture ( ' FunctionWithDefaultParamFixture.php ') ;
5151 $ phpcsFile = $ this ->prepareLocalFileForSniffs ($ this ->getSniffFiles (), $ fixtureFile );
5252 $ phpcsFile ->process ();
5353 $ lines = $ this ->getWarningLineNumbersFromFile ($ phpcsFile );
@@ -59,7 +59,7 @@ public function testFunctionWithDefaultParamWarnings() {
5959 }
6060
6161 public function testFunctionWithGlobalVarErrors () {
62- $ fixtureFile = __DIR__ . ' /fixtures/ FunctionWithGlobalVarFixture.php ' ;
62+ $ fixtureFile = $ this -> getFixture ( ' FunctionWithGlobalVarFixture.php ') ;
6363 $ phpcsFile = $ this ->prepareLocalFileForSniffs ($ this ->getSniffFiles (), $ fixtureFile );
6464 $ phpcsFile ->process ();
6565 $ lines = $ this ->getErrorLineNumbersFromFile ($ phpcsFile );
@@ -68,7 +68,7 @@ public function testFunctionWithGlobalVarErrors() {
6868 }
6969
7070 public function testFunctionWithGlobalVarWarnings () {
71- $ fixtureFile = __DIR__ . ' /fixtures/ FunctionWithGlobalVarFixture.php ' ;
71+ $ fixtureFile = $ this -> getFixture ( ' FunctionWithGlobalVarFixture.php ') ;
7272 $ phpcsFile = $ this ->prepareLocalFileForSniffs ($ this ->getSniffFiles (), $ fixtureFile );
7373 $ phpcsFile ->process ();
7474 $ lines = $ this ->getWarningLineNumbersFromFile ($ phpcsFile );
@@ -81,7 +81,7 @@ public function testFunctionWithGlobalVarWarnings() {
8181 }
8282
8383 public function testFunctionWithForeachErrors () {
84- $ fixtureFile = __DIR__ . ' /fixtures/ FunctionWithForeachFixture.php ' ;
84+ $ fixtureFile = $ this -> getFixture ( ' FunctionWithForeachFixture.php ') ;
8585 $ phpcsFile = $ this ->prepareLocalFileForSniffs ($ this ->getSniffFiles (), $ fixtureFile );
8686 $ phpcsFile ->process ();
8787 $ lines = $ this ->getErrorLineNumbersFromFile ($ phpcsFile );
@@ -90,7 +90,7 @@ public function testFunctionWithForeachErrors() {
9090 }
9191
9292 public function testFunctionWithForeachWarnings () {
93- $ fixtureFile = __DIR__ . ' /fixtures/ FunctionWithForeachFixture.php ' ;
93+ $ fixtureFile = $ this -> getFixture ( ' FunctionWithForeachFixture.php ') ;
9494 $ phpcsFile = $ this ->prepareLocalFileForSniffs ($ this ->getSniffFiles (), $ fixtureFile );
9595 $ phpcsFile ->process ();
9696 $ lines = $ this ->getWarningLineNumbersFromFile ($ phpcsFile );
@@ -112,7 +112,7 @@ public function testFunctionWithForeachWarnings() {
112112 }
113113
114114 public function testClassWithMembersErrors () {
115- $ fixtureFile = __DIR__ . ' /fixtures/ ClassWithMembersFixture.php ' ;
115+ $ fixtureFile = $ this -> getFixture ( ' ClassWithMembersFixture.php ') ;
116116 $ phpcsFile = $ this ->prepareLocalFileForSniffs ($ this ->getSniffFiles (), $ fixtureFile );
117117 $ phpcsFile ->process ();
118118 $ lines = $ this ->getErrorLineNumbersFromFile ($ phpcsFile );
@@ -121,7 +121,7 @@ public function testClassWithMembersErrors() {
121121 }
122122
123123 public function testClassWithMembersWarnings () {
124- $ fixtureFile = __DIR__ . ' /fixtures/ ClassWithMembersFixture.php ' ;
124+ $ fixtureFile = $ this -> getFixture ( ' ClassWithMembersFixture.php ') ;
125125 $ phpcsFile = $ this ->prepareLocalFileForSniffs ($ this ->getSniffFiles (), $ fixtureFile );
126126 $ phpcsFile ->process ();
127127 $ lines = $ this ->getWarningLineNumbersFromFile ($ phpcsFile );
@@ -143,7 +143,7 @@ public function testClassWithMembersWarnings() {
143143 }
144144
145145 public function testFunctionsOutsideClassErrors () {
146- $ fixtureFile = __DIR__ . ' /fixtures/ FunctionsOutsideClassFixture.php ' ;
146+ $ fixtureFile = $ this -> getFixture ( ' FunctionsOutsideClassFixture.php ') ;
147147 $ phpcsFile = $ this ->prepareLocalFileForSniffs ($ this ->getSniffFiles (), $ fixtureFile );
148148 $ phpcsFile ->process ();
149149 $ lines = $ this ->getErrorLineNumbersFromFile ($ phpcsFile );
@@ -155,7 +155,7 @@ public function testFunctionsOutsideClassErrors() {
155155 }
156156
157157 public function testFunctionsOutsideClassWarnings () {
158- $ fixtureFile = __DIR__ . ' /fixtures/ FunctionsOutsideClassFixture.php ' ;
158+ $ fixtureFile = $ this -> getFixture ( ' FunctionsOutsideClassFixture.php ') ;
159159 $ phpcsFile = $ this ->prepareLocalFileForSniffs ($ this ->getSniffFiles (), $ fixtureFile );
160160 $ phpcsFile ->process ();
161161 $ lines = $ this ->getWarningLineNumbersFromFile ($ phpcsFile );
@@ -166,7 +166,7 @@ public function testFunctionsOutsideClassWarnings() {
166166 }
167167
168168 public function testFunctionWithClosureErrors () {
169- $ fixtureFile = __DIR__ . ' /fixtures/ FunctionWithClosureFixture.php ' ;
169+ $ fixtureFile = $ this -> getFixture ( ' FunctionWithClosureFixture.php ') ;
170170 $ phpcsFile = $ this ->prepareLocalFileForSniffs ($ this ->getSniffFiles (), $ fixtureFile );
171171 $ phpcsFile ->process ();
172172 $ lines = $ this ->getErrorLineNumbersFromFile ($ phpcsFile );
@@ -177,7 +177,7 @@ public function testFunctionWithClosureErrors() {
177177 }
178178
179179 public function testFunctionWithClosureWarnings () {
180- $ fixtureFile = __DIR__ . ' /fixtures/ FunctionWithClosureFixture.php ' ;
180+ $ fixtureFile = $ this -> getFixture ( ' FunctionWithClosureFixture.php ') ;
181181 $ phpcsFile = $ this ->prepareLocalFileForSniffs ($ this ->getSniffFiles (), $ fixtureFile );
182182 $ phpcsFile ->process ();
183183 $ lines = $ this ->getWarningLineNumbersFromFile ($ phpcsFile );
@@ -202,7 +202,7 @@ public function testFunctionWithClosureWarnings() {
202202 }
203203
204204 public function testFunctionWithReferenceErrors () {
205- $ fixtureFile = __DIR__ . ' /fixtures/ FunctionWithReferenceFixture.php ' ;
205+ $ fixtureFile = $ this -> getFixture ( ' FunctionWithReferenceFixture.php ') ;
206206 $ phpcsFile = $ this ->prepareLocalFileForSniffs ($ this ->getSniffFiles (), $ fixtureFile );
207207 $ phpcsFile ->process ();
208208 $ lines = $ this ->getErrorLineNumbersFromFile ($ phpcsFile );
@@ -211,7 +211,7 @@ public function testFunctionWithReferenceErrors() {
211211 }
212212
213213 public function testFunctionWithReferenceWarnings () {
214- $ fixtureFile = __DIR__ . ' /fixtures/ FunctionWithReferenceFixture.php ' ;
214+ $ fixtureFile = $ this -> getFixture ( ' FunctionWithReferenceFixture.php ') ;
215215 $ phpcsFile = $ this ->prepareLocalFileForSniffs ($ this ->getSniffFiles (), $ fixtureFile );
216216 $ phpcsFile ->process ();
217217 $ lines = $ this ->getWarningLineNumbersFromFile ($ phpcsFile );
@@ -231,7 +231,7 @@ public function testFunctionWithReferenceWarnings() {
231231 }
232232
233233 public function testFunctionWithTryCatchErrors () {
234- $ fixtureFile = __DIR__ . ' /fixtures/ FunctionWithTryCatchFixture.php ' ;
234+ $ fixtureFile = $ this -> getFixture ( ' FunctionWithTryCatchFixture.php ') ;
235235 $ phpcsFile = $ this ->prepareLocalFileForSniffs ($ this ->getSniffFiles (), $ fixtureFile );
236236 $ phpcsFile ->process ();
237237 $ lines = $ this ->getErrorLineNumbersFromFile ($ phpcsFile );
@@ -240,7 +240,7 @@ public function testFunctionWithTryCatchErrors() {
240240 }
241241
242242 public function testFunctionWithTryCatchWarnings () {
243- $ fixtureFile = __DIR__ . ' /fixtures/ FunctionWithTryCatchFixture.php ' ;
243+ $ fixtureFile = $ this -> getFixture ( ' FunctionWithTryCatchFixture.php ') ;
244244 $ phpcsFile = $ this ->prepareLocalFileForSniffs ($ this ->getSniffFiles (), $ fixtureFile );
245245 $ phpcsFile ->process ();
246246 $ lines = $ this ->getWarningLineNumbersFromFile ($ phpcsFile );
@@ -252,7 +252,7 @@ public function testFunctionWithTryCatchWarnings() {
252252 }
253253
254254 public function testFunctionWithInlineAssignErrors () {
255- $ fixtureFile = __DIR__ . ' /fixtures/ FunctionWithInlineAssignFixture.php ' ;
255+ $ fixtureFile = $ this -> getFixture ( ' FunctionWithInlineAssignFixture.php ') ;
256256 $ phpcsFile = $ this ->prepareLocalFileForSniffs ($ this ->getSniffFiles (), $ fixtureFile );
257257 $ phpcsFile ->process ();
258258 $ lines = $ this ->getErrorLineNumbersFromFile ($ phpcsFile );
@@ -261,7 +261,7 @@ public function testFunctionWithInlineAssignErrors() {
261261 }
262262
263263 public function testFunctionWithInlineAssignWarnings () {
264- $ fixtureFile = __DIR__ . ' /fixtures/ FunctionWithInlineAssignFixture.php ' ;
264+ $ fixtureFile = $ this -> getFixture ( ' FunctionWithInlineAssignFixture.php ') ;
265265 $ phpcsFile = $ this ->prepareLocalFileForSniffs ($ this ->getSniffFiles (), $ fixtureFile );
266266 $ phpcsFile ->process ();
267267 $ lines = $ this ->getWarningLineNumbersFromFile ($ phpcsFile );
@@ -273,7 +273,7 @@ public function testFunctionWithInlineAssignWarnings() {
273273 }
274274
275275 public function testFunctionWithRedeclarationsErrors () {
276- $ fixtureFile = __DIR__ . ' /fixtures/ FunctionWithRedeclarationsFixture.php ' ;
276+ $ fixtureFile = $ this -> getFixture ( ' FunctionWithRedeclarationsFixture.php ') ;
277277 $ phpcsFile = $ this ->prepareLocalFileForSniffs ($ this ->getSniffFiles (), $ fixtureFile );
278278 $ phpcsFile ->process ();
279279 $ lines = $ this ->getErrorLineNumbersFromFile ($ phpcsFile );
@@ -282,7 +282,7 @@ public function testFunctionWithRedeclarationsErrors() {
282282 }
283283
284284 public function testFunctionWithRedeclarationsWarnings () {
285- $ fixtureFile = __DIR__ . ' /fixtures/ FunctionWithRedeclarationsFixture.php ' ;
285+ $ fixtureFile = $ this -> getFixture ( ' FunctionWithRedeclarationsFixture.php ') ;
286286 $ phpcsFile = $ this ->prepareLocalFileForSniffs ($ this ->getSniffFiles (), $ fixtureFile );
287287 $ phpcsFile ->process ();
288288 $ lines = $ this ->getWarningLineNumbersFromFile ($ phpcsFile );
@@ -305,7 +305,7 @@ public function testFunctionWithRedeclarationsWarnings() {
305305 }
306306
307307 public function testHeredocErrors () {
308- $ fixtureFile = __DIR__ . ' /fixtures/ HeredocFixture.php ' ;
308+ $ fixtureFile = $ this -> getFixture ( ' HeredocFixture.php ') ;
309309 $ phpcsFile = $ this ->prepareLocalFileForSniffs ($ this ->getSniffFiles (), $ fixtureFile );
310310 $ phpcsFile ->process ();
311311 $ lines = $ this ->getErrorLineNumbersFromFile ($ phpcsFile );
@@ -314,7 +314,7 @@ public function testHeredocErrors() {
314314 }
315315
316316 public function testHeredocWarnings () {
317- $ fixtureFile = __DIR__ . ' /fixtures/ HeredocFixture.php ' ;
317+ $ fixtureFile = $ this -> getFixture ( ' HeredocFixture.php ') ;
318318 $ phpcsFile = $ this ->prepareLocalFileForSniffs ($ this ->getSniffFiles (), $ fixtureFile );
319319 $ phpcsFile ->process ();
320320 $ lines = $ this ->getWarningLineNumbersFromFile ($ phpcsFile );
@@ -328,7 +328,7 @@ public function testHeredocWarnings() {
328328 }
329329
330330 public function testClassReferenceErrors () {
331- $ fixtureFile = __DIR__ . ' /fixtures/ ClassReferenceFixture.php ' ;
331+ $ fixtureFile = $ this -> getFixture ( ' ClassReferenceFixture.php ') ;
332332 $ phpcsFile = $ this ->prepareLocalFileForSniffs ($ this ->getSniffFiles (), $ fixtureFile );
333333 $ phpcsFile ->process ();
334334 $ lines = $ this ->getErrorLineNumbersFromFile ($ phpcsFile );
@@ -337,7 +337,7 @@ public function testClassReferenceErrors() {
337337 }
338338
339339 public function testClassReferenceWarnings () {
340- $ fixtureFile = __DIR__ . ' /fixtures/ ClassReferenceFixture.php ' ;
340+ $ fixtureFile = $ this -> getFixture ( ' ClassReferenceFixture.php ') ;
341341 $ phpcsFile = $ this ->prepareLocalFileForSniffs ($ this ->getSniffFiles (), $ fixtureFile );
342342 $ phpcsFile ->process ();
343343 $ lines = $ this ->getWarningLineNumbersFromFile ($ phpcsFile );
@@ -351,7 +351,7 @@ public function testClassReferenceWarnings() {
351351 }
352352
353353 public function testCompactErrors () {
354- $ fixtureFile = __DIR__ . ' /fixtures/ CompactFixture.php ' ;
354+ $ fixtureFile = $ this -> getFixture ( ' CompactFixture.php ') ;
355355 $ phpcsFile = $ this ->prepareLocalFileForSniffs ($ this ->getSniffFiles (), $ fixtureFile );
356356 $ phpcsFile ->process ();
357357 $ lines = $ this ->getErrorLineNumbersFromFile ($ phpcsFile );
@@ -360,7 +360,7 @@ public function testCompactErrors() {
360360 }
361361
362362 public function testCompactWarnings () {
363- $ fixtureFile = __DIR__ . ' /fixtures/ CompactFixture.php ' ;
363+ $ fixtureFile = $ this -> getFixture ( ' CompactFixture.php ') ;
364364 $ phpcsFile = $ this ->prepareLocalFileForSniffs ($ this ->getSniffFiles (), $ fixtureFile );
365365 $ phpcsFile ->process ();
366366 $ lines = $ this ->getWarningLineNumbersFromFile ($ phpcsFile );
0 commit comments