"All new business logic should have corresponding unit tests."
Description
This PR introduces a new test file, ServiceProviderTest.php, within the tests/Unit directory. The purpose of this file is to cover the recent changes made to the ServiceProvider.php file, specifically the singleton registration of the 'FamilyTree365/laravel-gedcom:parser' service.
The new test file includes a test method, testGedcomParserSingletonRegistration, which resolves the GedcomParser from the Laravel service container twice and asserts that both instances are the same, confirming the singleton behavior.
In addition to the new test file, a minor modification was made to the GedcomImporterTest.php file to include a PHPDoc comment at the top of the file for consistency and clarity.
Summary of Changes
Created a new test file, ServiceProviderTest.php, in the tests/Unit directory.
Added a test method, testGedcomParserSingletonRegistration, to test the singleton registration of the GedcomParser.
Added a PHPDoc comment to the GedcomImporterTest.php file.
PR Feedback (click)
I created this PR to address this rule:
"All new business logic should have corresponding unit tests."
Description
This PR introduces a new test file, ServiceProviderTest.php, within the tests/Unit directory. The purpose of this file is to cover the recent changes made to the ServiceProvider.php file, specifically the singleton registration of the 'FamilyTree365/laravel-gedcom:parser' service.
The new test file includes a test method,
testGedcomParserSingletonRegistration
, which resolves the GedcomParser from the Laravel service container twice and asserts that both instances are the same, confirming the singleton behavior.In addition to the new test file, a minor modification was made to the GedcomImporterTest.php file to include a PHPDoc comment at the top of the file for consistency and clarity.
Summary of Changes
testGedcomParserSingletonRegistration
, to test the singleton registration of the GedcomParser.