"All new business logic should have corresponding unit tests."
Description
This PR introduces unit tests for the GedcomExporter and GedcomImporter classes. These tests ensure that the new business logic in these classes works as expected under different scenarios. The tests cover functionalities such as exporting and importing data, handling of non-existent directories, and verifying the correct data format in the output file.
Summary of Changes
Created a new test file tests/Unit/GedcomExporterTest.php for the GedcomExporter class. This file contains tests that cover the export functionality, including directory creation, data fetching, and file writing.
Created a new test file tests/Unit/GedcomImporterTest.php for the GedcomImporter class. This file contains tests that cover the import functionality, including file parsing and data importing.
Utilized Laravel's built-in testing functionalities to mock file system operations and database queries, ensuring that the tests are focused on the logic within the GedcomExporter and GedcomImporter classes.
These tests will help maintain the code quality and ensure that the functionalities work as expected.
PR Feedback (click)
I created this PR to address this rule:
"All new business logic should have corresponding unit tests."
Description
This PR introduces unit tests for the
GedcomExporter
andGedcomImporter
classes. These tests ensure that the new business logic in these classes works as expected under different scenarios. The tests cover functionalities such as exporting and importing data, handling of non-existent directories, and verifying the correct data format in the output file.Summary of Changes
tests/Unit/GedcomExporterTest.php
for theGedcomExporter
class. This file contains tests that cover the export functionality, including directory creation, data fetching, and file writing.tests/Unit/GedcomImporterTest.php
for theGedcomImporter
class. This file contains tests that cover the import functionality, including file parsing and data importing.GedcomExporter
andGedcomImporter
classes.These tests will help maintain the code quality and ensure that the functionalities work as expected.