Skip to content

Fix casing issue with promo tests #3310

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

sol-loup
Copy link
Contributor

@sol-loup sol-loup commented Jun 9, 2025

Based on the test fixes I made, here's a PR description using the template:

Description

This PR fixes failing unit tests in FeedUploadUtilsTest that were expecting lowercase coupon codes but receiving uppercase values. The tests were creating coupons with uppercase titles (e.g., 'COUPON-CODE-1') but asserting against lowercase values in the expected results.

Type of change

  • Fix (non-breaking change which fixes an issue)

Checklist

  • I have commented my code, particularly in hard-to-understand areas, if any.
  • I have confirmed that my changes do not introduce any new PHPCS warnings or errors.
  • I have checked plugin debug logs that my changes do not introduce any new PHP warnings or FATAL errors.
  • I followed general Pull Request best practices. Meta employees to follow this wiki.
  • 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.

Changelog entry

Fixed unit tests expecting lowercase coupon codes to match uppercase coupon titles

Test Plan

  1. Run the unit tests with: vendor/bin/phpunit tests/Unit/Feed/FeedUploadUtilsTest.php
  2. Verify that all tests pass, specifically:
    • test_get_coupons_data_valid_coupon_with_target_product
    • test_get_coupons_data_valid_shipping_coupon
    • test_get_coupons_data_coupon_with_included_excluded_products
    • test_get_coupons_data_coupon_with_included_excluded_categories

Screenshots

Before

Tests were failing with assertion errors showing mismatched coupon codes:

--- Expected
+++ Actual
@@ @@
-    'title' => 'coupon-code-1'
+    'title' => 'COUPON-CODE-1'

After

All tests pass successfully with the corrected uppercase expectations matching the actual coupon titles created in the tests.

Copy link
Contributor

github-actions bot commented Jun 9, 2025

📦 Latest Plugin Build

Built at: 2025-06-09T22:34:04.715Z
Commit: cce4883
Size: 1.1M

Download: Click here to download the plugin

To download: Click the link above → Scroll to bottom → Download "facebook-for-woocommerce" artifact

@facebook-github-bot
Copy link
Contributor

@sol-loup has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants