diff --git a/.phpunit.cache/test-results b/.phpunit.cache/test-results new file mode 100644 index 0000000..271f299 --- /dev/null +++ b/.phpunit.cache/test-results @@ -0,0 +1 @@ +{"version":"pest_2.35.1","defects":{"P\\Tests\\MassPrunableFieldsTest::__pest_evaluable_should_update_mass_prunable_models#(Closure) \/ (Closure)":8,"P\\Tests\\MassPrunableFieldsTest::__pest_evaluable_should_update_mass_prunable_models#('user_with_mass_prunable_fields') #2":8,"P\\Tests\\MassPrunableFieldsTest::__pest_evaluable_should_update_mass_prunable_models#('user_with_mass_prunable_fields') #1":8,"P\\Tests\\MassPrunableFieldsTest::__pest_evaluable_should_update_mass_prunable_models#('user_with_mass_prunable_fields')":8,"P\\Tests\\MassPrunableFieldsTest::__pest_evaluable_should_update_mass_prunable_models#('user_without_mass_prunable_fields')":8},"times":{"P\\Tests\\PrunableFieldsTest::__pest_evaluable_should_fire_model_updated_events#(Closure)":0.01,"P\\Tests\\PrunableFieldsTest::__pest_evaluable_should_not_update_non_prunable_models#(Closure)":0.002,"P\\Tests\\PrunableFieldsTest::__pest_evaluable_should_update_prunable_models#(Closure)":0.005,"P\\Tests\\PrunableFieldsTest::__pest_evaluable_should_fire_ModelsFieldsPruned_event_with_prunable_model#(Closure)":0.01,"P\\Tests\\PrunableFieldsTest::__pest_evaluable_should_allow_the_prunable_models_to_be_overridden_at_runtime#(Closure)":0.025,"P\\Tests\\PrunableFieldsTest::__pest_evaluable_should_call_the_pruningFields_method#(Closure)":0.01,"P\\Tests\\PruneFieldsCommandTest::__pest_evaluable_should_print_the_amount_of_pruned_records#(Closure)":0.012,"P\\Tests\\PruneFieldsCommandTest::__pest_evaluable_should_print_no_records_have_been_pruned#(Closure)":0.001,"P\\Tests\\PruneFieldsCommandTest::__pest_evaluable_should_print_the_amount_of_prunable_records#(Closure)":0.003,"P\\Tests\\PruneFieldsCommandTest::__pest_evaluable_should_print_no_models_found_with_empty_list":0.001,"P\\Tests\\MassPrunableFieldsTest::__pest_evaluable_should_update_mass_prunable_models#(Closure) \/ (Closure)":0.009,"P\\Tests\\MassPrunableFieldsTest::__pest_evaluable_should_fire_ModelsFieldsPruned_event_with_mass_prunable_model#(Closure)":0.021,"P\\Tests\\MassPrunableFieldsTest::__pest_evaluable_should_not_fire_model_updated_events#(Closure)":0.002,"P\\Tests\\MassPrunableFieldsTest::__pest_evaluable_should_not_update_non_prunable_models#(Closure)":0.16,"P\\Tests\\MassPrunableFieldsTest::__pest_evaluable_should_update_mass_prunable_models#(Closure)":0.002,"P\\Tests\\MassPrunableFieldsTest::__pest_evaluable_should_update_mass_prunable_models#('user_with_mass_prunable_fields') #2":0.005,"P\\Tests\\MassPrunableFieldsTest::__pest_evaluable_should_update_mass_prunable_models#('user_with_mass_prunable_fields') #1":0.001,"P\\Tests\\MassPrunableFieldsTest::__pest_evaluable_should_update_mass_prunable_models#('user_with_mass_prunable_fields')":0.006,"P\\Tests\\MassPrunableFieldsTest::__pest_evaluable_should_update_mass_prunable_models#('user_without_mass_prunable_fields')":0,"P\\Tests\\MassPrunableFieldsTest::__pest_evaluable_should_update_mass_prunable_models#(Closure) #2":0.002,"P\\Tests\\MassPrunableFieldsTest::__pest_evaluable_should_update_mass_prunable_models#(Closure) #1":0.001}} \ No newline at end of file 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([