5
5
6
6
class CheckTest extends TestCase
7
7
{
8
- protected $ uut ;
8
+ protected static $ uut ;
9
9
10
10
11
- public function __construct ()
11
+ public static function setUpBeforeClass ()
12
12
{
13
13
$ settings = new PhpVarDumpCheck \Settings ();
14
- $ this -> uut = new PhpVarDumpCheck \Checker ($ settings );
14
+ self :: $ uut = new PhpVarDumpCheck \Checker ($ settings );
15
15
}
16
16
17
17
@@ -21,7 +21,7 @@ public function testCheck_emptyFile_noDump()
21
21
<?php
22
22
23
23
PHP ;
24
- $ result = $ this -> uut ->check ($ content );
24
+ $ result = self :: $ uut ->check ($ content );
25
25
$ this ->assertCount (0 , $ result );
26
26
}
27
27
@@ -32,7 +32,7 @@ public function testCheck_singleVarDump_dump()
32
32
<?php
33
33
var_dump('Ahoj');
34
34
PHP ;
35
- $ result = $ this -> uut ->check ($ content );
35
+ $ result = self :: $ uut ->check ($ content );
36
36
$ this ->assertCount (1 , $ result );
37
37
$ this ->assertEquals ('var_dump ' , $ result [0 ]->getType ());
38
38
$ this ->assertTrue ($ result [0 ]->isSure ());
@@ -46,7 +46,7 @@ public function testCheck_singlePrintR_dump()
46
46
<?php
47
47
print_r('Ahoj');
48
48
PHP ;
49
- $ result = $ this -> uut ->check ($ content );
49
+ $ result = self :: $ uut ->check ($ content );
50
50
$ this ->assertCount (1 , $ result );
51
51
$ this ->assertEquals ('print_r ' , $ result [0 ]->getType ());
52
52
$ this ->assertTrue ($ result [0 ]->isSure ());
@@ -60,7 +60,7 @@ public function testCheck_singleVarExport_dump()
60
60
<?php
61
61
var_export('Ahoj');
62
62
PHP ;
63
- $ result = $ this -> uut ->check ($ content );
63
+ $ result = self :: $ uut ->check ($ content );
64
64
$ this ->assertCount (1 , $ result );
65
65
$ this ->assertEquals ('var_export ' , $ result [0 ]->getType ());
66
66
$ this ->assertTrue ($ result [0 ]->isSure ());
@@ -80,7 +80,7 @@ public function testCheck_templateSingleVarExport_dump()
80
80
?>
81
81
var_export('Ahoj');
82
82
PHP ;
83
- $ result = $ this -> uut ->check ($ content );
83
+ $ result = self :: $ uut ->check ($ content );
84
84
$ this ->assertCount (1 , $ result );
85
85
$ this ->assertEquals ('var_export ' , $ result [0 ]->getType ());
86
86
$ this ->assertTrue ($ result [0 ]->isSure ());
@@ -95,7 +95,7 @@ public function testCheck_singleVarExportWhitespaces_dump()
95
95
var_export ( 'Ahoj'
96
96
) ;
97
97
PHP ;
98
- $ result = $ this -> uut ->check ($ content );
98
+ $ result = self :: $ uut ->check ($ content );
99
99
$ this ->assertCount (1 , $ result );
100
100
$ this ->assertEquals ('var_export ' , $ result [0 ]->getType ());
101
101
$ this ->assertTrue ($ result [0 ]->isSure ());
@@ -110,7 +110,7 @@ public function testCheck_singleVarExportWhitespaces_comments()
110
110
var_export /* v */ ( /* v */ 'Ahoj'/* v */
111
111
) ;
112
112
PHP ;
113
- $ result = $ this -> uut ->check ($ content );
113
+ $ result = self :: $ uut ->check ($ content );
114
114
$ this ->assertCount (1 , $ result );
115
115
$ this ->assertEquals ('var_export ' , $ result [0 ]->getType ());
116
116
$ this ->assertTrue ($ result [0 ]->isSure ());
@@ -127,7 +127,7 @@ public function testCheck_singlePrintRWithReturnFalse_dump()
127
127
<?php
128
128
print_r('Ahoj', false);
129
129
PHP ;
130
- $ result = $ this -> uut ->check ($ content );
130
+ $ result = self :: $ uut ->check ($ content );
131
131
$ this ->assertCount (1 , $ result );
132
132
$ this ->assertEquals ('print_r ' , $ result [0 ]->getType ());
133
133
$ this ->assertTrue ($ result [0 ]->isSure ());
@@ -141,7 +141,7 @@ public function testCheck_singlePrintRWithReturnFalseComments_dump()
141
141
<?php
142
142
print_r('Ahoj'/**/,/**/false/**/);
143
143
PHP ;
144
- $ result = $ this -> uut ->check ($ content );
144
+ $ result = self :: $ uut ->check ($ content );
145
145
$ this ->assertCount (1 , $ result );
146
146
$ this ->assertEquals ('print_r ' , $ result [0 ]->getType ());
147
147
$ this ->assertTrue ($ result [0 ]->isSure ());
@@ -155,7 +155,7 @@ public function testCheck_singlePrintRWithReturnNull_dump()
155
155
<?php
156
156
print_r('Ahoj', null);
157
157
PHP ;
158
- $ result = $ this -> uut ->check ($ content );
158
+ $ result = self :: $ uut ->check ($ content );
159
159
$ this ->assertCount (1 , $ result );
160
160
$ this ->assertEquals ('print_r ' , $ result [0 ]->getType ());
161
161
$ this ->assertTrue ($ result [0 ]->isSure ());
@@ -169,7 +169,7 @@ public function testCheck_singlePrintRWithReturnIntZero_dump()
169
169
<?php
170
170
print_r('Ahoj', 0);
171
171
PHP ;
172
- $ result = $ this -> uut ->check ($ content );
172
+ $ result = self :: $ uut ->check ($ content );
173
173
$ this ->assertCount (1 , $ result );
174
174
$ this ->assertEquals ('print_r ' , $ result [0 ]->getType ());
175
175
$ this ->assertTrue ($ result [0 ]->isSure ());
@@ -183,7 +183,7 @@ public function testCheck_singlePrintRWithReturnFloatZero_dump()
183
183
<?php
184
184
print_r('Ahoj', 0.0);
185
185
PHP ;
186
- $ result = $ this -> uut ->check ($ content );
186
+ $ result = self :: $ uut ->check ($ content );
187
187
$ this ->assertCount (1 , $ result );
188
188
$ this ->assertEquals ('print_r ' , $ result [0 ]->getType ());
189
189
$ this ->assertTrue ($ result [0 ]->isSure ());
@@ -197,7 +197,7 @@ public function testCheck_singlePrintRWithReturnFalseVariableAssign_dump()
197
197
<?php
198
198
print_r('Ahoj', \$var = false);
199
199
PHP ;
200
- $ result = $ this -> uut ->check ($ content );
200
+ $ result = self :: $ uut ->check ($ content );
201
201
$ this ->assertCount (1 , $ result );
202
202
$ this ->assertEquals ('print_r ' , $ result [0 ]->getType ());
203
203
$ this ->assertTrue ($ result [0 ]->isSure ());
@@ -211,7 +211,7 @@ public function testCheck_staticMethodInOtherClass_ignore()
211
211
<?php
212
212
OtherClass::print_r('Ahoj');
213
213
PHP ;
214
- $ result = $ this -> uut ->check ($ content );
214
+ $ result = self :: $ uut ->check ($ content );
215
215
$ this ->assertCount (0 , $ result );
216
216
}
217
217
@@ -223,7 +223,7 @@ public function testCheck_objectMethod_ignore()
223
223
\$object = new stdClass();
224
224
\$object->print_r('Ahoj');
225
225
PHP ;
226
- $ result = $ this -> uut ->check ($ content );
226
+ $ result = self :: $ uut ->check ($ content );
227
227
$ this ->assertCount (0 , $ result );
228
228
}
229
229
@@ -241,7 +241,7 @@ public function print_r()
241
241
\$object = new print_r();
242
242
\$object->print_r();
243
243
PHP ;
244
- $ result = $ this -> uut ->check ($ content );
244
+ $ result = self :: $ uut ->check ($ content );
245
245
$ this ->assertCount (1 , $ result );
246
246
$ this ->assertEquals ('print_r ' , $ result [0 ]->getType ());
247
247
$ this ->assertTrue ($ result [0 ]->isSure ());
@@ -254,7 +254,7 @@ public function testCheck_debugRightAfterStart_dump()
254
254
$ content = <<<PHP
255
255
<?php print_r('ahoj');
256
256
PHP ;
257
- $ result = $ this -> uut ->check ($ content );
257
+ $ result = self :: $ uut ->check ($ content );
258
258
$ this ->assertCount (1 , $ result );
259
259
}
260
260
}
0 commit comments