You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Summary:
## Description
This PR addresses noisy error logs originating from `WC_Facebookcommerce_Utils::fblog` during PHPUnit tests in `WCFacebookCommerceIntegrationTest`. These errors occurred because the `wc_facebook_external_merchant_settings_id` option (External Merchant Settings ID) was not set during test execution, leading to false positive error messages like "external merchant setting is null".
The fix involves initializing this option with a dummy value (`'dummy_ems_id'`) within the `setUp()` method of the `WCFacebookCommerceIntegrationTest` class. This ensures the setting is present before relevant tests run, preventing the erroneous `fblog` calls.
Additionally, this PR includes the following test cleanup:
- Deleted the test `test_allow_full_batch_api_sync_uses_allow_full_batch_api_sync_filter` as it was testing a deprecated option (`allow_full_batch_api_sync`) and was already marked as skipped.
- Removed `markTestSkipped` annotations from `test_get_js_sdk_version_returns_id_from_options_using_no_filter` and `test_get_js_sdk_version_returns_id_with_filter` as they now pass successfully.
### Type of change
- Bug fix (non-breaking change which fixes an issue)
- Syntax change (non-breaking change which fixes code modularity, linting or phpcs issues)
## Checklist
- [] I have commented my code, particularly in hard-to-understand areas.
- [] I have confirmed that my changes do not introduce any new PHPCS warnings or errors.
- [] I followed general Pull Request best practices. Meta employees to follow this [wiki](https://fburl.com/wiki/2cgfduwc).
- [] I have added tests (if necessary) and all the new and existing unit tests pass locally with my changes.
- [] I have completed dogfooding and QA testing, or I have conducted thorough due diligence to ensure that it does not break existing functionality.
- [] I have updated or requested update to plugin documentations (if necessary). Meta employees to follow this [wiki](https://fburl.com/wiki/nhx73tgs).
## Changelog entry
Fix - Prevent spurious error logs during unit tests by initializing external merchant settings ID.
Fix - Remove obsolete/skipped unit tests and enable previously skipped tests that now pass.
Pull Request resolved: #3058
Test Plan:
Imported from GitHub, without a `Test Plan:` line.
**!---- (auto-generated) DO NOT EDIT OR PUT ANYTHING AFTER THIS LINE ----!**
MFTRunTestsScript Run / Test Suite: sa_checkout / Test Collection: www / Diff Version V1
https://internalfb.com/intern/testinfra/testrun/6192449709976434
MFTRunTestsScript Run / Test Suite: sa_checkout / Test Collection: bloks / Diff Version V1
https://internalfb.com/intern/testinfra/testrun/14073748913725649
Reviewed By: carterbuce
Differential Revision: D72987618
Pulled By: sol-loup
fbshipit-source-id: 8e0762d8462ddbe95a31555c061d53e3fdd931f5
$this->markTestSkipped( 'get_js_sdk_version method is called in constructor which makes it impossible to test it in isolation w/o refactoring the constructor.' );
$this->markTestSkipped( 'get_js_sdk_version method is called in constructor which makes it impossible to test it in isolation w/o refactoring the constructor.' );
0 commit comments