diff --git a/tests/CoreStubsTest.php b/tests/CoreStubsTest.php index 142be4a3e8a..c388fc12913 100644 --- a/tests/CoreStubsTest.php +++ b/tests/CoreStubsTest.php @@ -192,7 +192,7 @@ function foo(string $foo): string '$c3===' => 'bool', ], ]; - yield 'PHP8 str_* function assert non-empty-string' => [ + yield 'PHP80-str_* function assert non-empty-string' => [ 'code' => ' 'non-empty-string', ], ]; - yield "PHP8 str_* function doesn't subtract string after assertion" => [ + yield "PHP80-str_* function doesn't subtract string after assertion" => [ 'code' => 'getTestName(); if (strpos($test_name, 'PHP80-') !== false) { if (version_compare(PHP_VERSION, '8.0.0', '<')) { $this->markTestSkipped('Test case requires PHP 8.0.'); } + + if ($php_version === null) { + $php_version = '8.0'; + } } elseif (strpos($test_name, 'SKIPPED-') !== false) { $this->markTestSkipped('Skipped due to a bug.'); } + if ($php_version === null) { + $php_version = '7.4'; + } + // sanity check - do we have a PHP tag? if (strpos($code, 'fail('Test case must have a getTestName(); if (strpos($test_name, 'PHP80-') !== false) { if (version_compare(PHP_VERSION, '8.0.0', '<')) { $this->markTestSkipped('Test case requires PHP 8.0.'); } + + if ($php_version === null) { + $php_version = '8.0'; + } } elseif (strpos($test_name, 'PHP81-') !== false) { if (version_compare(PHP_VERSION, '8.1.0', '<')) { $this->markTestSkipped('Test case requires PHP 8.1.'); } + + if ($php_version === null) { + $php_version = '8.1'; + } } elseif (strpos($test_name, 'SKIPPED-') !== false) { $this->markTestSkipped('Skipped due to a bug.'); } + if ($php_version === null) { + $php_version = '7.4'; + } + // sanity check - do we have a PHP tag? if (strpos($code, 'fail('Test case must have a