"All new business logic should have corresponding unit tests."
Description
This PR introduces unit tests for the new business logic methods in src/Writer.php and corrects the method calls in existing tests within tests/WriterTest.php. The methods under test are convertHead, convertSubn, convertSubms, and convertSours. These methods are crucial for converting different parts of a GEDCOM file into a specified format.
Summary of Changes
Corrected the method calls from Writer::convertHeadHead to the appropriate method names in the existing tests.
Added comprehensive unit tests for each of the specified methods to ensure they handle all expected inputs and edge cases correctly. This includes:
Testing convertSubms with an empty array, a single item, and multiple items.
Testing convertSours with an empty array, a single source, and multiple sources, including cases with different formatting options if applicable.
These changes ensure the reliability and robustness of the business logic in src/Writer.php and maintain the quality of our codebase.
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 new business logic methods in
src/Writer.php
and corrects the method calls in existing tests withintests/WriterTest.php
. The methods under test areconvertHead
,convertSubn
,convertSubms
, andconvertSours
. These methods are crucial for converting different parts of a GEDCOM file into a specified format.Summary of Changes
Writer::convertHeadHead
to the appropriate method names in the existing tests.convertSubms
with an empty array, a single item, and multiple items.convertSours
with an empty array, a single source, and multiple sources, including cases with different formatting options if applicable.These changes ensure the reliability and robustness of the business logic in
src/Writer.php
and maintain the quality of our codebase.