Skip to content

Make WooCommerceWebDriver DB-free: dissolve shared trait, drop WPDb guard - #64

Merged
edpittol merged 2 commits into
mainfrom
51-make-woocommercewebdriver-db-free-dissolve-shared-trait-drop-wpdb-guard
Jul 12, 2026
Merged

Make WooCommerceWebDriver DB-free: dissolve shared trait, drop WPDb guard#64
edpittol merged 2 commits into
mainfrom
51-make-woocommercewebdriver-db-free-dissolve-shared-trait-drop-wpdb-guard

Conversation

@edpittol

Copy link
Copy Markdown
Member

Summary

  • WooCommerceWebDriver::_initialize() now requires only WPWebDriver; the WPDb sibling check is dropped since the browser layer no longer reads from the database.
  • WooCommerceModuleSupport trait is dissolved: wpDb() moves directly onto WooCommerceDb; selector() and the page-slug config accessors (cartPageSlug(), checkoutPageSlug(), myAccountPageSlug()) move directly onto WooCommerceWebDriver, replacing the wooCommerceConfig() facade.
  • WooCommerceConfig and its Config/ namespace are deleted (dead once slugs are plain config accessors), along with its unit test.
  • CartMethods, CheckoutMethods, and CustomerBrowserMethods traits now declare only the specific slug accessor(s) they need instead of a catch-all wooCommerceConfig(); CheckoutMethods also drops its unused wpDb() abstract declaration.
  • WooCommerceDb HPOS detection (isHposEnabled(), orderStorage(), subscriptionStorage()) is unchanged.
  • SiblingModuleCheckTest updated to reflect that WooCommerceWebDriver only requires WPWebDriver.

Closes #51

Test plan

  • vendor/bin/codecept run unit — 29 tests, 51 assertions, all passing
  • vendor/bin/codecept run acceptance (Docker runner, pre-push hook) — 198 tests, 427 assertions, all passing (Order/Product/Coupon/Customer/Subscription/Checkout/Cart Cests unaffected)
  • phpstan analyse — no errors
  • phpcs — no violations
  • Verified zero wpDb() calls/declarations remain in WooCommerceWebDriver and its Method Traits

…uard

WooCommerceWebDriver._initialize() now requires only WPWebDriver; the
WPDb sibling check is gone since the browser layer no longer touches
the database. WooCommerceModuleSupport is dissolved since nothing
genuinely shared remained: wpDb() moves onto WooCommerceDb, and
selector() plus the page-slug config accessors move onto
WooCommerceWebDriver directly. WooCommerceConfig and its Config/
namespace are deleted now that slugs are plain config accessors.

Closes #51
@edpittol edpittol self-assigned this Jul 12, 2026
Native assert() silently no-ops when zend.assertions is disabled,
which defeats the point of a test assertion; PHPUnit's assertIsString
always runs and reports a proper failure.
@edpittol
edpittol merged commit 725536f into main Jul 12, 2026
3 checks passed
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.

Make WooCommerceWebDriver DB-free: dissolve shared trait, drop WPDb guard

1 participant