You've already forked wc-bootstrap
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>
22 lines
308 B
PHP
22 lines
308 B
PHP
<?php
|
|
/**
|
|
* Stub for WC_Product.
|
|
*
|
|
* Minimal implementation for type-hint satisfaction in unit tests.
|
|
*/
|
|
|
|
class WC_Product
|
|
{
|
|
private int $id;
|
|
|
|
public function __construct(int $id = 0)
|
|
{
|
|
$this->id = $id;
|
|
}
|
|
|
|
public function get_id(): int
|
|
{
|
|
return $this->id;
|
|
}
|
|
}
|