Skip to content

Add dontSeeOrderInDatabase (order parity with subscriptions) - #78

Open
fafera wants to merge 3 commits into
22-status-normalization-verify-see-status-document-assertion-helpersfrom
59-add-dontseeorderindatabase-order-parity-with-subscriptions
Open

fafera wants to merge 3 commits into
22-status-normalization-verify-see-status-document-assertion-helpersfrom
59-add-dontseeorderindatabase-order-parity-with-subscriptions

Conversation

@fafera

@fafera fafera commented Sep 18, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Adds dontSeeOrderInDatabase(array $criteria): void to OrderMethods, mirroring dontSeeSubscriptionInDatabase — resolves the order table name and maps criteria via orderStorage()->mapCriteria(), then delegates to the WPDB negative assertion.
  • Status normalization is inherited for free through mapCriteria()'s normalizeStatusInCriteria() chokepoint; no normalization logic was added here.
  • Covered under both Legacy and HPOS storage in OrderCest and OrderHPOSCest, including a case proving the unprefixed status is actually normalized (not just a non-match).

Closes #59.

Test plan

  • vendor/bin/codecept build run to regenerate the actor class
  • OrderCest and OrderHPOSCest pass under Legacy and HPOS storage respectively
  • Full acceptance suite (226 tests) and unit suite (29 tests) pass
  • PHPStan and PHPCS clean

Mirrors seeOrderInDatabase / dontSeeSubscriptionInDatabase: resolves the
table name and maps criteria via the order storage, then delegates to
the negative WPDB assertion. Status normalization is inherited for free
through mapCriteria().
…tests

Docblock example used an invalid order status. The normalization tests
only asserted a non-match, which passes with or without normalization;
add an expectThrowable assertion (mirroring the subscription test) that
actually fails if the unprefixed status stops being normalized.
SubscriptionHPOSCest had a dontSeeSubscriptionInDatabase normalization
test, but SubscriptionCest (Legacy) did not. OrderCest and
OrderHPOSCest now both have one; mirror it into SubscriptionCest so
both entities have symmetric coverage under both storages.
@fafera fafera self-assigned this Sep 18, 2026
@fafera
fafera requested a review from edpittol September 18, 2026 20:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant