Skip to content

Commit 4f99e1c

Browse files
ADD Laravel 12 support (#15)
1 parent 4562293 commit 4f99e1c

File tree

5 files changed

+31
-73
lines changed

5 files changed

+31
-73
lines changed

.github/workflows/run-tests.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,16 @@ jobs:
1313
fail-fast: true
1414
matrix:
1515
os: [ubuntu-latest, windows-latest]
16-
php: [8.3, 8.2]
17-
laravel: [11.*, 10.*]
16+
php: [8.4, 8.3, 8.2]
17+
laravel: [12.*, 11.*, 10.*]
1818
stability: [prefer-lowest, prefer-stable]
1919
include:
20-
- laravel: 10.*
21-
testbench: 8.*
20+
- laravel: 12.*
21+
testbench: 10.*
2222
- laravel: 11.*
2323
testbench: 9.*
24+
- laravel: 10.*
25+
testbench: 8.*
2426

2527
name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }}
2628

composer.json

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,21 +18,17 @@
1818
"require": {
1919
"php": "^8.2",
2020
"spatie/laravel-package-tools": "^1.14.1",
21-
"illuminate/console": "^10.0|^11.0",
22-
"illuminate/database": "^10.0|^11.0",
23-
"illuminate/support": "^10.0|^11.0"
21+
"illuminate/console": "^10.0|^11.0|^12.0",
22+
"illuminate/database": "^10.0|^11.0|^12.0",
23+
"illuminate/support": "^10.0|^11.0|^12.0"
2424
},
2525
"require-dev": {
2626
"laravel/pint": "^1.0",
2727
"nunomaduro/collision": "^7.8|^8.1",
28-
"nunomaduro/larastan": "^2.0.1",
29-
"orchestra/testbench": "^8.0|^9.0",
30-
"pestphp/pest": "^2.20",
31-
"pestphp/pest-plugin-arch": "^2.0",
32-
"pestphp/pest-plugin-laravel": "^2.0",
33-
"phpstan/extension-installer": "^1.1",
34-
"phpstan/phpstan-deprecation-rules": "^1.0",
35-
"phpstan/phpstan-phpunit": "^1.0"
28+
"larastan/larastan": "^2.0.1||^3.3",
29+
"orchestra/testbench": "^8.0|^9.0|^10.0",
30+
"pestphp/pest": "^2.20|^3.7",
31+
"pestphp/pest-plugin-laravel": "^2.0|^3.2"
3632
},
3733
"autoload": {
3834
"psr-4": {

phpstan.neon.dist

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,3 @@ parameters:
88
- config
99
- database
1010
tmpDir: build/phpstan
11-
checkOctaneCompatibility: true
12-
checkModelProperties: true
13-
checkMissingIterableValueType: false
14-

phpunit.xml.dist.bak

Lines changed: 0 additions & 36 deletions
This file was deleted.

tests/BadgeTest.php

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@
2222
->and(FalseBadge::giveTo($model))
2323
->toBeNull();
2424
})->with([
25-
['model' => fn () => User::factory()->create()],
26-
['model' => fn () => Team::factory()->create()],
25+
[fn () => User::factory()->create()],
26+
[fn () => Team::factory()->create()],
2727
]);
2828

2929
it('should give progressable badges', function (HasBadges $model) {
@@ -36,8 +36,8 @@
3636
->and(FalseProgressableBadge::giveTo($model))
3737
->toBeNull();
3838
})->with([
39-
['model' => fn () => User::factory()->create()],
40-
['model' => fn () => Team::factory()->create()],
39+
[fn () => User::factory()->create()],
40+
[fn () => Team::factory()->create()],
4141
]);
4242

4343
it('should check if model has badge', function (HasBadges $model) {
@@ -47,8 +47,8 @@
4747
$model->hasBadge(TrueBadge::class)
4848
)->toBeTrue();
4949
})->with([
50-
['model' => fn () => User::factory()->create()],
51-
['model' => fn () => Team::factory()->create()],
50+
[fn () => User::factory()->create()],
51+
[fn () => Team::factory()->create()],
5252
]);
5353

5454
it('should retrieve badge metadata', function (HasBadges $model) {
@@ -63,8 +63,8 @@
6363
->and(TrueBadge::getMetadata('name'))
6464
->toBe('True Badge');
6565
})->with([
66-
['model' => fn () => User::factory()->create()],
67-
['model' => fn () => Team::factory()->create()],
66+
[fn () => User::factory()->create()],
67+
[fn () => Team::factory()->create()],
6868
]);
6969

7070
it('should retrieve all awarded badges', function (HasBadges $model) {
@@ -75,17 +75,17 @@
7575
->toHaveCount(2)
7676
->toContainOnlyInstancesOf(BadgeModel::class);
7777
})->with([
78-
['model' => fn () => User::factory()->create()],
79-
['model' => fn () => Team::factory()->create()],
78+
[fn () => User::factory()->create()],
79+
[fn () => Team::factory()->create()],
8080
]);
8181

8282
it('should sync badges', function (HasBadges $model) {
8383
expect($model->syncBadges())
8484
->toHaveCount(2)
8585
->toContainOnlyInstancesOf(BadgeModel::class);
8686
})->with([
87-
['model' => fn () => User::factory()->create()],
88-
['model' => fn () => Team::factory()->create()],
87+
[fn () => User::factory()->create()],
88+
[fn () => Team::factory()->create()],
8989
]);
9090

9191
it('should delete badges on model delete', function (HasBadges $model) {
@@ -94,8 +94,8 @@
9494

9595
expect(BadgeModel::count())->toBe(0);
9696
})->with([
97-
['model' => fn () => User::factory()->create()],
98-
['model' => fn () => Team::factory()->create()],
97+
[fn () => User::factory()->create()],
98+
[fn () => Team::factory()->create()],
9999
]);
100100

101101
it('should fire event on badge awarded', function (HasBadges $model) {
@@ -111,8 +111,8 @@
111111
}
112112
);
113113
})->with([
114-
['model' => fn () => User::factory()->create()],
115-
['model' => fn () => Team::factory()->create()],
114+
[fn () => User::factory()->create()],
115+
[fn () => Team::factory()->create()],
116116
]);
117117

118118
it('should clear old badges', function (HasBadges $model) {
@@ -124,6 +124,6 @@
124124

125125
expect($model->badges)->toBeEmpty();
126126
})->with([
127-
['model' => fn () => User::factory()->create()],
128-
['model' => fn () => Team::factory()->create()],
127+
[fn () => User::factory()->create()],
128+
[fn () => Team::factory()->create()],
129129
]);

0 commit comments

Comments
 (0)