From 84712ba8460f73dadfc7abcf9a5faa886cb5ec31 Mon Sep 17 00:00:00 2001 From: Mior Muhammad Zaki Date: Thu, 23 Jan 2025 18:09:25 +0800 Subject: [PATCH 1/6] Supports PHPUnit 12.0 Signed-off-by: Mior Muhammad Zaki --- composer.json | 6 +++--- .../Concerns/InteractsWithTestCaseLifecycle.php | 10 ++++++---- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/composer.json b/composer.json index 76e2d34ad034..75f32188cc53 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": "dev-phpunit12", "pda/pheanstalk": "^5.0.6", "php-http/discovery": "^1.15", "phpstan/phpstan": "^1.11.5", - "phpunit/phpunit": "^10.5.35|^11.3.6", + "phpunit/phpunit": "^10.5.35|^11.3.6|^12.0", "predis/predis": "^2.3", "resend/resend-php": "^0.10.0", "symfony/cache": "^7.0.3", @@ -207,6 +207,6 @@ "php-http/discovery": false } }, - "minimum-stability": "stable", + "minimum-stability": "dev", "prefer-stable": true } diff --git a/src/Illuminate/Foundation/Testing/Concerns/InteractsWithTestCaseLifecycle.php b/src/Illuminate/Foundation/Testing/Concerns/InteractsWithTestCaseLifecycle.php index ed058498d86f..86efb020a01d 100644 --- a/src/Illuminate/Foundation/Testing/Concerns/InteractsWithTestCaseLifecycle.php +++ b/src/Illuminate/Foundation/Testing/Concerns/InteractsWithTestCaseLifecycle.php @@ -241,10 +241,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()); + } } /** From a58a69f15a1ffdfbd900dde241dc23470027b4bc Mon Sep 17 00:00:00 2001 From: Mior Muhammad Zaki Date: Thu, 23 Jan 2025 18:10:50 +0800 Subject: [PATCH 2/6] wip Signed-off-by: Mior Muhammad Zaki --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index f0020fd25d72..05ad9380a280 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -40,7 +40,7 @@ jobs: fail-fast: true matrix: php: [8.2, 8.3, 8.4] - phpunit: ['10.5.12', '11.3.2'] + phpunit: ['10.5.12', '11.3.2', '12.0'] stability: [prefer-lowest, prefer-stable] name: PHP ${{ matrix.php }} - PHPUnit ${{ matrix.phpunit }} - ${{ matrix.stability }} From 97e769eb3b82c3958fd2bc93a69025e1b24341cb Mon Sep 17 00:00:00 2001 From: Mior Muhammad Zaki Date: Thu, 23 Jan 2025 18:11:23 +0800 Subject: [PATCH 3/6] wip Signed-off-by: Mior Muhammad Zaki --- .github/workflows/tests.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 05ad9380a280..726286453aac 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', '12.0'] + phpunit: ['10.5.12', '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 }} From f7dd001fd79d15ccadaa65a47198002b574b9ca6 Mon Sep 17 00:00:00 2001 From: Mior Muhammad Zaki Date: Thu, 23 Jan 2025 18:12:35 +0800 Subject: [PATCH 4/6] wip Signed-off-by: Mior Muhammad Zaki --- .github/workflows/tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 726286453aac..30805ce1a6d7 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -43,8 +43,8 @@ jobs: phpunit: ['10.5.12', '11.3.2', '12.0.0'] stability: [prefer-lowest, prefer-stable] exclude: - php: 8.2 - phpunit: '12.0.0' + - php: 8.2 + phpunit: '12.0.0' name: PHP ${{ matrix.php }} - PHPUnit ${{ matrix.phpunit }} - ${{ matrix.stability }} From 4d1bfbfbb36a9e49b79bd50af33345483257cb55 Mon Sep 17 00:00:00 2001 From: Mior Muhammad Zaki Date: Thu, 23 Jan 2025 22:17:12 +0800 Subject: [PATCH 5/6] wip Signed-off-by: Mior Muhammad Zaki --- composer.json | 2 +- src/Illuminate/Testing/composer.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 75f32188cc53..d9a6cc434817 100644 --- a/composer.json +++ b/composer.json @@ -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).", "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/Testing/composer.json b/src/Illuminate/Testing/composer.json index 2046c34945fe..a980ebc119c3 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)." }, "config": { "sort-packages": true From 8a4e18735b70541da473b71c8a51cfc97fe8aff9 Mon Sep 17 00:00:00 2001 From: Mior Muhammad Zaki Date: Fri, 24 Jan 2025 08:46:47 +0800 Subject: [PATCH 6/6] wip Signed-off-by: Mior Muhammad Zaki --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index d9a6cc434817..f91fe035efb5 100644 --- a/composer.json +++ b/composer.json @@ -111,7 +111,7 @@ "league/flysystem-read-only": "^3.25.1", "league/flysystem-sftp-v3": "^3.25.1", "mockery/mockery": "^1.6.10", - "orchestra/testbench-core": "dev-phpunit12", + "orchestra/testbench-core": "9.x-dev", "pda/pheanstalk": "^5.0.6", "php-http/discovery": "^1.15", "phpstan/phpstan": "^1.11.5",