Skip to content

Commit 6815c97

Browse files
committed
MAGETWO-60572: [GitHub] PayPal.js error on checkout downloadable product #7000
1 parent 29e6c2e commit 6815c97

File tree

3 files changed

+26
-7
lines changed

3 files changed

+26
-7
lines changed

dev/tests/functional/tests/app/Magento/Braintree/Test/TestStep/PlaceOrderWithPaypalStep.php

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,13 @@ class PlaceOrderWithPaypalStep implements TestStepInterface
6767
*/
6868
protected $checkoutMethod;
6969

70+
/**
71+
* Shipping carrier and method.
72+
*
73+
* @var array
74+
*/
75+
protected $shipping;
76+
7077
/**
7178
* @param CheckoutOnepage $checkoutOnepage
7279
* @param AssertGrandTotalOrderReview $assertGrandTotalOrderReview
@@ -77,6 +84,8 @@ class PlaceOrderWithPaypalStep implements TestStepInterface
7784
* @param string $checkoutMethod
7885
* @param array $products
7986
* @param array $prices
87+
* @param array $shipping
88+
*
8089
*/
8190
public function __construct(
8291
CheckoutOnepage $checkoutOnepage,
@@ -88,7 +97,9 @@ public function __construct(
8897
$checkoutMethod,
8998

9099
array $products,
91-
array $prices = []
100+
array $prices = [],
101+
array $shipping = []
102+
92103
) {
93104
$this->checkoutOnepage = $checkoutOnepage;
94105
$this->assertGrandTotalOrderReview = $assertGrandTotalOrderReview;
@@ -99,6 +110,7 @@ public function __construct(
99110
$this->checkoutMethod = $checkoutMethod;
100111
$this->products = $products;
101112
$this->prices = $prices;
113+
$this->shipping = $shipping;
102114
}
103115

104116
/**
@@ -112,7 +124,9 @@ public function run()
112124

113125
$this->assertBillingAddressAbsentInPayment->processAssert($this->checkoutOnepage);
114126

115-
if ($this->checkoutMethod === 'guest') {
127+
if ($this->checkoutMethod === 'guest' &&
128+
empty($this->shipping['shipping_method']) &&
129+
empty($this->shipping['shipping_service'])) {
116130
$this->checkoutOnepage->getLoginBlock()->fillGuestFields($this->customer);
117131
}
118132

dev/tests/functional/tests/app/Magento/Checkout/Test/Constraint/AssertBillingAddressAbsentInPayment.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,23 +10,23 @@
1010
use Magento\Mtf\Constraint\AbstractConstraint;
1111

1212
/**
13-
* Class AssertBillingAddressAbsentInShoppingCart
14-
* Assert billing address is not present in selected payment method
13+
* Assert billing address is not present in selected payment method.
1514
*/
1615
class AssertBillingAddressAbsentInPayment extends AbstractConstraint
1716
{
1817
/**
19-
* Assert billing address is not present in selected payment method
18+
* Assert billing address is not present in selected payment method.
2019
*
21-
* @param CheckoutOnepage $checkoutOnepage,
20+
* @param CheckoutOnepage $checkoutOnepage
2221
* @return void
2322
*/
2423
public function processAssert(CheckoutOnepage $checkoutOnepage)
2524
{
2625
\PHPUnit_Framework_Assert::assertFalse(
2726
$checkoutOnepage->getPaymentBlock()
2827
->getSelectedPaymentMethodBlock()
29-
->getBillingBlock()->isVisible(),
28+
->getBillingBlock()
29+
->isVisible(),
3030
'Billing address is present in payment method'
3131
);
3232
}

dev/tests/functional/tests/app/Magento/Checkout/Test/etc/di.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,9 @@
1111
<argument name="severity" xsi:type="string">middle</argument>
1212
</arguments>
1313
</type>
14+
<type name="Magento\Checkout\Test\Constraint\AssertBillingAddressAbsentInPayment">
15+
<arguments>
16+
<argument name="severity" xsi:type="string">S2</argument>
17+
</arguments>
18+
</type>
1419
</config>

0 commit comments

Comments
 (0)