Skip to content

Commit dab9d8d

Browse files
committed
Upgrades for Laravel 12
1 parent 4a886c3 commit dab9d8d

File tree

4 files changed

+17
-15
lines changed

4 files changed

+17
-15
lines changed

.github/workflows/run-tests.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,15 @@ jobs:
1616
matrix:
1717
os: [ubuntu-latest]
1818
php: [8.4, 8.3, 8.2]
19-
laravel: [11.*, 10.*]
19+
laravel: [12.*, 11.*, 10.*]
2020
dependencies: [lowest, stable]
2121
include:
2222
- laravel: 10.*
2323
testbench: ^8.0
2424
- laravel: 11.*
2525
testbench: 9.*
26+
- laravel: 12.*
27+
testbench: 10.*
2628
- dependencies: lowest
2729
carbon: ^2.62.1
2830

composer.json

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,22 +17,21 @@
1717
],
1818
"require": {
1919
"php": "^8.2",
20-
"illuminate/contracts": "11.*|10.*"
20+
"illuminate/contracts": "12.*|11.*|10.*"
2121
},
2222
"require-dev": {
2323
"composer/semver": "^3.0",
2424
"larastan/larastan": "^3.0|^2.0|^1.0",
2525
"laravel/pint": "^1.0",
2626
"mockery/mockery": "^1.6.12",
2727
"nunomaduro/collision": "^8.0|^7.8|^6.0",
28-
"orchestra/testbench": "^9.0|^8.0|^7.0",
29-
"pestphp/pest": "^1.21|^2.34",
30-
"pestphp/pest-plugin-arch": "^2.6",
31-
"pestphp/pest-plugin-laravel": "^1.1|^2.3",
28+
"orchestra/testbench": "^10.0|^9.0|^8.0",
29+
"pestphp/pest": "^1.21|^2.34|^3.0",
30+
"pestphp/pest-plugin-arch": "^2.6|^3.0",
31+
"pestphp/pest-plugin-laravel": "^1.1|^2.3|^3.0",
3232
"phpstan/extension-installer": "^1.4",
3333
"phpstan/phpdoc-parser": "^2.0",
3434
"phpstan/phpstan-deprecation-rules": "^1.0|^2.0",
35-
"phpunit/phpunit": "^10.5.36",
3635
"rector/rector": "^1.0|^2.0"
3736
},
3837
"autoload": {

tests/QueryBuilderMixinTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ protected function getPackageProviders($app): array
2626
public function test_modifying_queries_when_the_feature_is_enabled(bool $flag, string $expectedSql): void
2727
{
2828
// Laravel 11 for some reason changed how SQL is generated
29-
if (! InstalledVersions::satisfies(new VersionParser(), 'illuminate/contracts', '^11.0')) {
29+
if (! InstalledVersions::satisfies(new VersionParser(), 'illuminate/contracts', '^12.0|^11.0')) {
3030
$expectedSql = Str::replace('"', '`', $expectedSql);
3131
}
3232
Features::fake(['my-feature' => $flag]);
@@ -54,7 +54,7 @@ public static function positiveSqlStatements(): Generator
5454
public function test_modifying_queries_when_the_feature_is_not_enabled(bool $flag, string $expectedSql): void
5555
{
5656
// Laravel 11 for some reason changed how SQL is generated
57-
if (! InstalledVersions::satisfies(new VersionParser(), 'illuminate/contracts', '^11.0')) {
57+
if (! InstalledVersions::satisfies(new VersionParser(), 'illuminate/contracts', '^12.0|^11.0')) {
5858
$expectedSql = Str::replace('"', '`', $expectedSql);
5959
}
6060
Features::fake(['my-feature' => $flag]);

tests/Support/GatewayInspectorTest.php

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
use Generator;
66
use Mockery;
77
use Mockery\Adapter\Phpunit\MockeryPHPUnitIntegration;
8+
use PHPUnit\Framework\Assert;
89
use PHPUnit\Framework\Attributes\DataProvider;
910
use PHPUnit\Framework\TestCase;
1011
use YlsIdeas\FeatureFlags\ActionableFlag;
@@ -202,7 +203,7 @@ public function test_it_provides_debug_information(callable $constructs, callabl
202203
$assert($result->log());
203204
}
204205

205-
public function debugScenarios(): Generator
206+
public static function debugScenarios(): Generator
206207
{
207208
yield 'found result' => [
208209
fn (string $feature): array => [
@@ -212,7 +213,7 @@ public function debugScenarios(): Generator
212213
->getMock(),
213214
],
214215
function (ActionDebugLog $log): void {
215-
$this->assertSame([
216+
Assert::assertSame([
216217
[
217218
'pipe' => 'test',
218219
'reason' => ActionDebugLog::REASON_RESULT,
@@ -235,7 +236,7 @@ function (ActionDebugLog $log): void {
235236
->getMock(),
236237
],
237238
function (ActionDebugLog $log): void {
238-
$this->assertSame([
239+
Assert::assertSame([
239240
[
240241
'pipe' => 'test',
241242
'reason' => ActionDebugLog::REASON_CACHE,
@@ -254,7 +255,7 @@ function (ActionDebugLog $log): void {
254255
->getMock(),
255256
],
256257
function (ActionDebugLog $log): void {
257-
$this->assertSame([
258+
Assert::assertSame([
258259
[
259260
'pipe' => 'test',
260261
'reason' => ActionDebugLog::REASON_FILTER,
@@ -268,7 +269,7 @@ function (ActionDebugLog $log): void {
268269
'gateway' => Mockery::mock(Gateway::class),
269270
],
270271
function (ActionDebugLog $log): void {
271-
$this->assertSame([
272+
Assert::assertSame([
272273
[
273274
'pipe' => 'test',
274275
'reason' => ActionDebugLog::REASON_RESULT_ALREADY_FOUND,
@@ -286,7 +287,7 @@ function (ActionDebugLog $log): void {
286287
->getMock(),
287288
],
288289
function (ActionDebugLog $log): void {
289-
$this->assertSame([
290+
Assert::assertSame([
290291
[
291292
'pipe' => 'test',
292293
'reason' => ActionDebugLog::REASON_NO_RESULT,

0 commit comments

Comments
 (0)