You've already forked wc-bootstrap
Add PHPUnit test suite with Brain\Monkey (v0.1.6)
Add test infrastructure for isolated unit testing without WordPress/WooCommerce: - 27 tests (54 assertions) covering TemplateOverride and WooCommerceExtension - Brain\Monkey for WordPress function mocking, class stubs for TwigService and WC_Product - PHPUnit test job added to Gitea CI pipeline between lint and build-release - Test artifacts excluded from release packages Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
12
README.md
12
README.md
@@ -28,8 +28,9 @@ The bridge hooks into WooCommerce's `woocommerce_before_template_part` and `wooc
|
||||
|
||||
- **99 Twig template overrides** covering all customer-facing WooCommerce pages
|
||||
- **Rendering bridge** (`WooCommerceExtension` + `TemplateOverride`) that intercepts WooCommerce's PHP template pipeline
|
||||
- **~50 Twig functions** and **7 Twig filters** exposing WooCommerce and WordPress APIs to templates
|
||||
- **~50 Twig functions** and **8 Twig filters** exposing WooCommerce and WordPress APIs to templates
|
||||
- Bootstrap 5 responsive markup with dark mode support
|
||||
- **PHPUnit test suite** with Brain\Monkey for isolated unit testing (no WordPress/WooCommerce required)
|
||||
- HPOS compatible (uses `WC_Order` methods only, no `$post` global)
|
||||
- 8 reusable Twig components (card, pagination, price, rating, address-card, status-badge, quantity-input, form-field)
|
||||
- Translation-ready
|
||||
@@ -83,10 +84,15 @@ wc-bootstrap/
|
||||
│ ├── notices/
|
||||
│ ├── order/
|
||||
│ └── single-product/
|
||||
├── tests/
|
||||
│ ├── bootstrap.php # PHPUnit bootstrap (autoloader + stubs)
|
||||
│ ├── Stubs/ # WordPress/WooCommerce class stubs
|
||||
│ └── Unit/ # Unit tests (TemplateOverride, WooCommerceExtension)
|
||||
├── docker/
|
||||
│ ├── Dockerfile # Multistage build (WC download, npm, composer, WP)
|
||||
│ ├── entrypoint.sh # Auto-setup wrapper entrypoint
|
||||
│ └── setup.sh # First-run WP install + plugin/theme activation
|
||||
├── phpunit.xml.dist # PHPUnit 11 configuration
|
||||
├── .env-dist # Environment variable template
|
||||
├── compose.yaml # WordPress + MariaDB services
|
||||
├── compose.override.yaml # Dev overrides (bind mounts, debug flags)
|
||||
@@ -143,8 +149,8 @@ for po in languages/wc-bootstrap-*.po; do msgfmt -o "${po%.po}.mo" "$po"; done
|
||||
Releases are automated via Gitea Actions. Push a tag matching `vX.X.X` to trigger a release build.
|
||||
|
||||
```bash
|
||||
git tag -a v0.1.5 -m "Version 0.1.5 - Fix 10 known bugs"
|
||||
git push origin v0.1.5
|
||||
git tag -a v0.1.6 -m "Version 0.1.6 - Add PHPUnit test suite"
|
||||
git push origin v0.1.6
|
||||
```
|
||||
|
||||
## License
|
||||
|
||||
Reference in New Issue
Block a user