Closed sweep-ai[bot] closed 5 months ago
tests/ProductDuplicateTest.php
. ✓
Sandbox logs for
trunk fmt tests/ProductDuplicateTest.php || exit 0
1/2 ✓Found no applicable linters for the requested path
trunk check --fix --print-failures tests/ProductDuplicateTest.php
2/2 ✓Checked 1 file ✔ No issues
tests/ProductUpdatesTest.php
. ✓
Sandbox logs for
trunk fmt tests/ProductUpdatesTest.php || exit 0
1/2 ✓Found no applicable linters for the requested path
trunk check --fix --print-failures tests/ProductUpdatesTest.php
2/2 ✓Checked 1 file ✔ No issues
README.md
. ✗
Sandbox logs for
trunk fmt README.md || exit 0
1/2 ✓✔ Formatted README.md Re-checking autofixed files... Checked 1 file ✔ No issues
trunk check --fix --print-failures README.md
2/2 ❌ (`1`)ISSUES README.md:68:0 17:0 low Fenced code blocks should have a language specified markdownlint/MD040 42:0 low Fenced code blocks should have a language specified markdownlint/MD040 48:0 low Fenced code blocks should have a language specified markdownlint/MD040 54:0 low Fenced code blocks should have a language specified markdownlint/MD040 68:0 low Fenced code blocks should have a language specified markdownlint/MD040 Checked 1 file 4 existing issues ✖ 1 new issue
README.md
. ✓
Sandbox logs for https://github.com/kkarpieszuk/wc-price-history/commit/363d31849bfad0d84a08624415b4be0cde7e32ac
trunk fmt README.md || exit 0
1/2 ✓✔ Formatted README.md Re-checking autofixed files... Checked 1 file ✔ No issues
trunk check --fix --print-failures README.md
2/2 ✓ISSUES README.md:41:0 41:0 low Fenced code blocks should have a language specified markdownlint/MD040 47:0 low Fenced code blocks should have a language specified markdownlint/MD040 53:0 low Fenced code blocks should have a language specified markdownlint/MD040 Checked 1 file 3 existing issues
README.md
. ✓
Sandbox logs for
trunk fmt README.md || exit 0
1/2 ✓Checked 1 file ✔ No issues
trunk check --fix --print-failures README.md
2/2 ✓ISSUES README.md:41:0 41:0 low Fenced code blocks should have a language specified markdownlint/MD040 47:0 low Fenced code blocks should have a language specified markdownlint/MD040 53:0 low Fenced code blocks should have a language specified markdownlint/MD040 Checked 1 file 3 existing issues
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
ProductDuplicate
andProductUpdates
classes. The tests ensure that the methods in these classes are working as expected. The methods tested areflag_as_duplication_process()
,delete_history_from_duplicate()
,update_price_history()
, andstart_price_history()
.The following files were added:
tests/ProductDuplicateTest.php
: Contains tests for theProductDuplicate
class.tests/ProductUpdatesTest.php
: Contains tests for theProductUpdates
class.The
README.md
file was also updated to include a section about the unit tests.Summary of Changes
ProductDuplicateTest.php
andProductUpdatesTest.php
in thetests
directory.TestCase
class and includes tests for the methods in the corresponding class from theapp/PriorPrice
directory.README.md
to include a section about the unit tests, explaining their purpose and the specific methods they test.