You've already forked wc-composable-product
Add PHPUnit test suite, PSR-4 refactor, lint+test CI jobs (v1.3.1)
- 57 unit tests covering ProductType, StockManager, CartHandler, Plugin, Admin/ProductData, Admin/Settings using Brain Monkey + Mockery - WooCommerce class stubs for testing without WP installation - PHP lint and test jobs in release workflow (test gate blocks release) - PSR-4 namespace change: WC_Composable_Product -> Magdev\WcComposableProduct - PascalCase filenames for all classes under includes/ Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
28
tests/stubs/class-wc-order-item-product.php
Normal file
28
tests/stubs/class-wc-order-item-product.php
Normal file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
/**
|
||||
* Minimal WC_Order_Item_Product stub for unit testing.
|
||||
*/
|
||||
class WC_Order_Item_Product extends WC_Data {
|
||||
protected $product = null;
|
||||
protected $quantity = 1;
|
||||
|
||||
public function get_product() {
|
||||
return $this->product;
|
||||
}
|
||||
|
||||
public function set_product($product) {
|
||||
$this->product = $product;
|
||||
}
|
||||
|
||||
public function get_quantity() {
|
||||
return $this->quantity;
|
||||
}
|
||||
|
||||
public function set_quantity($quantity) {
|
||||
$this->quantity = $quantity;
|
||||
}
|
||||
|
||||
public function add_meta_data($key, $value, $unique = false) {
|
||||
$this->meta_data[$key] = $value;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user