diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 23b4b20..5f381d3 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -8,11 +8,11 @@ jobs: strategy: matrix: - php: [7.4, 8.0, 8.1, 8.2] + php: [7.4, 8.0, 8.1, 8.2, 8.3, 8.4] steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Setup PHP uses: shivammathur/setup-php@v2 diff --git a/tests/StubTest.php b/tests/StubTest.php index e56c3b3..d763b95 100644 --- a/tests/StubTest.php +++ b/tests/StubTest.php @@ -7,7 +7,9 @@ use Codeception\Stub; use Codeception\Stub\StubMarshaler; use PHPUnit\Framework\MockObject\MockObject; +use PHPUnit\Framework\MockObject\NoMoreReturnValuesConfiguredException; use PHPUnit\Framework\TestCase; +use PHPUnit\Runner\Version as PHPUnitVersion; final class StubTest extends TestCase { @@ -363,7 +365,14 @@ public function testConsecutive() $this->assertEquals('amy', $dummy->helloWorld()); // Expected null value when no more values - $this->assertNull($dummy->helloWorld()); + // For PHP 10.5.30 or higher an exception is thrown + // https://github.com/sebastianbergmann/phpunit/commit/490879817a1417fd5fa1149a47b6f2f1b70ada6a + if (version_compare(PHPUnitVersion::id(), '10.5.30', '>=')) { + $this->expectException(NoMoreReturnValuesConfiguredException::class); + $dummy->helloWorld(); + } else { + $this->assertNull($dummy->helloWorld()); + } } public function testStubPrivateProperties()