mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-05 08:59:14 +08:00
Merge branch 'trunk' into PCP-881-compatibility-with-third-party-product-add-ons-plugins
This commit is contained in:
commit
6d137effef
45 changed files with 3429 additions and 1221 deletions
|
@ -66,7 +66,9 @@ class ItemTest extends TestCase
|
|||
'description',
|
||||
$tax,
|
||||
'sku',
|
||||
'PHYSICAL_GOODS'
|
||||
'PHYSICAL_GOODS',
|
||||
'url',
|
||||
'image_url'
|
||||
);
|
||||
|
||||
$expected = [
|
||||
|
@ -76,6 +78,8 @@ class ItemTest extends TestCase
|
|||
'description' => 'description',
|
||||
'sku' => 'sku',
|
||||
'category' => 'PHYSICAL_GOODS',
|
||||
'url' => 'url',
|
||||
'image_url' => 'image_url',
|
||||
'tax' => [2],
|
||||
];
|
||||
|
||||
|
|
|
@ -52,6 +52,14 @@ class ItemFactoryTest extends TestCase
|
|||
$woocommerce->session = $session;
|
||||
$session->shouldReceive('get')->andReturn([]);
|
||||
|
||||
when('wp_get_attachment_image_src')->justReturn('image_url');
|
||||
$product
|
||||
->expects('get_image_id')
|
||||
->andReturn(1);
|
||||
$product
|
||||
->expects('get_permalink')
|
||||
->andReturn('url');
|
||||
|
||||
$result = $testee->from_wc_cart($cart);
|
||||
|
||||
$this->assertCount(1, $result);
|
||||
|
@ -107,6 +115,13 @@ class ItemFactoryTest extends TestCase
|
|||
$woocommerce->session = $session;
|
||||
$session->shouldReceive('get')->andReturn([]);
|
||||
|
||||
when('wp_get_attachment_image_src')->justReturn('image_url');
|
||||
$product
|
||||
->expects('get_image_id')
|
||||
->andReturn(1);
|
||||
$product
|
||||
->expects('get_permalink')
|
||||
->andReturn('url');
|
||||
|
||||
$result = $testee->from_wc_cart($cart);
|
||||
|
||||
|
@ -132,6 +147,14 @@ class ItemFactoryTest extends TestCase
|
|||
expect('wp_strip_all_tags')->andReturnFirstArg();
|
||||
expect('strip_shortcodes')->andReturnFirstArg();
|
||||
|
||||
when('wp_get_attachment_image_src')->justReturn('image_url');
|
||||
$product
|
||||
->expects('get_image_id')
|
||||
->andReturn(1);
|
||||
$product
|
||||
->expects('get_permalink')
|
||||
->andReturn('url');
|
||||
|
||||
$item = Mockery::mock(\WC_Order_Item_Product::class);
|
||||
$item
|
||||
->expects('get_product')
|
||||
|
@ -217,6 +240,14 @@ class ItemFactoryTest extends TestCase
|
|||
->expects('get_fees')
|
||||
->andReturn([]);
|
||||
|
||||
when('wp_get_attachment_image_src')->justReturn('image_url');
|
||||
$product
|
||||
->expects('get_image_id')
|
||||
->andReturn(1);
|
||||
$product
|
||||
->expects('get_permalink')
|
||||
->andReturn('url');
|
||||
|
||||
$result = $testee->from_wc_order($order);
|
||||
$item = current($result);
|
||||
/**
|
||||
|
@ -271,6 +302,14 @@ class ItemFactoryTest extends TestCase
|
|||
->expects('get_fees')
|
||||
->andReturn([]);
|
||||
|
||||
when('wp_get_attachment_image_src')->justReturn('image_url');
|
||||
$product
|
||||
->expects('get_image_id')
|
||||
->andReturn(1);
|
||||
$product
|
||||
->expects('get_permalink')
|
||||
->andReturn('url');
|
||||
|
||||
$result = $testee->from_wc_order($order);
|
||||
$item = current($result);
|
||||
/**
|
||||
|
|
|
@ -3,7 +3,7 @@ declare(strict_types=1);
|
|||
|
||||
namespace WooCommerce\PayPalCommerce\Onboarding\Helper;
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use WooCommerce\PayPalCommerce\TestCase;
|
||||
use WooCommerce\PayPalCommerce\ApiClient\Helper\Cache;
|
||||
use RuntimeException;
|
||||
use function Brain\Monkey\Functions\when;
|
||||
|
@ -15,7 +15,7 @@ class OnboardingUrlTest extends TestCase
|
|||
private $user_id = 123;
|
||||
private $onboardingUrl;
|
||||
|
||||
protected function setUp(): void
|
||||
public function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue