Skip to content

Commit 3ea8b79

Browse files
authored
[11.x] Supports PHPUnit 12.0 (#54316)
* Supports PHPUnit 12.0 Signed-off-by: Mior Muhammad Zaki <[email protected]> * wip Signed-off-by: Mior Muhammad Zaki <[email protected]> * wip Signed-off-by: Mior Muhammad Zaki <[email protected]> * wip Signed-off-by: Mior Muhammad Zaki <[email protected]> * wip Signed-off-by: Mior Muhammad Zaki <[email protected]> * wip Signed-off-by: Mior Muhammad Zaki <[email protected]> * Apply suggestions from code review * Update composer.json * Apply suggestions from code review * Update composer.json --------- Signed-off-by: Mior Muhammad Zaki <[email protected]>
1 parent 917a3fe commit 3ea8b79

File tree

4 files changed

+14
-9
lines changed

4 files changed

+14
-9
lines changed

.github/workflows/tests.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,11 @@ jobs:
4040
fail-fast: true
4141
matrix:
4242
php: [8.2, 8.3, 8.4]
43-
phpunit: ['10.5.12', '11.3.2']
43+
phpunit: ['10.5.35', '11.3.2', '12.0.0']
4444
stability: [prefer-lowest, prefer-stable]
45+
exclude:
46+
- php: 8.2
47+
phpunit: '12.0.0'
4548

4649
name: PHP ${{ matrix.php }} - PHPUnit ${{ matrix.phpunit }} - ${{ matrix.stability }}
4750

composer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,11 +111,11 @@
111111
"league/flysystem-read-only": "^3.25.1",
112112
"league/flysystem-sftp-v3": "^3.25.1",
113113
"mockery/mockery": "^1.6.10",
114-
"orchestra/testbench-core": "^9.6",
114+
"orchestra/testbench-core": "^9.9.4",
115115
"pda/pheanstalk": "^5.0.6",
116116
"php-http/discovery": "^1.15",
117117
"phpstan/phpstan": "^2.0",
118-
"phpunit/phpunit": "^10.5.35|^11.3.6",
118+
"phpunit/phpunit": "^10.5.35|^11.3.6|^12.0.1",
119119
"predis/predis": "^2.3",
120120
"resend/resend-php": "^0.10.0",
121121
"symfony/cache": "^7.0.3",
@@ -188,7 +188,7 @@
188188
"mockery/mockery": "Required to use mocking (^1.6).",
189189
"pda/pheanstalk": "Required to use the beanstalk queue driver (^5.0).",
190190
"php-http/discovery": "Required to use PSR-7 bridging features (^1.15).",
191-
"phpunit/phpunit": "Required to use assertions and run tests (^10.5|^11.0).",
191+
"phpunit/phpunit": "Required to use assertions and run tests (^10.5.35|^11.3.6|^12.0.1).",
192192
"predis/predis": "Required to use the predis connector (^2.3).",
193193
"psr/http-message": "Required to allow Storage::put to accept a StreamInterface (^1.0).",
194194
"pusher/pusher-php-server": "Required to use the Pusher broadcast driver (^6.0|^7.0).",

src/Illuminate/Foundation/Testing/Concerns/InteractsWithTestCaseLifecycle.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -243,10 +243,12 @@ protected function setUpTraits()
243243
*/
244244
public static function tearDownAfterClassUsingTestCase()
245245
{
246-
(function () {
247-
$this->classDocBlocks = [];
248-
$this->methodDocBlocks = [];
249-
})->call(PHPUnitRegistry::getInstance());
246+
if (class_exists(PHPUnitRegistry::class)) {
247+
(function () {
248+
$this->classDocBlocks = [];
249+
$this->methodDocBlocks = [];
250+
})->call(PHPUnitRegistry::getInstance());
251+
}
250252
}
251253

252254
/**

src/Illuminate/Testing/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
"illuminate/database": "Required to assert databases (^11.0).",
3838
"illuminate/http": "Required to assert responses (^11.0).",
3939
"mockery/mockery": "Required to use mocking (^1.6).",
40-
"phpunit/phpunit": "Required to use assertions and run tests (^10.5|^11.0)."
40+
"phpunit/phpunit": "Required to use assertions and run tests (^10.5.35|^11.3.6|^12.0.1)."
4141
},
4242
"config": {
4343
"sort-packages": true

0 commit comments

Comments
 (0)