diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 59d59f1..78a6c65 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -14,9 +14,12 @@ jobs: matrix: os: [ubuntu-latest, windows-latest] php: [8.3, 8.2, 8.1, 8.0] - laravel: [10.*, 9.*] + laravel: [11.*, 10.*, 9.*] stability: [prefer-lowest, prefer-stable] include: + - laravel: 11.* + testbench: 9.* + carbon: ^3.0 - laravel: 10.* testbench: 8.* carbon: ^2.63 @@ -24,6 +27,10 @@ jobs: testbench: 7.* carbon: ^2.63 exclude: + - laravel: 11.* + php: 8.1 + - laravel: 11.* + php: 8.0 - laravel: 10.* php: 8.0 diff --git a/.gitignore b/.gitignore index 9a43686..6127d06 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,7 @@ .idea .php_cs .php_cs.cache -.phpunit.result.cache +.phpunit.cache build composer.lock coverage diff --git a/LICENSE.md b/LICENSE.md index 43c44ab..3b09b56 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2023 MAIZE SRL +Copyright (c) 2024 MAIZE SRL Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/composer.json b/composer.json index 66fab0f..cb06613 100644 --- a/composer.json +++ b/composer.json @@ -18,23 +18,20 @@ ], "require": { "php": "^8.0", - "illuminate/console": "^9.0|^10.0", - "illuminate/database": "^9.0|^10.0", - "illuminate/events": "^9.0|^10.0", - "illuminate/support": "^9.0|^10.0", + "illuminate/console": "^9.0|^10.0|^11.0", + "illuminate/database": "^9.0|^10.0|^11.0", + "illuminate/events": "^9.0|^10.0|^11.0", + "illuminate/support": "^9.0|^10.0|^11.0", "spatie/laravel-package-tools": "^1.14.1" }, "require-dev": { - "friendsofphp/php-cs-fixer": "^3.8", - "nunomaduro/collision": "^6.0", - "nunomaduro/larastan": "^2.0.1", - "orchestra/testbench": "^7.0|^8.0", - "pestphp/pest": "^1.21", - "pestphp/pest-plugin-laravel": "^1.1", - "phpstan/extension-installer": "^1.1", - "phpstan/phpstan-deprecation-rules": "^1.0", - "phpstan/phpstan-phpunit": "^1.0", - "phpunit/phpunit": "^9.5" + "nunomaduro/collision": "^6.0|^7.8|^8.1", + "larastan/larastan": "^2.0.1", + "orchestra/testbench": "^7.0|^8.0|^9.0", + "pestphp/pest": "^1.21|^2.34", + "pestphp/pest-plugin-laravel": "^1.1|^2.3", + "phpstan/extension-installer": "^1.3", + "phpstan/phpstan-phpunit": "^1.3" }, "autoload": { "psr-4": { diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 290f954..10a8150 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,39 +1,23 @@ - - - - tests - - - - - ./src - - - - - - - - - - + + + + tests + + + + + + + + + + + + + + + ./src + + diff --git a/tests/Datasets/MassPrunableUser.php b/tests/Datasets/MassPrunableUser.php index febdf9e..39c970a 100644 --- a/tests/Datasets/MassPrunableUser.php +++ b/tests/Datasets/MassPrunableUser.php @@ -8,6 +8,16 @@ ]); }); +dataset('users_with_mass_prunable_fields', function () { + yield fn () => MassPrunableUser::factory()->create([ + 'created_at' => now()->subMonth(), + ]); + + yield fn () => MassPrunableUser::factory()->create([ + 'created_at' => now()->subMonth(), + ]); +}); + dataset('user_without_mass_prunable_fields', function () { yield fn () => MassPrunableUser::factory()->create(); }); diff --git a/tests/MassPrunableFieldsTest.php b/tests/MassPrunableFieldsTest.php index 0f99d86..ccb10f2 100644 --- a/tests/MassPrunableFieldsTest.php +++ b/tests/MassPrunableFieldsTest.php @@ -16,7 +16,7 @@ 'last_name' => null, 'email' => $model->email, ]); -})->with('user_with_mass_prunable_fields', 'user_with_mass_prunable_fields'); +})->with('users_with_mass_prunable_fields'); test('should not update non prunable models', function (MassPrunableUser $model) { pruneFields([