diff --git a/CHANGELOG-9.x.md b/CHANGELOG-9.x.md index 32c0a63d..3c156e24 100644 --- a/CHANGELOG-9.x.md +++ b/CHANGELOG-9.x.md @@ -2,6 +2,14 @@ This changelog references the relevant changes (bug and security fixes) done to `orchestra/testbench-core`. +## 9.7.2 + +Released: 2024-12-06 + +### Fixes + +* Fixes `Orchestra\Testbench\phpunit_version_compare()` function on PHPUnit (dev). + ## 9.7.1 Released: 2024-12-05 @@ -41,6 +49,14 @@ Released: 2024-12-01 * Deprecate `Orchestra\Testbench\Foundation\Console\Concerns\HandleTerminatingConsole` trait, use `Orchestra\Testbench\Foundation\Console\TerminatingConsole` class instead. +## 9.6.4 + +Released: 2024-12-06 + +### Fixes + +* Fixes `Orchestra\Testbench\phpunit_version_compare()` function on PHPUnit (dev). + ## 9.6.3 Released: 2024-12-05 diff --git a/src/functions.php b/src/functions.php index 2e4007e3..c6b98e76 100644 --- a/src/functions.php +++ b/src/functions.php @@ -406,7 +406,7 @@ function phpunit_version_compare(string $version, ?string $operator = null): int /** @var string $phpunit */ $phpunit = transform( Version::id(), - fn (string $version) => $version === '11.5-dev' ? '11.5.0' : $version, + fn (string $version) => str_starts_with($version, '11.5-') ? '11.5.0' : $version, ); if (\is_null($operator)) { diff --git a/tests/HelpersTest.php b/tests/HelpersTest.php index cbfd0fc2..1679f3ac 100644 --- a/tests/HelpersTest.php +++ b/tests/HelpersTest.php @@ -26,7 +26,7 @@ public function it_can_compare_laravel_version() #[Test] public function it_can_compare_phpunit_version() { - $phpunit = Version::id() === '11.5-dev' ? '11.5.0' : Version::id(); + $phpunit = str_starts_with(Version::id(), '11.5-') ? '11.5.0' : Version::id(); $this->assertSame(0, phpunit_version_compare($phpunit)); $this->assertTrue(phpunit_version_compare($phpunit, '=='));