Fix phpunit

This commit is contained in:
Emili Castells Guasch 2024-12-09 16:14:29 +01:00
parent f48418c6e9
commit 40c648b83c

View file

@ -7,6 +7,7 @@ use Mockery;
use WC_Order;
use WC_Subscription;
use WooCommerce\PayPalCommerce\TestCase;
use WooCommerce\PayPalCommerce\WcGateway\Gateway\CreditCardGateway;
use function Brain\Monkey\Functions\when;
class SubscriptionHelperTest extends TestCase
@ -26,6 +27,7 @@ class SubscriptionHelperTest extends TestCase
$wc_order = Mockery::mock(WC_Order::class);
$wc_order->shouldReceive('get_status')->andReturn('processing');
$wc_order->shouldReceive('get_transaction_id')->andReturn('ABC123');
$wc_order->shouldReceive('get_payment_method')->andReturn(CreditCardGateway::ID);
when('wc_get_order')->justReturn($wc_order);