mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2026-07-29 02:07:27 +08:00
19 lines
453 B
PHP
19 lines
453 B
PHP
<?php
|
|
/**
|
|
* Minimal WC_Discounts stub for unit tests.
|
|
*
|
|
* Ensures that CouponValidator::is_wc_available() returns true, allowing unit
|
|
* tests to reach the coupon-disabled gate and beyond without requiring a real
|
|
* WooCommerce installation.
|
|
*/
|
|
|
|
if ( ! class_exists( 'WC_Discounts' ) ) {
|
|
class WC_Discounts {
|
|
public function set_items( $items = array() ): void {
|
|
}
|
|
|
|
public function is_coupon_valid( $coupon ): bool {
|
|
return true;
|
|
}
|
|
}
|
|
}
|