Merge pull request #1346 from woocommerce/pcp-157-blocks

Add express cart/checkout block
This commit is contained in:
Emili Castells 2023-05-16 11:14:53 +02:00 committed by GitHub
commit 918f09f47d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
55 changed files with 5150 additions and 202 deletions

View file

@ -647,7 +647,7 @@ class OrderEndpointTest extends TestCase
$intent = 'CAPTURE';
$logger = Mockery::mock(LoggerInterface::class);
$logger->shouldReceive('log');
$logger->shouldReceive('warning');
$logger->shouldReceive('debug');
$applicationContextRepository = Mockery::mock(ApplicationContextRepository::class);
$subscription_helper = Mockery::mock(SubscriptionHelper::class);
@ -742,7 +742,7 @@ class OrderEndpointTest extends TestCase
$intent = 'CAPTURE';
$logger = Mockery::mock(LoggerInterface::class);
$logger->shouldReceive('log');
$logger->shouldReceive('warning');
$logger->shouldReceive('debug');
$applicationContextRepository = Mockery::mock(ApplicationContextRepository::class);
@ -882,7 +882,7 @@ class OrderEndpointTest extends TestCase
$applicationContextRepository = Mockery::mock(ApplicationContextRepository::class);
$applicationContextRepository
->expects('current_context')
->with(Matchers::identicalTo(ApplicationContext::SHIPPING_PREFERENCE_NO_SHIPPING))
->with(ApplicationContext::SHIPPING_PREFERENCE_NO_SHIPPING, ApplicationContext::USER_ACTION_CONTINUE)
->andReturn($applicationContext);
$subscription_helper = Mockery::mock(SubscriptionHelper::class);
$subscription_helper->shouldReceive('cart_contains_subscription')->andReturn(true);
@ -985,7 +985,7 @@ class OrderEndpointTest extends TestCase
$applicationContextRepository = Mockery::mock(ApplicationContextRepository::class);
$applicationContextRepository
->expects('current_context')
->with(Matchers::identicalTo(ApplicationContext::SHIPPING_PREFERENCE_GET_FROM_FILE))
->with(ApplicationContext::SHIPPING_PREFERENCE_GET_FROM_FILE, ApplicationContext::USER_ACTION_CONTINUE)
->andReturn($applicationContext);
$subscription_helper = Mockery::mock(SubscriptionHelper::class);
$subscription_helper->shouldReceive('cart_contains_subscription')->andReturn(true);
@ -1065,7 +1065,7 @@ class OrderEndpointTest extends TestCase
$applicationContextRepository = Mockery::mock(ApplicationContextRepository::class);
$applicationContextRepository
->expects('current_context')
->with(Matchers::identicalTo(ApplicationContext::SHIPPING_PREFERENCE_NO_SHIPPING))
->with(ApplicationContext::SHIPPING_PREFERENCE_NO_SHIPPING, ApplicationContext::USER_ACTION_CONTINUE)
->andReturn($applicationContext);
$subscription_helper = Mockery::mock(SubscriptionHelper::class);
$subscription_helper->shouldReceive('cart_contains_subscription')->andReturn(true);
@ -1156,7 +1156,7 @@ class OrderEndpointTest extends TestCase
$applicationContextRepository = Mockery::mock(ApplicationContextRepository::class);
$applicationContextRepository
->expects('current_context')
->with(Matchers::identicalTo(ApplicationContext::SHIPPING_PREFERENCE_GET_FROM_FILE))
->with(ApplicationContext::SHIPPING_PREFERENCE_GET_FROM_FILE, ApplicationContext::USER_ACTION_CONTINUE)
->andReturn($applicationContext);
$subscription_helper = Mockery::mock(SubscriptionHelper::class);
$subscription_helper->shouldReceive('cart_contains_subscription')->andReturn(true);

View file

@ -294,7 +294,7 @@ class PurchaseUnitFactoryTest extends TestCase
$shippingFactory = Mockery::mock(ShippingFactory::class);
$shippingFactory
->expects('from_wc_customer')
->with($wcCustomer)
->with($wcCustomer, false)
->andReturn($shipping);
$paymentsFacory = Mockery::mock(PaymentsFactory::class);
$testee = new PurchaseUnitFactory(

View file

@ -167,6 +167,8 @@ class CreateOrderEndpointTest extends TestCase
false,
CardBillingMode::MINIMAL_INPUT,
false,
['checkout'],
false,
new NullLogger()
);
return array($payer_factory, $testee);