diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index f0020fd25d7..70b4ff96867 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -40,8 +40,11 @@ jobs: fail-fast: true matrix: php: [8.2, 8.3, 8.4] - phpunit: ['10.5.12', '11.3.2'] + phpunit: ['10.5.35', '11.3.2', '12.0.0'] stability: [prefer-lowest, prefer-stable] + exclude: + - php: 8.2 + phpunit: '12.0.0' name: PHP ${{ matrix.php }} - PHPUnit ${{ matrix.phpunit }} - ${{ matrix.stability }} diff --git a/composer.json b/composer.json index cff176b011a..cf2c2589ce8 100644 --- a/composer.json +++ b/composer.json @@ -111,11 +111,11 @@ "league/flysystem-read-only": "^3.25.1", "league/flysystem-sftp-v3": "^3.25.1", "mockery/mockery": "^1.6.10", - "orchestra/testbench-core": "^9.6", + "orchestra/testbench-core": "^9.9.4", "pda/pheanstalk": "^5.0.6", "php-http/discovery": "^1.15", "phpstan/phpstan": "^2.0", - "phpunit/phpunit": "^10.5.35|^11.3.6", + "phpunit/phpunit": "^10.5.35|^11.3.6|^12.0.1", "predis/predis": "^2.3", "resend/resend-php": "^0.10.0", "symfony/cache": "^7.0.3", @@ -188,7 +188,7 @@ "mockery/mockery": "Required to use mocking (^1.6).", "pda/pheanstalk": "Required to use the beanstalk queue driver (^5.0).", "php-http/discovery": "Required to use PSR-7 bridging features (^1.15).", - "phpunit/phpunit": "Required to use assertions and run tests (^10.5|^11.0).", + "phpunit/phpunit": "Required to use assertions and run tests (^10.5.35|^11.3.6|^12.0.1).", "predis/predis": "Required to use the predis connector (^2.3).", "psr/http-message": "Required to allow Storage::put to accept a StreamInterface (^1.0).", "pusher/pusher-php-server": "Required to use the Pusher broadcast driver (^6.0|^7.0).", diff --git a/src/Illuminate/Foundation/Testing/Concerns/InteractsWithTestCaseLifecycle.php b/src/Illuminate/Foundation/Testing/Concerns/InteractsWithTestCaseLifecycle.php index 95a5e51f155..fdb17c7780c 100644 --- a/src/Illuminate/Foundation/Testing/Concerns/InteractsWithTestCaseLifecycle.php +++ b/src/Illuminate/Foundation/Testing/Concerns/InteractsWithTestCaseLifecycle.php @@ -243,10 +243,12 @@ protected function setUpTraits() */ public static function tearDownAfterClassUsingTestCase() { - (function () { - $this->classDocBlocks = []; - $this->methodDocBlocks = []; - })->call(PHPUnitRegistry::getInstance()); + if (class_exists(PHPUnitRegistry::class)) { + (function () { + $this->classDocBlocks = []; + $this->methodDocBlocks = []; + })->call(PHPUnitRegistry::getInstance()); + } } /** diff --git a/src/Illuminate/Testing/composer.json b/src/Illuminate/Testing/composer.json index 2046c34945f..f8b01f1c56b 100644 --- a/src/Illuminate/Testing/composer.json +++ b/src/Illuminate/Testing/composer.json @@ -37,7 +37,7 @@ "illuminate/database": "Required to assert databases (^11.0).", "illuminate/http": "Required to assert responses (^11.0).", "mockery/mockery": "Required to use mocking (^1.6).", - "phpunit/phpunit": "Required to use assertions and run tests (^10.5|^11.0)." + "phpunit/phpunit": "Required to use assertions and run tests (^10.5.35|^11.3.6|^12.0.1)." }, "config": { "sort-packages": true