Skip to content

Status normalization: criteria methods (see*InDatabase, dontSee*InDatabase, grab*IdFromDatabase) - #75

Open
fafera wants to merge 1 commit into
20-status-normalization-have-in-databasefrom
21-status-normalization-criteria-methods
Open

fafera wants to merge 1 commit into
20-status-normalization-have-in-databasefrom
21-status-normalization-criteria-methods

Conversation

@fafera

@fafera fafera commented Sep 18, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Extends WC status normalization to the read/assert side: see*InDatabase, dontSee*InDatabase, and grab*IdFromDatabase now normalize the status/post_status criterion, so an unprefixed value like active matches rows stored as wc-active.
  • Adds normalizeStatusInCriteria() to AbstractStorage, driven by each storage's getStatusColumnName(), and calls it from the mapCriteria() chokepoint in both HPOS and Legacy storages.
  • HPOSOrderStorage and HPOSSubscriptionStorage now delegate to parent::mapCriteria() instead of reimplementing the mapping loop, closing the gap where a future override could silently skip normalization.

Closes #21.

Test plan

  • composer check (PHPStan + PHPCS)
  • OrderHPOSCest, SubscriptionHPOSCest (HPOS mode)
  • OrderCest, SubscriptionCest (Legacy mode)
  • Full acceptance suite — only pre-existing, unrelated WebDriver flakiness in CartCest/CheckoutCest

Normalize the status value inside criteria arrays passed to
see*InDatabase, dontSee*InDatabase, and grab*IdFromDatabase, so an
unprefixed status (e.g. 'active') matches rows stored with the wc-
prefix. Adds a shared normalizeStatusInCriteria() step to the storage
mapCriteria() chokepoint, with HPOS/Legacy storages each declaring
their own status column name.
@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