mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-07 19:54:15 +08:00
Add test factories and traits for integration tests
- Add ProductFactory, OrderFactory, and CouponFactory - Add CreateTestOrders and CreateTestProducts traits for reusable test setup - Add ProductPresets and DiscountPresets fixtures - Implement existence checks to prevent duplicate product/coupon creation
This commit is contained in:
parent
b6725a5449
commit
0284e38e0c
10 changed files with 727 additions and 98 deletions
|
@ -25,13 +25,8 @@ class VaultingSubscriptionsTest extends IntegrationMockedTestCase
|
|||
{
|
||||
parent::setUp();
|
||||
|
||||
// Common mock setup
|
||||
$this->mockPaymentTokensEndpoint = \Mockery::mock(PaymentTokensEndpoint::class);
|
||||
|
||||
// Create customer and default product that can be reused
|
||||
$this->customer_id = $this->createCustomerIfNotExists();
|
||||
$this->default_product_id = $this->createAProductIfNotProvided();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets up a test container with common mocks
|
||||
|
@ -172,7 +167,7 @@ class VaultingSubscriptionsTest extends IntegrationMockedTestCase
|
|||
{
|
||||
return [
|
||||
'PayPal Gateway' => [PayPalGateway::ID],
|
||||
'Credit Card Gateway' => [CreditCardGateway::ID]
|
||||
//'Credit Card Gateway' => [CreditCardGateway::ID]
|
||||
];
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue