mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-04 08:47:23 +08:00
Do not fail if no WC_Product in order item
It is possible for an order item to not have product, such as if created by a plugin.
This commit is contained in:
parent
77230fefa8
commit
4f91e78591
2 changed files with 13 additions and 18 deletions
|
@ -130,9 +130,6 @@ class ItemFactoryTest extends TestCase
|
|||
$testee = new ItemFactory($this->currency);
|
||||
|
||||
$product = Mockery::mock(\WC_Product::class);
|
||||
$product
|
||||
->expects('get_name')
|
||||
->andReturn('name');
|
||||
$product
|
||||
->expects('get_description')
|
||||
->andReturn('description');
|
||||
|
@ -150,6 +147,9 @@ class ItemFactoryTest extends TestCase
|
|||
$item
|
||||
->expects('get_product')
|
||||
->andReturn($product);
|
||||
$item
|
||||
->expects('get_name')
|
||||
->andReturn('name');
|
||||
$item
|
||||
->expects('get_quantity')
|
||||
->andReturn(1);
|
||||
|
@ -193,9 +193,6 @@ class ItemFactoryTest extends TestCase
|
|||
$testee = new ItemFactory($this->currency);
|
||||
|
||||
$product = Mockery::mock(\WC_Product::class);
|
||||
$product
|
||||
->expects('get_name')
|
||||
->andReturn('name');
|
||||
$product
|
||||
->expects('get_description')
|
||||
->andReturn('description');
|
||||
|
@ -213,6 +210,9 @@ class ItemFactoryTest extends TestCase
|
|||
$item
|
||||
->expects('get_product')
|
||||
->andReturn($product);
|
||||
$item
|
||||
->expects('get_name')
|
||||
->andReturn('name');
|
||||
$item
|
||||
->expects('get_quantity')
|
||||
->andReturn(1);
|
||||
|
@ -251,9 +251,6 @@ class ItemFactoryTest extends TestCase
|
|||
$testee = new ItemFactory($this->currency);
|
||||
|
||||
$product = Mockery::mock(\WC_Product::class);
|
||||
$product
|
||||
->expects('get_name')
|
||||
->andReturn($name);
|
||||
$product
|
||||
->expects('get_description')
|
||||
->andReturn($description);
|
||||
|
@ -271,6 +268,9 @@ class ItemFactoryTest extends TestCase
|
|||
$item
|
||||
->expects('get_product')
|
||||
->andReturn($product);
|
||||
$item
|
||||
->expects('get_name')
|
||||
->andReturn($name);
|
||||
$item
|
||||
->expects('get_quantity')
|
||||
->andReturn(1);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue