mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-08-31 06:52:50 +08:00
Refactor shipping_preference
Extract its determination to a separate class, also remove useless CartRepository and use single PU to avoid confusion.
This commit is contained in:
parent
67cdf9be8e
commit
fff2570124
20 changed files with 245 additions and 264 deletions
|
@ -952,7 +952,7 @@ class OrderEndpointTest extends TestCase
|
|||
->expects('email_address')
|
||||
->andReturn('');
|
||||
|
||||
$result = $testee->create([$purchaseUnit], $payer);
|
||||
$result = $testee->create([$purchaseUnit], ApplicationContext::SHIPPING_PREFERENCE_NO_SHIPPING, $payer);
|
||||
$this->assertEquals($expectedOrder, $result);
|
||||
}
|
||||
|
||||
|
@ -1049,7 +1049,7 @@ class OrderEndpointTest extends TestCase
|
|||
$payerName = Mockery::mock(PayerName::class);
|
||||
$payer->expects('name')->andReturn($payerName);
|
||||
$payer->expects('to_array')->andReturn(['payer']);
|
||||
$result = $testee->create([$purchaseUnit], $payer);
|
||||
$result = $testee->create([$purchaseUnit], ApplicationContext::SHIPPING_PREFERENCE_GET_FROM_FILE, $payer);
|
||||
$this->assertEquals($expectedOrder, $result);
|
||||
}
|
||||
|
||||
|
@ -1141,7 +1141,7 @@ class OrderEndpointTest extends TestCase
|
|||
$payerName = Mockery::mock(PayerName::class);
|
||||
$payer->expects('name')->andReturn($payerName);
|
||||
$payer->expects('to_array')->andReturn(['payer']);
|
||||
$testee->create([$purchaseUnit], $payer);
|
||||
$testee->create([$purchaseUnit], ApplicationContext::SHIPPING_PREFERENCE_NO_SHIPPING, $payer);
|
||||
}
|
||||
|
||||
public function testCreateForPurchaseUnitsIsNot201()
|
||||
|
@ -1232,6 +1232,6 @@ class OrderEndpointTest extends TestCase
|
|||
$payerName = Mockery::mock(PayerName::class);
|
||||
$payer->expects('name')->andReturn($payerName);
|
||||
$payer->expects('to_array')->andReturn(['payer']);
|
||||
$testee->create([$purchaseUnit], $payer);
|
||||
$testee->create([$purchaseUnit], ApplicationContext::SHIPPING_PREFERENCE_GET_FROM_FILE, $payer);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue