woocommerce-paypal-payments/tests/stubs/WC_Discounts.php
2026-06-16 16:04:54 +02:00

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;
}
}
}