Skip to content

test: expand WooCommerce event coverage#31

Draft
anyelopetit wants to merge 1 commit into
mainfrom
test/woocommerce-event-coverage
Draft

test: expand WooCommerce event coverage#31
anyelopetit wants to merge 1 commit into
mainfrom
test/woocommerce-event-coverage

Conversation

@anyelopetit

@anyelopetit anyelopetit commented Jun 11, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Adds focused Pest coverage for WooCommerce event hooks and outbound request shape.
  • Verifies product views, coupon redemption, cart add/remove/quantity changes, order placement, order status transitions, refunds, user registration, and deactivation cleanup.
  • Switches order session meta handling to WooCommerce order CRUD methods for HPOS-safe reads/writes:
    • order placement writes session meta through $order->update_meta_data(...) and $order->save()
    • order status/refund tracking reads session meta through $order->get_meta(...)

Scope

  • This PR improves WooCommerce event coverage and order session meta access patterns.
  • It does not refresh Composer dependencies.
  • It does not change CI or release packaging.
  • It does not declare HPOS compatibility.
  • HPOS compatibility declaration remains deferred until runtime smoke testing with HPOS enabled and disabled.

Validation

  • composer install
  • composer test
  • composer format:check
  • composer build

Verification

  • composer test: passed
    • 47 tests
    • 142 assertions
  • composer build: passed
  • composer install: run afterward to restore dev dependencies
  • composer format:check: passed after restoring dev dependencies

Notes

  • Tests use WordPress/WooCommerce mocks and intercept wp_remote_request/wp_remote_post.
  • No real Hellotext API calls are made.

@anyelopetit anyelopetit marked this pull request as draft June 12, 2026 16:33
@anyelopetit anyelopetit force-pushed the test/woocommerce-event-coverage branch from 37e9d0f to 2655a6b Compare June 12, 2026 17:54
Order session metadata now goes through WooCommerce CRUD methods
(update_meta_data/get_meta/save) instead of post meta functions, making
the access path HPOS-safe. Adds hook-level Pest coverage for
product.viewed, coupon.redeemed, order.placed, order status transitions
and refund.received, with wp_remote_post intercepted via test mocks.
@anyelopetit anyelopetit force-pushed the test/woocommerce-event-coverage branch from 2655a6b to 4ecaf53 Compare June 12, 2026 18:03
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