Skip to content

Commit 5c70bb7

Browse files
authored
Merge pull request #3111 from magento-honey-badgers/2.3-regression-pr-HB
[2.3 regression team] Bugs
2 parents a04f913 + f671163 commit 5c70bb7

File tree

16 files changed

+127
-17
lines changed

16 files changed

+127
-17
lines changed

app/code/Magento/Catalog/Test/Mftf/Test/StorefrontPurchaseProductWithCustomOptions.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@
9595
<see selector="{{CheckoutPaymentSection.ProductOptionsActiveByProductItemName($createProduct.name$)}}" userInput="{{ProductOptionField.title}}" stepKey="seeProductOptionFieldInput1"/>
9696
<see selector="{{CheckoutPaymentSection.ProductOptionsActiveByProductItemName($createProduct.name$)}}" userInput="{{ProductOptionArea.title}}" stepKey="seeProductOptionAreaInput1"/>
9797
<see selector="{{CheckoutPaymentSection.ProductOptionsActiveByProductItemName($createProduct.name$)}}" userInput="{{productWithOptions.file}}" stepKey="seeProductOptionFileInput1"/>
98+
<seeElement selector="{{CheckoutPaymentSection.ProductOptionLinkActiveByProductItemName($createProduct.name$, productWithOptions.file)}}" stepKey="seeProductOptionFileInputLink1"/>
9899
<see selector="{{CheckoutPaymentSection.ProductOptionsActiveByProductItemName($createProduct.name$)}}" userInput="{{ProductOptionValueDropdown1.title}}" stepKey="seeProductOptionValueDropdown1Input1"/>
99100
<see selector="{{CheckoutPaymentSection.ProductOptionsActiveByProductItemName($createProduct.name$)}}" userInput="{{ProductOptionValueRadioButtons1.title}}" stepKey="seeProductOptionValueRadioButtons1Input1"/>
100101
<see selector="{{CheckoutPaymentSection.ProductOptionsActiveByProductItemName($createProduct.name$)}}" userInput="{{ProductOptionValueCheckbox.title}}" stepKey="seeProductOptionValueCheckboxInput1" />
@@ -128,6 +129,7 @@
128129
<see selector="{{AdminOrderItemsOrderedSection.productNameOptions}}" userInput="{{ProductOptionField.title}}" stepKey="seeAdminOrderProductOptionField" />
129130
<see selector="{{AdminOrderItemsOrderedSection.productNameOptions}}" userInput="{{ProductOptionArea.title}}" stepKey="seeAdminOrderProductOptionArea"/>
130131
<see selector="{{AdminOrderItemsOrderedSection.productNameOptions}}" userInput="{{productWithOptions.file}}" stepKey="seeAdminOrderProductOptionFile"/>
132+
<seeElement selector="{{AdminOrderItemsOrderedSection.productNameOptionsLink(productWithOptions.file)}}" stepKey="seeAdminOrderProductOptionFileLink"/>
131133
<see selector="{{AdminOrderItemsOrderedSection.productNameOptions}}" userInput="{{ProductOptionValueDropdown1.title}}" stepKey="seeAdminOrderProductOptionValueDropdown1"/>
132134
<see selector="{{AdminOrderItemsOrderedSection.productNameOptions}}" userInput="{{ProductOptionValueRadioButtons1.title}}" stepKey="seeAdminOrderProductOptionValueRadioButton1"/>
133135
<see selector="{{AdminOrderItemsOrderedSection.productNameOptions}}" userInput="{{ProductOptionValueCheckbox.title}}" stepKey="seeAdminOrderProductOptionValueCheckbox" />
@@ -144,6 +146,7 @@
144146
<see selector="{{AdminOrderItemsOrderedSection.productNameOptions}}" userInput="{{ProductOptionField.title}}" stepKey="seeAdminOrderProductOptionField1" />
145147
<see selector="{{AdminOrderItemsOrderedSection.productNameOptions}}" userInput="{{ProductOptionArea.title}}" stepKey="seeAdminOrderProductOptionArea1"/>
146148
<see selector="{{AdminOrderItemsOrderedSection.productNameOptions}}" userInput="{{productWithOptions.file}}" stepKey="seeAdminOrderProductOptionFile1"/>
149+
<seeElement selector="{{AdminOrderItemsOrderedSection.productNameOptionsLink(productWithOptions.file)}}" stepKey="seeAdminOrderProductOptionFileLink1"/>
147150
<see selector="{{AdminOrderItemsOrderedSection.productNameOptions}}" userInput="{{ProductOptionValueDropdown1.title}}" stepKey="seeAdminOrderProductOptionValueDropdown11"/>
148151
<see selector="{{AdminOrderItemsOrderedSection.productNameOptions}}" userInput="{{ProductOptionValueRadioButtons1.title}}" stepKey="seeAdminOrderProductOptionValueRadioButton11"/>
149152
<see selector="{{AdminOrderItemsOrderedSection.productNameOptions}}" userInput="{{ProductOptionValueCheckbox.title}}" stepKey="seeAdminOrderProductOptionValueCheckbox1" />
@@ -161,6 +164,7 @@
161164
<see selector="{{StorefrontCustomerOrderSection.productCustomOptions($createProduct.name$, ProductOptionField.title, ProductOptionField.title)}}" userInput="{{ProductOptionField.title}}" stepKey="seeStorefontOrderProductOptionField1" />
162165
<see selector="{{StorefrontCustomerOrderSection.productCustomOptions($createProduct.name$, ProductOptionArea.title, ProductOptionArea.title)}}" userInput="{{ProductOptionArea.title}}" stepKey="seeStorefontOrderProductOptionArea1"/>
163166
<see selector="{{StorefrontCustomerOrderSection.productCustomOptionsFile($createProduct.name$, ProductOptionFile.title, productWithOptions.file)}}" userInput="{{productWithOptions.file}}" stepKey="seeStorefontOrderProductOptionFile1"/>
167+
<seeElement selector="{{StorefrontCustomerOrderSection.productCustomOptionsLink($createProduct.name$, ProductOptionFile.title, productWithOptions.file)}}" stepKey="seeStorefontOrderProductOptionFileLink1"/>
164168
<see selector="{{StorefrontCustomerOrderSection.productCustomOptions($createProduct.name$, ProductOptionDropDown.title, ProductOptionValueDropdown1.title)}}" userInput="{{ProductOptionValueDropdown1.title}}" stepKey="seeStorefontOrderProductOptionValueDropdown11"/>
165169
<see selector="{{StorefrontCustomerOrderSection.productCustomOptions($createProduct.name$, ProductOptionRadiobutton.title, ProductOptionValueRadioButtons1.title)}}" userInput="{{ProductOptionValueRadioButtons1.title}}" stepKey="seeStorefontOrderProductOptionValueRadioButtons11"/>
166170
<see selector="{{StorefrontCustomerOrderSection.productCustomOptions($createProduct.name$, ProductOptionCheckbox.title, ProductOptionValueCheckbox.title)}}" userInput="{{ProductOptionValueCheckbox.title}}" stepKey="seeStorefontOrderProductOptionValueCheckbox1" />

app/code/Magento/Checkout/Test/Mftf/Section/CheckoutPaymentSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
<element name="ProductItemByName" type="text" selector="//div[@class='product-item-details']//strong[@class='product-item-name'][text()='{{var1}}']" parameterized="true" />
3737
<element name="ProductOptionsByProductItemName" type="text" selector="//div[@class='product-item-details']//strong[@class='product-item-name'][text()='{{var1}}']//ancestor::div[@class='product-item-details']//div[@class='product options']" parameterized="true" />
3838
<element name="ProductOptionsActiveByProductItemName" type="text" selector="//div[@class='product-item-details']//strong[@class='product-item-name'][text()='{{var1}}']//ancestor::div[@class='product-item-details']//div[@class='product options active']" parameterized="true" />
39+
<element name="ProductOptionLinkActiveByProductItemName" type="text" selector="//div[@class='product-item-details']//strong[@class='product-item-name'][text()='{{var1}}']//ancestor::div[@class='product-item-details']//div[@class='product options active']//a[text() = '{{var2}}']" parameterized="true" />
3940
<element name="shipToInformation" type="text" selector="//div[@class='ship-to']//div[@class='shipping-information-content']" />
4041
<element name="shippingMethodInformation" type="text" selector="//div[@class='ship-via']//div[@class='shipping-information-content']" />
4142
<element name="paymentMethodTitle" type="text" selector=".payment-method-title span" />

app/code/Magento/Checkout/view/frontend/web/template/minicart/item/default.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
<span data-bind="html: option.value.join('<br>')"></span>
4646
<!-- /ko -->
4747
<!-- ko ifnot: Array.isArray(option.value) -->
48-
<span data-bind="text: option.value"></span>
48+
<span data-bind="html: option.value"></span>
4949
<!-- /ko -->
5050
</dd>
5151
<!-- /ko -->

app/code/Magento/Checkout/view/frontend/web/template/summary/item/details.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
<dd class="values" data-bind="html: full_view"></dd>
3636
<!-- /ko -->
3737
<!-- ko ifnot: ($data.full_view)-->
38-
<dd class="values" data-bind="text: value"></dd>
38+
<dd class="values" data-bind="html: value"></dd>
3939
<!-- /ko -->
4040
<!-- /ko -->
4141
</dl>

app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerOrderSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,6 @@
1111
<section name="StorefrontCustomerOrderSection">
1212
<element name="productCustomOptions" type="text" selector="//strong[contains(@class, 'product-item-name') and normalize-space(.)='{{var1}}']/following-sibling::*[contains(@class, 'item-options')]/dt[normalize-space(.)='{{var2}}']/following-sibling::dd[normalize-space(.)='{{var3}}']" parameterized="true"/>
1313
<element name="productCustomOptionsFile" type="text" selector="//strong[contains(@class, 'product-item-name') and normalize-space(.)='{{var1}}']/following-sibling::*[contains(@class, 'item-options')]/dt[normalize-space(.)='{{var2}}']/following-sibling::dd[contains(.,'{{var3}}')]" parameterized="true"/>
14+
<element name="productCustomOptionsLink" type="text" selector="//strong[contains(@class, 'product-item-name') and normalize-space(.)='{{var1}}']/following-sibling::*[contains(@class, 'item-options')]/dt[normalize-space(.)='{{var2}}']/following-sibling::dd//a[text() = '{{var3}}']" parameterized="true"/>
1415
</section>
1516
</sections>

app/code/Magento/Paypal/Controller/Payflow/ReturnUrl.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ public function execute()
6868
if ($order->getIncrementId()) {
6969
if ($this->checkOrderState($order)) {
7070
$redirectBlock->setData('goto_success_page', true);
71+
$this->_eventManager->dispatch('paypal_checkout_success', ['order' => $order]);
7172
} else {
7273
if ($this->checkPaymentMethod($order)) {
7374
$gotoSection = $this->_cancelPayment((string)$this->getRequest()->getParam('RESPMSG'));

app/code/Magento/Paypal/Test/Unit/Controller/Payflow/ReturnUrlTest.php

Lines changed: 27 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
*/
66
namespace Magento\Paypal\Test\Unit\Controller\Payflow;
77

8+
use Magento\Framework\Event\ManagerInterface;
89
use Magento\Sales\Api\PaymentFailuresInterface;
910
use Magento\Checkout\Block\Onepage\Success;
1011
use Magento\Checkout\Model\Session;
@@ -96,6 +97,11 @@ class ReturnUrlTest extends \PHPUnit\Framework\TestCase
9697
*/
9798
private $paymentFailures;
9899

100+
/**
101+
* @var ManagerInterface|\PHPUnit_Framework_MockObject_MockObject
102+
*/
103+
private $eventManagerMock;
104+
99105
/**
100106
* @inheritdoc
101107
*/
@@ -148,25 +154,31 @@ protected function setUp()
148154
->disableOriginalConstructor()
149155
->getMock();
150156

151-
$this->context->expects($this->any())->method('getView')->willReturn($this->view);
152-
$this->context->expects($this->any())->method('getRequest')->willReturn($this->request);
153-
154157
$this->paymentFailures = $this->getMockBuilder(PaymentFailuresInterface::class)
155158
->disableOriginalConstructor()
156159
->getMock();
157160

161+
$this->eventManagerMock = $this->getMockBuilder(ManagerInterface::class)
162+
->disableOriginalConstructor()
163+
->getMock();
164+
158165
$this->context->method('getView')
159166
->willReturn($this->view);
160167
$this->context->method('getRequest')
161168
->willReturn($this->request);
162-
163-
$this->returnUrl = $this->objectManager->getObject(ReturnUrl::class, [
164-
'context' => $this->context,
165-
'checkoutSession' => $this->checkoutSession,
166-
'orderFactory' => $this->orderFactory,
167-
'checkoutHelper' => $this->checkoutHelper,
168-
'paymentFailures' => $this->paymentFailures,
169-
]);
169+
$this->context->method('getEventManager')
170+
->willReturn($this->eventManagerMock);
171+
172+
$this->returnUrl = $this->objectManager->getObject(
173+
ReturnUrl::class,
174+
[
175+
'context' => $this->context,
176+
'checkoutSession' => $this->checkoutSession,
177+
'orderFactory' => $this->orderFactory,
178+
'checkoutHelper' => $this->checkoutHelper,
179+
'paymentFailures' => $this->paymentFailures,
180+
]
181+
);
170182
}
171183

172184
/**
@@ -187,6 +199,10 @@ public function testExecuteAllowedOrderState($state)
187199
->with('goto_success_page', true)
188200
->willReturnSelf();
189201

202+
$this->eventManagerMock->expects($this->once())
203+
->method('dispatch')
204+
->with('paypal_checkout_success', $this->arrayHasKey('order'));
205+
190206
$result = $this->returnUrl->execute();
191207
$this->assertNull($result);
192208
}

app/code/Magento/Sales/Test/Mftf/Section/AdminOrderItemsOrderedSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323

2424
<element name="productNameColumn" type="text" selector=".edit-order-table .col-product .product-title"/>
2525
<element name="productNameOptions" type="text" selector=".edit-order-table .col-product .item-options"/>
26+
<element name="productNameOptionsLink" type="text" selector="//table[contains(@class, 'edit-order-table')]//td[contains(@class, 'col-product')]//a[text() = '{{var1}}']" parameterized="true"/>
2627
<element name="productSkuColumn" type="text" selector=".edit-order-table .col-product .product-sku-block"/>
2728
<element name="statusColumn" type="text" selector=".edit-order-table .col-status"/>
2829
<element name="originalPriceColumn" type="text" selector=".edit-order-table .col-original-price .price"/>

app/code/Magento/Sales/view/frontend/templates/order/items/renderer/default.phtml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ $_item = $block->getItem();
2020
<?php $_formatedOptionValue = $block->getFormatedOptionValue($_option) ?>
2121
<dd>
2222
<?php if (isset($_formatedOptionValue['full_view'])): ?>
23-
<?= $block->escapeHtml($_formatedOptionValue['full_view']) ?>
23+
<?= $block->escapeHtml($_formatedOptionValue['full_view'], ['a']) ?>
2424
<?php else: ?>
25-
<?=$block->escapeHtml($_formatedOptionValue['value']) ?>
25+
<?=$block->escapeHtml($_formatedOptionValue['value'], ['a']) ?>
2626
<?php endif; ?>
2727
</dd>
2828
<?php else: ?>

app/code/Magento/Signifyd/Observer/PlaceOrder.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
use Magento\Framework\Event\ObserverInterface;
1111
use Magento\Framework\Exception\AlreadyExistsException;
1212
use Magento\Sales\Api\Data\OrderInterface;
13+
use Magento\Sales\Model\Order;
1314
use Magento\Signifyd\Api\CaseCreationServiceInterface;
1415
use Magento\Signifyd\Model\Config;
1516
use Psr\Log\LoggerInterface;
@@ -80,7 +81,9 @@ public function execute(Observer $observer)
8081
private function createCaseForOrder($order)
8182
{
8283
$orderId = $order->getEntityId();
83-
if (null === $orderId || $order->getPayment()->getMethodInstance()->isOffline()) {
84+
if (null === $orderId
85+
|| $order->getPayment()->getMethodInstance()->isOffline()
86+
|| $order->getState() === Order::STATE_PENDING_PAYMENT) {
8487
return;
8588
}
8689

app/code/Magento/Signifyd/Test/Unit/Observer/PlaceOrderTest.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
use Magento\Framework\Exception\AlreadyExistsException;
1111
use Magento\Payment\Model\MethodInterface;
1212
use Magento\Sales\Api\Data\OrderInterface;
13+
use Magento\Sales\Model\Order;
1314
use Magento\Sales\Model\Order\Payment;
1415
use Magento\Signifyd\Api\CaseCreationServiceInterface;
1516
use Magento\Signifyd\Model\Config;
@@ -193,6 +194,23 @@ public function testExecute()
193194
$this->placeOrder->execute($this->observer);
194195
}
195196

197+
public function testExecuteWithOrderPendingPayment()
198+
{
199+
$orderId = 1;
200+
$storeId = 2;
201+
202+
$this->withActiveSignifydIntegration(true, $storeId);
203+
$this->withOrderEntity($orderId, $storeId);
204+
$this->orderEntity->method('getState')
205+
->willReturn(Order::STATE_PENDING_PAYMENT);
206+
$this->withAvailablePaymentMethod(true);
207+
208+
$this->creationService->expects(self::never())
209+
->method('createForOrder');
210+
211+
$this->placeOrder->execute($this->observer);
212+
}
213+
196214
/**
197215
* Specifies order entity mock execution.
198216
*

app/code/Magento/Signifyd/etc/events.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,7 @@
1212
<event name="paypal_express_place_order_success">
1313
<observer name="signifyd_place_order_paypal_express_observer" instance="Magento\Signifyd\Observer\PlaceOrder"/>
1414
</event>
15+
<event name="paypal_checkout_success">
16+
<observer name="signifyd_place_order_checkout_success_observer" instance="Magento\Signifyd\Observer\PlaceOrder" />
17+
</event>
1518
</config>

app/design/frontend/Magento/blank/Magento_MultipleWishlist/web/css/source/_module.less

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,19 @@
3535
.items {
3636
text-align: left;
3737
.item {
38+
> span {
39+
display: block;
40+
padding: 5px 5px 5px 23px;
41+
}
3842
&:last-child {
3943
&:hover {
4044
.lib-css(background, @dropdown-list-item__hover);
4145
}
4246
}
4347
}
48+
li {
49+
padding: 0;
50+
}
4451
}
4552

4653
.table-comparison &,

app/design/frontend/Magento/luma/Magento_MultipleWishlist/web/css/source/_module.less

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,16 @@
4040
.items {
4141
padding: 6px 0;
4242
text-align: left;
43+
.item {
44+
> span {
45+
display: block;
46+
padding: 5px 5px 5px 23px;
47+
}
48+
49+
}
50+
li {
51+
padding: 0;
52+
}
4353
}
4454

4555
> .action {

lib/internal/Magento/Framework/View/Asset/Minification.php

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,16 @@ public function getExcludes($contentType)
162162
private function getMinificationExcludeValues($key)
163163
{
164164
$configValues = $this->scopeConfig->getValue($key, $this->scope) ?? [];
165-
165+
//value used to be a string separated by 'newline' separator so we need to convert it to array
166+
if (!is_array($configValues)) {
167+
$configValuesFromString = [];
168+
foreach (explode("\n", $configValues) as $exclude) {
169+
if (trim($exclude) != '') {
170+
$configValuesFromString[] = trim($exclude);
171+
}
172+
}
173+
$configValues = $configValuesFromString;
174+
}
166175
return array_values($configValues);
167176
}
168177
}

lib/internal/Magento/Framework/View/Test/Unit/Asset/MinificationTest.php

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,8 @@ public function isMinifiedFilenameDataProvider()
195195
}
196196

197197
/**
198+
* Test dev/js/minify_exclude system value as array
199+
*
198200
* @return void
199201
*/
200202
public function testGetExcludes()
@@ -213,4 +215,38 @@ public function testGetExcludes()
213215
/** check cache: */
214216
$this->assertEquals($expected, $this->minification->getExcludes('js'));
215217
}
218+
219+
/**
220+
* Test dev/js/minify_exclude system value backward compatibility when value was a string
221+
*
222+
* @param string $value
223+
* @param array $expectedValue
224+
* @return void
225+
*
226+
* @dataProvider getExcludesTinyMceAsStringDataProvider
227+
*/
228+
public function testGetExcludesTinyMceAsString(string $value, array $expectedValue)
229+
{
230+
$this->scopeConfigMock
231+
->expects($this->once())
232+
->method('getValue')
233+
->with('dev/js/minify_exclude')
234+
->willReturn($value);
235+
236+
$this->assertEquals($expectedValue, $this->minification->getExcludes('js'));
237+
/** check cache: */
238+
$this->assertEquals($expectedValue, $this->minification->getExcludes('js'));
239+
}
240+
241+
/**
242+
* @return array
243+
*/
244+
public function getExcludesTinyMceAsStringDataProvider()
245+
{
246+
return [
247+
["/tiny_mce/ \n /tiny_mce2/", ['/tiny_mce/', '/tiny_mce2/']],
248+
['/tiny_mce/', ['/tiny_mce/']],
249+
[' /tiny_mce/', ['/tiny_mce/']],
250+
];
251+
}
216252
}

0 commit comments

Comments
 (0)