File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -137,7 +137,7 @@ public static function fromClassReflector(ReflectionClass $class): static
137137 $ testSuite ->addTestMethod ($ class , $ method );
138138 }
139139
140- if (count ( $ testSuite) === 0 ) {
140+ if ($ testSuite-> isEmpty () ) {
141141 Event \Facade::emitter ()->testRunnerTriggeredWarning (
142142 sprintf (
143143 'No tests found in class "%s". ' ,
@@ -290,7 +290,13 @@ public function count(): int
290290
291291 public function isEmpty (): bool
292292 {
293- return empty ($ this ->tests );
293+ foreach ($ this as $ test ) {
294+ if (count ($ test ) !== 0 ) {
295+ return false ;
296+ }
297+ }
298+
299+ return true ;
294300 }
295301
296302 /**
@@ -337,7 +343,7 @@ public function run(): void
337343
338344 $ this ->wasRun = true ;
339345
340- if (count ( $ this ) === 0 ) {
346+ if ($ this -> isEmpty () ) {
341347 return ;
342348 }
343349
@@ -362,7 +368,7 @@ public function run(): void
362368 $ this ->tests = [];
363369 $ this ->groups = [];
364370
365- while (($ test = array_pop ($ tests )) !== false ) {
371+ while (($ test = array_pop ($ tests )) !== null ) {
366372 if (TestResultFacade::shouldStop ()) {
367373 $ emitter ->testRunnerExecutionAborted ();
368374
You can’t perform that action at this time.
0 commit comments