Make WooCommerceWebDriver DB-free: dissolve shared trait, drop WPDb guard - #64
Merged
edpittol merged 2 commits intoJul 12, 2026
Conversation
…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
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
WooCommerceWebDriver::_initialize()now requires onlyWPWebDriver; theWPDbsibling check is dropped since the browser layer no longer reads from the database.WooCommerceModuleSupporttrait is dissolved:wpDb()moves directly ontoWooCommerceDb;selector()and the page-slug config accessors (cartPageSlug(),checkoutPageSlug(),myAccountPageSlug()) move directly ontoWooCommerceWebDriver, replacing thewooCommerceConfig()facade.WooCommerceConfigand itsConfig/namespace are deleted (dead once slugs are plain config accessors), along with its unit test.CartMethods,CheckoutMethods, andCustomerBrowserMethodstraits now declare only the specific slug accessor(s) they need instead of a catch-allwooCommerceConfig();CheckoutMethodsalso drops its unusedwpDb()abstract declaration.WooCommerceDbHPOS detection (isHposEnabled(),orderStorage(),subscriptionStorage()) is unchanged.SiblingModuleCheckTestupdated to reflect thatWooCommerceWebDriveronly requiresWPWebDriver.Closes #51
Test plan
vendor/bin/codecept run unit— 29 tests, 51 assertions, all passingvendor/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 errorsphpcs— no violationswpDb()calls/declarations remain inWooCommerceWebDriverand its Method Traits