@@ -121,7 +121,7 @@ public function startTestSuite($suite)
121
121
$ suiteName = $ suite ->getName ();
122
122
123
123
foreach ($ suite ->tests () as $ test ) {
124
- if (!($ test instanceof \PHPUnit \ Framework \TestCase || $ test instanceof TestCase)) {
124
+ if (!($ test instanceof \PHPUnit_Framework_TestCase || $ test instanceof TestCase)) {
125
125
continue ;
126
126
}
127
127
if (null === Test::getPreserveGlobalStateSettings (\get_class ($ test ), $ test ->getName (false ))) {
@@ -156,7 +156,7 @@ public function startTestSuite($suite)
156
156
$ testSuites = [$ suite ];
157
157
for ($ i = 0 ; isset ($ testSuites [$ i ]); ++$ i ) {
158
158
foreach ($ testSuites [$ i ]->tests () as $ test ) {
159
- if ($ test instanceof TestSuite) {
159
+ if ($ test instanceof \PHPUnit_Framework_TestSuite || $ test instanceof TestSuite) {
160
160
if (!class_exists ($ test ->getName (), false )) {
161
161
$ testSuites [] = $ test ;
162
162
continue ;
@@ -172,12 +172,19 @@ public function startTestSuite($suite)
172
172
}
173
173
}
174
174
} elseif (2 === $ this ->state ) {
175
+ $ suites = [$ suite ];
175
176
$ skipped = [];
176
- foreach ($ suite ->tests () as $ test ) {
177
- if (!($ test instanceof \PHPUnit \Framework \TestCase || $ test instanceof TestCase)
178
- || isset ($ this ->wasSkipped [$ suiteName ]['* ' ])
179
- || isset ($ this ->wasSkipped [$ suiteName ][$ test ->getName ()])) {
180
- $ skipped [] = $ test ;
177
+ while ($ s = array_shift ($ suites )) {
178
+ foreach ($ s ->tests () as $ test ) {
179
+ if ($ test instanceof \PHPUnit_Framework_TestSuite || $ test instanceof TestSuite) {
180
+ $ suites [] = $ test ;
181
+ continue
182
+ }
183
+ if (($ test instanceof \PHPUnit_Framework_TestCase || $ test instanceof TestCase)
184
+ && isset ($ this ->wasSkipped [\get_class ($ test )][$ test ->getName ()])
185
+ ) {
186
+ $ skipped [] = $ test ;
187
+ }
181
188
}
182
189
}
183
190
$ suite ->setTests ($ skipped );
@@ -187,21 +194,13 @@ public function startTestSuite($suite)
187
194
public function addSkippedTest ($ test , \Exception $ e , $ time )
188
195
{
189
196
if (0 < $ this ->state ) {
190
- if ($ test instanceof \PHPUnit \Framework \TestCase || $ test instanceof TestCase) {
191
- $ class = \get_class ($ test );
192
- $ method = $ test ->getName ();
193
- } else {
194
- $ class = $ test ->getName ();
195
- $ method = '* ' ;
196
- }
197
-
198
- $ this ->isSkipped [$ class ][$ method ] = 1 ;
197
+ $ this ->isSkipped [\get_class ($ test )][$ test ->getName ()] = 1 ;
199
198
}
200
199
}
201
200
202
201
public function startTest ($ test )
203
202
{
204
- if (-2 < $ this ->state && ($ test instanceof \PHPUnit \ Framework \TestCase || $ test instanceof TestCase)) {
203
+ if (-2 < $ this ->state && ($ test instanceof \PHPUnit_Framework_TestCase || $ test instanceof TestCase)) {
205
204
// This event is triggered before the test is re-run in isolation
206
205
if ($ this ->willBeIsolated ($ test )) {
207
206
$ this ->runsInSeparateProcess = tempnam (sys_get_temp_dir (), 'deprec ' );
@@ -291,7 +290,7 @@ public function endTest($test, $time)
291
290
$ this ->expectedDeprecations = $ this ->gatheredDeprecations = [];
292
291
$ this ->previousErrorHandler = null ;
293
292
}
294
- if (!$ this ->runsInSeparateProcess && -2 < $ this ->state && ($ test instanceof \PHPUnit \ Framework \TestCase || $ test instanceof TestCase)) {
293
+ if (!$ this ->runsInSeparateProcess && -2 < $ this ->state && ($ test instanceof \PHPUnit_Framework_TestCase || $ test instanceof TestCase)) {
295
294
if (\in_array ('time-sensitive ' , $ groups , true )) {
296
295
ClockMock::withClockMock (false );
297
296
}
0 commit comments