File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change 77use Codeception \Stub ;
88use Codeception \Stub \StubMarshaler ;
99use PHPUnit \Framework \MockObject \MockObject ;
10+ use PHPUnit \Framework \MockObject \NoMoreReturnValuesConfiguredException ;
1011use PHPUnit \Framework \TestCase ;
12+ use PHPUnit \Runner \Version as PHPUnitVersion ;
1113
1214final class StubTest extends TestCase
1315{
@@ -363,7 +365,14 @@ public function testConsecutive()
363365 $ this ->assertEquals ('amy ' , $ dummy ->helloWorld ());
364366
365367 // Expected null value when no more values
366- $ this ->assertNull ($ dummy ->helloWorld ());
368+ // For PHP 10.5.30 or higher an exception is thrown
369+ // https://github.com/sebastianbergmann/phpunit/commit/490879817a1417fd5fa1149a47b6f2f1b70ada6a
370+ if (version_compare (PHPUnitVersion::id (), '10.5.30 ' , '>= ' )) {
371+ $ this ->expectException (NoMoreReturnValuesConfiguredException::class);
372+ $ dummy ->helloWorld ();
373+ } else {
374+ $ this ->assertNull ($ dummy ->helloWorld ());
375+ }
367376 }
368377
369378 public function testStubPrivateProperties ()
You can’t perform that action at this time.
0 commit comments