Closed curtisdelicata closed 6 months ago
a068746459
)[!TIP] I'll email you at genealogysoftwareuk@gmail.com when I complete this pull request!
Here are the GitHub Actions logs prior to making any changes:
4b5b725
Checking composer.json for syntax errors... ✅ composer.json has no syntax errors!
1/1 ✓Checking composer.json for syntax errors... ✅ composer.json has no syntax errors!
Sandbox passed on the latest main
, so sandbox checks will be enabled for this issue.
I found the following snippets in your repository. I will now analyze these snippets and come up with a plan.
tests/Pest.php
✓ https://github.com/liberu-genealogy/genealogy-laravel/commit/b505cec171504af075cfaf4f38d36f0623a2c839 Edit
Create tests/Pest.php with contents:
• Install Pest PHP testing framework by running `composer require pestphp/pest --dev` and `composer require pestphp/pest-plugin-laravel --dev`.
• After installation, run `php artisan pest:install` to set up Pest, which will create the `tests/Pest.php` file.
• This file is necessary for integrating Pest into the Laravel application, allowing us to write expressive tests for the Filament resources.
tests/Pest.php
✓ Edit
Check tests/Pest.php with contents:
Ran GitHub Actions for b505cec171504af075cfaf4f38d36f0623a2c839:
tests/Unit/Filament/Resources/PublicationResourceTest.php
✓ https://github.com/liberu-genealogy/genealogy-laravel/commit/19cb6ac9b1902038c1c3a81ef4ff634681265da5 Edit
Create tests/Unit/Filament/Resources/PublicationResourceTest.php with contents:
• Start by importing necessary classes at the top of the file: `use App\Models\Publication; use App\Filament\Resources\PublicationResource; use function Pest\Laravel\get;`.
• Write tests for `PublicationResource::form()` method to ensure the form schema is correctly defined. Test each form field for existence, type, and validation rules.
• Write tests for `PublicationResource::table()` method to ensure the table columns and actions are correctly defined.
• Ensure to create and use test models as necessary to test the interaction with the database.
tests/Unit/Filament/Resources/PublicationResourceTest.php
✓ Edit
Check tests/Unit/Filament/Resources/PublicationResourceTest.php with contents:
Ran GitHub Actions for 19cb6ac9b1902038c1c3a81ef4ff634681265da5:
tests/Unit/Filament/Resources/PersonResourceTest.php
✓ https://github.com/liberu-genealogy/genealogy-laravel/commit/0398d106dc6d8523baba5d4f68308bcafca5915b Edit
Create tests/Unit/Filament/Resources/PersonResourceTest.php with contents:
• Similar to `PublicationResourceTest`, import necessary classes and write tests for `PersonResource::form()` and `PersonResource::table()`.
• Focus on testing the form schema and table configuration, ensuring they match the expected definitions for handling `Person` entities.
tests/Unit/Filament/Resources/PersonResourceTest.php
✓ Edit
Check tests/Unit/Filament/Resources/PersonResourceTest.php with contents:
Ran GitHub Actions for 0398d106dc6d8523baba5d4f68308bcafca5915b:
composer.json
✓ https://github.com/liberu-genealogy/genealogy-laravel/commit/1dade298dc47886db8f95a52c24e7516f6e7aa8e Edit
Modify composer.json with contents:
• Add Pest to the require-dev section of `composer.json` to document the dependency on Pest for future developers.
• This modification ensures that Pest is installed as part of the development dependencies, facilitating the writing and running of tests.
--- +++ @@ -23,7 +23,8 @@ "mockery/mockery": "^1.6", "nunomaduro/collision": "^8.0", "phpunit/phpunit": "^11.0", - "spatie/laravel-ignition": "^2.4" + "spatie/laravel-ignition": "^2.4", + "pestphp/pest": "^1.0" }, "autoload": { "psr-4": {
composer.json
✓ Edit
Check composer.json with contents:
Ran GitHub Actions for 1dade298dc47886db8f95a52c24e7516f6e7aa8e:
phpunit.xml
✓ https://github.com/liberu-genealogy/genealogy-laravel/commit/6e364ce3cf54f991a32b7aed5079eda8f2749b52 Edit
Modify phpunit.xml with contents:
• Modify the PHPUnit configuration to include Pest's test suite by adding `./tests ` under the `` or ` ` sections.
• This ensures that PHPUnit recognizes Pest tests as part of the test suite, allowing developers to run all tests using PHPUnit or Pest commands.
--- +++ @@ -10,6 +10,7 @@./tests/Feature +./tests
phpunit.xml
✓ Edit
Check phpunit.xml with contents:
Ran GitHub Actions for 6e364ce3cf54f991a32b7aed5079eda8f2749b52:
tests/Unit/Filament/Resources/FamilyResourceTest.php
✓ https://github.com/liberu-genealogy/genealogy-laravel/commit/8b041cddf11a8b7bbd5c16939f10b3ff85a3977b Edit
Create tests/Unit/Filament/Resources/FamilyResourceTest.php with contents:
• Follow the same pattern as with `PublicationResourceTest` and `PersonResourceTest`, focusing on the `FamilyResource`.
• Test the form and table configurations, ensuring they accurately represent the operations on `Family` entities.
tests/Unit/Filament/Resources/FamilyResourceTest.php
✓ Edit
Check tests/Unit/Filament/Resources/FamilyResourceTest.php with contents:
Ran GitHub Actions for 8b041cddf11a8b7bbd5c16939f10b3ff85a3977b:
I have finished reviewing the code for completeness. I did not find errors for sweep/write_tests
.
💡 To recreate the pull request edit the issue title or description. To tweak the pull request, leave a comment on the pull request.Something wrong? Let us know.
This is an automated message generated by Sweep AI.
Details
Write unit tests for all files under app/Filament/Resources/
Use pest as per filament 3 documentation unless phpunit is preferred
Checklist
- [X] Create `tests/Pest.php` ✓ https://github.com/liberu-genealogy/genealogy-laravel/commit/b505cec171504af075cfaf4f38d36f0623a2c839 [Edit](https://github.com/liberu-genealogy/genealogy-laravel/edit/sweep/write_tests/tests/Pest.php) - [X] Running GitHub Actions for `tests/Pest.php` ✓ [Edit](https://github.com/liberu-genealogy/genealogy-laravel/edit/sweep/write_tests/tests/Pest.php) - [X] Create `tests/Unit/Filament/Resources/PublicationResourceTest.php` ✓ https://github.com/liberu-genealogy/genealogy-laravel/commit/19cb6ac9b1902038c1c3a81ef4ff634681265da5 [Edit](https://github.com/liberu-genealogy/genealogy-laravel/edit/sweep/write_tests/tests/Unit/Filament/Resources/PublicationResourceTest.php) - [X] Running GitHub Actions for `tests/Unit/Filament/Resources/PublicationResourceTest.php` ✓ [Edit](https://github.com/liberu-genealogy/genealogy-laravel/edit/sweep/write_tests/tests/Unit/Filament/Resources/PublicationResourceTest.php) - [X] Create `tests/Unit/Filament/Resources/PersonResourceTest.php` ✓ https://github.com/liberu-genealogy/genealogy-laravel/commit/0398d106dc6d8523baba5d4f68308bcafca5915b [Edit](https://github.com/liberu-genealogy/genealogy-laravel/edit/sweep/write_tests/tests/Unit/Filament/Resources/PersonResourceTest.php) - [X] Running GitHub Actions for `tests/Unit/Filament/Resources/PersonResourceTest.php` ✓ [Edit](https://github.com/liberu-genealogy/genealogy-laravel/edit/sweep/write_tests/tests/Unit/Filament/Resources/PersonResourceTest.php) - [X] Modify `composer.json` ✓ https://github.com/liberu-genealogy/genealogy-laravel/commit/1dade298dc47886db8f95a52c24e7516f6e7aa8e [Edit](https://github.com/liberu-genealogy/genealogy-laravel/edit/sweep/write_tests/composer.json#L1-L1) - [X] Running GitHub Actions for `composer.json` ✓ [Edit](https://github.com/liberu-genealogy/genealogy-laravel/edit/sweep/write_tests/composer.json#L1-L1) - [X] Modify `phpunit.xml` ✓ https://github.com/liberu-genealogy/genealogy-laravel/commit/6e364ce3cf54f991a32b7aed5079eda8f2749b52 [Edit](https://github.com/liberu-genealogy/genealogy-laravel/edit/sweep/write_tests/phpunit.xml#L3-L3) - [X] Running GitHub Actions for `phpunit.xml` ✓ [Edit](https://github.com/liberu-genealogy/genealogy-laravel/edit/sweep/write_tests/phpunit.xml#L3-L3) - [X] Create `tests/Unit/Filament/Resources/FamilyResourceTest.php` ✓ https://github.com/liberu-genealogy/genealogy-laravel/commit/8b041cddf11a8b7bbd5c16939f10b3ff85a3977b [Edit](https://github.com/liberu-genealogy/genealogy-laravel/edit/sweep/write_tests/tests/Unit/Filament/Resources/FamilyResourceTest.php) - [X] Running GitHub Actions for `tests/Unit/Filament/Resources/FamilyResourceTest.php` ✓ [Edit](https://github.com/liberu-genealogy/genealogy-laravel/edit/sweep/write_tests/tests/Unit/Filament/Resources/FamilyResourceTest.php)