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