Help us improve
Share bugs, ideas, or general feedback.
From woocommerce-commerce
Guides WooCommerce plugin testing with PHPUnit unit/integration tests via WP/Woo suites and helpers, Playwright E2E, and WP-CLI scaffolding for test environments.
npx claudepluginhub orcaqubits/agentic-commerce-skills-plugins --plugin woocommerce-commerceHow this skill is triggered — by the user, by Claude, or both
Slash command
/woocommerce-commerce:woo-testingThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
**Fetch live docs**:
Guides WooCommerce development workflow: run PHP/JS tests with pnpm, linting, code quality checks, and fixes. Useful for testing, style issues, and dev cycle in WooCommerce projects.
Writes PHPUnit tests for PHP projects: unit tests, assertions, mocks, stubs, data providers, exception testing, TDD workflows. Supports WooCommerce via WC_Unit_Test_Case.
Guides WooCommerce store setup, payment integration, shipping configuration, customization, and WordPress 7.0 features including AI connectors, DataViews, and collaboration tools.
Share bugs, ideas, or general feedback.
Fetch live docs:
site:developer.woocommerce.com testing for WooCommerce testing guidesite:developer.wordpress.org plugins testing for WordPress Plugin testing handbookwoocommerce e2e testing playwright for E2E patternsIsolated class/function testing:
Tests with WordPress + WooCommerce loaded:
WC_Unit_Test_Case (which extends WP_UnitTestCase)Browser-based tests with Playwright:
wp scaffold plugin-tests my-plugin creates:
tests/bootstrap.php — test bootstraptests/test-sample.php — sample testphpunit.xml.dist — PHPUnit configurationbin/install-wp-tests.sh — install WordPress test suiteAfter WordPress test bootstrap, load WooCommerce and your plugin:
// In tests/bootstrap.php
require_once dirname( __DIR__ ) . '/vendor/woocommerce/woocommerce/tests/legacy/bootstrap.php';
// Or manually: activate WooCommerce, then your plugin
Base class providing:
Factory for creating test products:
WC_Helper_Product::create_simple_product() — simple product with defaultsWC_Helper_Product::create_variation_product() — variable + variationsWC_Helper_Product::create_grouped_product() — grouped productWC_Helper_Product::create_external_product() — external/affiliateFactory for creating test orders:
WC_Helper_Order::create_order( $customer_id ) — order with line itemsWC_Helper_Customer::create_customer() — customer with addressWC_Helper_Customer::create_mock_customer() — mock customer objectWC_Helper_Shipping::create_simple_flat_rate() — flat rate shipping zoneWC_Helper_Coupon::create_coupon() — discount coupon with configurable type/amountVerify your hooks fire correctly:
has_action( 'hook_name', [ $instance, 'method' ] )did_action( 'hook_name' ) to verify an action firedUse WP_REST_Server to dispatch requests:
$request = new WP_REST_Request( 'GET', '/wc/v3/products' )$response = rest_get_server()->dispatch( $request )process_payment() with test credentials$this->createMock( ClassName::class )add_filter( 'pre_http_request', $mock_response )WC_Mock_Payment_Gateway and similar mocksWooCommerce uses @woocommerce/e2e-utils and Playwright:
playwright.config.jstests/e2e/specs/WC_Unit_Test_Case for integration testsWC_Helper_Product, etc.) for test fixtures@group annotations for test organizationFetch the WooCommerce testing documentation and WordPress testing handbook for exact helper methods, bootstrap setup, and E2E configuration before implementing.