Skip to content

Commit 5475052

Browse files
ADD laravel 11 compatibility (#22)
1 parent 1f35a5e commit 5475052

File tree

7 files changed

+53
-55
lines changed

7 files changed

+53
-55
lines changed

.github/workflows/run-tests.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,23 @@ jobs:
1414
matrix:
1515
os: [ubuntu-latest, windows-latest]
1616
php: [8.3, 8.2, 8.1, 8.0]
17-
laravel: [10.*, 9.*]
17+
laravel: [11.*, 10.*, 9.*]
1818
stability: [prefer-lowest, prefer-stable]
1919
include:
20+
- laravel: 11.*
21+
testbench: 9.*
22+
carbon: ^3.0
2023
- laravel: 10.*
2124
testbench: 8.*
2225
carbon: ^2.63
2326
- laravel: 9.*
2427
testbench: 7.*
2528
carbon: ^2.63
2629
exclude:
30+
- laravel: 11.*
31+
php: 8.1
32+
- laravel: 11.*
33+
php: 8.0
2734
- laravel: 10.*
2835
php: 8.0
2936

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
.idea
22
.php_cs
33
.php_cs.cache
4-
.phpunit.result.cache
4+
.phpunit.cache
55
build
66
composer.lock
77
coverage

LICENSE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright (c) 2023 MAIZE SRL <[email protected]>
3+
Copyright (c) 2024 MAIZE SRL <[email protected]>
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

composer.json

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -18,23 +18,20 @@
1818
],
1919
"require": {
2020
"php": "^8.0",
21-
"illuminate/console": "^9.0|^10.0",
22-
"illuminate/database": "^9.0|^10.0",
23-
"illuminate/events": "^9.0|^10.0",
24-
"illuminate/support": "^9.0|^10.0",
21+
"illuminate/console": "^9.0|^10.0|^11.0",
22+
"illuminate/database": "^9.0|^10.0|^11.0",
23+
"illuminate/events": "^9.0|^10.0|^11.0",
24+
"illuminate/support": "^9.0|^10.0|^11.0",
2525
"spatie/laravel-package-tools": "^1.14.1"
2626
},
2727
"require-dev": {
28-
"friendsofphp/php-cs-fixer": "^3.8",
29-
"nunomaduro/collision": "^6.0",
30-
"nunomaduro/larastan": "^2.0.1",
31-
"orchestra/testbench": "^7.0|^8.0",
32-
"pestphp/pest": "^1.21",
33-
"pestphp/pest-plugin-laravel": "^1.1",
34-
"phpstan/extension-installer": "^1.1",
35-
"phpstan/phpstan-deprecation-rules": "^1.0",
36-
"phpstan/phpstan-phpunit": "^1.0",
37-
"phpunit/phpunit": "^9.5"
28+
"nunomaduro/collision": "^6.0|^7.8|^8.1",
29+
"larastan/larastan": "^2.0.1",
30+
"orchestra/testbench": "^7.0|^8.0|^9.0",
31+
"pestphp/pest": "^1.21|^2.34",
32+
"pestphp/pest-plugin-laravel": "^1.1|^2.3",
33+
"phpstan/extension-installer": "^1.3",
34+
"phpstan/phpstan-phpunit": "^1.3"
3835
},
3936
"autoload": {
4037
"psr-4": {

phpunit.xml.dist

Lines changed: 21 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,23 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<phpunit
3-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4-
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
5-
backupGlobals="false"
6-
backupStaticAttributes="false"
7-
bootstrap="vendor/autoload.php"
8-
colors="true"
9-
convertErrorsToExceptions="true"
10-
convertNoticesToExceptions="true"
11-
convertWarningsToExceptions="true"
12-
processIsolation="false"
13-
stopOnFailure="false"
14-
executionOrder="random"
15-
failOnWarning="true"
16-
failOnRisky="true"
17-
failOnEmptyTestSuite="true"
18-
beStrictAboutOutputDuringTests="true"
19-
verbose="true"
20-
>
21-
<testsuites>
22-
<testsuite name="Maize Test Suite">
23-
<directory>tests</directory>
24-
</testsuite>
25-
</testsuites>
26-
<coverage>
27-
<include>
28-
<directory suffix=".php">./src</directory>
29-
</include>
30-
<report>
31-
<html outputDirectory="build/coverage"/>
32-
<text outputFile="build/coverage.txt"/>
33-
<clover outputFile="build/logs/clover.xml"/>
34-
</report>
35-
</coverage>
36-
<logging>
37-
<junit outputFile="build/report.junit.xml"/>
38-
</logging>
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd" backupGlobals="false" bootstrap="vendor/autoload.php" colors="true" processIsolation="false" stopOnFailure="false" executionOrder="random" failOnWarning="true" failOnRisky="true" failOnEmptyTestSuite="true" beStrictAboutOutputDuringTests="true" cacheDirectory=".phpunit.cache" backupStaticProperties="false">
3+
<testsuites>
4+
<testsuite name="Maize Test Suite">
5+
<directory>tests</directory>
6+
</testsuite>
7+
</testsuites>
8+
<coverage>
9+
<report>
10+
<html outputDirectory="build/coverage"/>
11+
<text outputFile="build/coverage.txt"/>
12+
<clover outputFile="build/logs/clover.xml"/>
13+
</report>
14+
</coverage>
15+
<logging>
16+
<junit outputFile="build/report.junit.xml"/>
17+
</logging>
18+
<source>
19+
<include>
20+
<directory suffix=".php">./src</directory>
21+
</include>
22+
</source>
3923
</phpunit>

tests/Datasets/MassPrunableUser.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,16 @@
88
]);
99
});
1010

11+
dataset('users_with_mass_prunable_fields', function () {
12+
yield fn () => MassPrunableUser::factory()->create([
13+
'created_at' => now()->subMonth(),
14+
]);
15+
16+
yield fn () => MassPrunableUser::factory()->create([
17+
'created_at' => now()->subMonth(),
18+
]);
19+
});
20+
1121
dataset('user_without_mass_prunable_fields', function () {
1222
yield fn () => MassPrunableUser::factory()->create();
1323
});

tests/MassPrunableFieldsTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
'last_name' => null,
1717
'email' => $model->email,
1818
]);
19-
})->with('user_with_mass_prunable_fields', 'user_with_mass_prunable_fields');
19+
})->with('users_with_mass_prunable_fields');
2020

2121
test('should not update non prunable models', function (MassPrunableUser $model) {
2222
pruneFields([

0 commit comments

Comments
 (0)