woocommerce-paypal-payments/tests/stubs/WC_Cart.php
Lae 81d2d5d8ad
Test: cover PUI no-cart guard in requires_phone
Adds a WC_Cart test stub (wired into the PHPUnit bootstrap) and a case
asserting requires_phone() does not call get_checkout_fields() when there
is no cart context, falling back to the default phone requirement instead.

Updates the existing get_payment_method_data() cases to provide a cart mock
so they continue to exercise the checkout-fields path.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-01 14:54:03 +02:00

8 lines
98 B
PHP

<?php
declare( strict_types=1 );
class WC_Cart {
public function get_cart() {
return [];
}
}