Skip to content

Commit 628beb0

Browse files
Merge branch '2.4-develop' into fix-27489
2 parents bf1722a + b1ef766 commit 628beb0

File tree

40 files changed

+869
-82
lines changed

40 files changed

+869
-82
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AdminFillSearchTermActionGroup">
12+
<annotations>
13+
<description>Fills the search terms form with sample data.</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="searchQuery" type="string"/>
17+
<argument name="store" type="string"/>
18+
<argument name="redirectUrl" type="string"/>
19+
<argument name="suggestedTerms" type="string"/>
20+
</arguments>
21+
<!-- Fill form fields -->
22+
<fillField selector="{{AdminSearchTermsPageFormFieldsSection.query_text}}" userInput="{{searchQuery}}" stepKey="fillFieldSearchQuery"/>
23+
<selectOption selector="{{AdminSearchTermsPageFormFieldsSection.store_id}}" userInput="{{store}}" stepKey="selectStoreView"/>
24+
<fillField selector="{{AdminSearchTermsPageFormFieldsSection.redirect}}" userInput="{{redirectUrl}}" stepKey="fillFieldRedirectUrl"/>
25+
<selectOption selector="{{AdminSearchTermsPageFormFieldsSection.display_in_terms}}" userInput="{{suggestedTerms}}" stepKey="selectSuggestedTerms" />
26+
</actionGroup>
27+
</actionGroups>
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AdminOpenNewSearchTermsPageActionGroup">
12+
<annotations>
13+
<description>Navigate to search terms form page.</description>
14+
</annotations>
15+
<amOnPage url="{{AdminSearchTermsFormPage.url}}" stepKey="amOnSearchTermsForm"/>
16+
<waitForPageLoad stepKey="waitForPageLoad1"/>
17+
</actionGroup>
18+
</actionGroups>
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AdminSaveSearchTermActionGroup">
12+
<annotations>
13+
<description>Save a new search term from Magento admin.</description>
14+
</annotations>
15+
<!-- Click save action and verify success message -->
16+
<click selector="{{AdminMainActionsSection.save}}" stepKey="clickSaveSearchButton"/>
17+
</actionGroup>
18+
</actionGroups>
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd">
11+
<entity name="SearchTerms">
12+
<data key="searchQuery" unique="suffix">books</data>
13+
<data key="store">Default Store View</data>
14+
<data key="redirectUrl">http://sample.com</data>
15+
<data key="suggestedTerms">1</data>
16+
</entity>
17+
</entities>
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<pages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/PageObject.xsd">
11+
<page name="AdminSearchTermsFormPage" url="search/term/new/" area="admin" module="Magento_AdvancedSearch">
12+
<section name="AdminSearchTermsPageFormFieldsSection"/>
13+
</page>
14+
</pages>
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
11+
<section name="AdminSearchTermsPageFormFieldsSection">
12+
<element name="query_text" type="input" selector="#query_text"/>
13+
<element name="store_id" type="select" selector="#store_id"/>
14+
<element name="redirect" type="input" selector="#redirect"/>
15+
<element name="display_in_terms" type="select" selector="#display_in_terms"/>
16+
</section>
17+
</sections>
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
11+
<test name="AdminAddSearchTermTest">
12+
<annotations>
13+
<features value="AdvancedSearch"/>
14+
<stories value="Add a new search term"/>
15+
<title value="Admin should be able to create a new search term"/>
16+
<description value="Admin should be able to create a new search term using search terms grid"/>
17+
<severity value="CRITICAL"/>
18+
<group value="AdvancedSearch"/>
19+
</annotations>
20+
<before>
21+
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
22+
</before>
23+
<after>
24+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
25+
</after>
26+
<actionGroup ref="AdminOpenNewSearchTermsPageActionGroup" stepKey="navigateToSearchTermPage"/>
27+
<actionGroup ref="AdminFillSearchTermActionGroup" stepKey="fillNewSearchTermData">
28+
<argument name="searchQuery" value="{{SearchTerms.searchQuery}}"/>
29+
<argument name="store" value="{{SearchTerms.store}}"/>
30+
<argument name="redirectUrl" value="{{SearchTerms.redirectUrl}}"/>
31+
<argument name="suggestedTerms" value="{{SearchTerms.suggestedTerms}}"/>
32+
</actionGroup>
33+
<actionGroup ref="AdminSaveSearchTermActionGroup" stepKey="saveSearchTerm"/>
34+
<actionGroup ref="AssertMessageInAdminPanelActionGroup" stepKey="assertSaveSearchTermSuccessMessage">
35+
<argument name="message" value="You saved the search term."/>
36+
<argument name="messageType" value="success"/>
37+
</actionGroup>
38+
</test>
39+
</tests>

app/code/Magento/Catalog/Helper/Output.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ public function productAttribute($product, $attributeHtml, $attributeName)
182182
if ($attributeHtml !== null
183183
&& $attribute->getIsHtmlAllowedOnFront()
184184
&& $attribute->getIsWysiwygEnabled()
185-
&& $this->isDirectivesExists($attributeHtml)
185+
&& $this->isDirectivesExists((string)$attributeHtml)
186186
) {
187187
$attributeHtml = $this->_getTemplateProcessor()->filter($attributeHtml);
188188
}
@@ -219,7 +219,7 @@ public function categoryAttribute($category, $attributeHtml, $attributeName)
219219
if ($attributeHtml !== null
220220
&& $attribute->getIsHtmlAllowedOnFront()
221221
&& $attribute->getIsWysiwygEnabled()
222-
&& $this->isDirectivesExists($attributeHtml)
222+
&& $this->isDirectivesExists((string)$attributeHtml)
223223

224224
) {
225225
$attributeHtml = $this->_getTemplateProcessor()->filter($attributeHtml);
@@ -238,7 +238,7 @@ public function categoryAttribute($category, $attributeHtml, $attributeName)
238238
* @param string $attributeHtml
239239
* @return bool
240240
*/
241-
public function isDirectivesExists($attributeHtml)
241+
public function isDirectivesExists(string $attributeHtml): bool
242242
{
243243
$matches = false;
244244
foreach ($this->directivePatterns as $pattern) {

app/code/Magento/Checkout/view/frontend/layout/checkout_cart_index.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@
184184
<block class="Magento\Framework\View\Element\RendererList" name="checkout.cart.item.renderers" as="renderer.list"/>
185185
<block class="Magento\Framework\View\Element\Text\ListText" name="checkout.cart.order.actions"/>
186186
</block>
187-
<container name="checkout.cart.widget" as="checkout_cart_widget" label="Shopping Cart Items After"/>
187+
<container name="checkout.cart.widget" as="checkout_cart_widget" label="Shopping Cart Items After" after="cart-items"/>
188188
</container>
189189
<block class="Magento\Checkout\Block\Cart\Crosssell" name="checkout.cart.crosssell" template="Magento_Catalog::product/list/items.phtml" after="-" ifconfig="checkout/cart/crosssell_enabled">
190190
<arguments>

app/code/Magento/Cms/view/adminhtml/templates/browser/content/files.phtml

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,29 +7,35 @@
77
/** @var $block \Magento\Cms\Block\Adminhtml\Wysiwyg\Images\Content\Files */
88

99
$_width = $block->getImagesWidth();
10-
$_height = $block->getImagesHeight();
1110

1211
?>
13-
<?php if ($block->getFilesCount() > 0) : ?>
14-
<?php foreach ($block->getFiles() as $file) : ?>
12+
<?php if ($block->getFilesCount() > 0): ?>
13+
<?php foreach ($block->getFiles() as $file): ?>
14+
<?php
15+
$src = $block->getFileThumbUrl($file);
16+
$width = $block->getFileWidth($file);
17+
$height = $block->getFileHeight($file);
18+
$filename = $block->getFileName($file);
19+
?>
1520
<div
1621
data-row="file"
1722
class="filecnt"
1823
id="<?= $block->escapeHtmlAttr($block->getFileId($file)) ?>"
1924
data-size="<?= $block->escapeHtmlAttr($file->getSize()) ?>"
2025
data-mime-type="<?= $block->escapeHtmlAttr($file->getMimeType()) ?>"
2126
>
22-
<p class="nm" style="height:<?= $block->escapeHtmlAttr($_height) ?>px;">
23-
<?php if ($block->getFileThumbUrl($file)) : ?>
24-
<img src="<?= $block->escapeHtmlAttr($block->getFileThumbUrl($file)) ?>" alt="<?= $block->escapeHtmlAttr($block->getFileName($file)) ?>"/>
27+
<p class="nm">
28+
<?php if ($block->getFileThumbUrl($file)): ?>
29+
<img src="<?= $block->escapeHtmlAttr($src) ?>" alt="<?= $block->escapeHtmlAttr($filename) ?>"/>
2530
<?php endif; ?>
2631
</p>
27-
<?php if ($block->getFileWidth($file)) : ?>
28-
<small><?= $block->escapeHtml($block->getFileWidth($file)) ?>x<?= $block->escapeHtml($block->getFileHeight($file)) ?> <?= $block->escapeHtml(__('px.')) ?></small><br/>
32+
<?php if ($block->getFileWidth($file)): ?>
33+
<small><?= $block->escapeHtmlAttr($width) ?>x<?= $block->escapeHtmlAttr($height) ?>
34+
<?= $block->escapeHtml(__('px.')) ?></small><br/>
2935
<?php endif; ?>
3036
<small><?= $block->escapeHtml($block->getFileShortName($file)) ?></small>
3137
</div>
3238
<?php endforeach; ?>
33-
<?php else : ?>
39+
<?php else: ?>
3440
<div class="empty"><?= $block->escapeHtml(__('No files found')) ?></div>
3541
<?php endif; ?>

app/code/Magento/Customer/Controller/Account/Confirm.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@
2424
/**
2525
* Class Confirm
2626
*
27+
* Confirm class is responsible for account confirmation flow
28+
*
2729
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
2830
*/
2931
class Confirm extends AbstractAccount implements HttpGetActionInterface
@@ -168,7 +170,7 @@ public function execute()
168170
$metadata->setPath('/');
169171
$this->getCookieManager()->deleteCookie('mage-cache-sessid', $metadata);
170172
}
171-
$this->messageManager->addSuccessMessage($this->getSuccessMessage());
173+
$this->messageManager->addSuccess($this->getSuccessMessage());
172174
$resultRedirect->setUrl($this->getSuccessRedirect());
173175
return $resultRedirect;
174176
} catch (StateException $e) {

app/code/Magento/Customer/Controller/Account/LoginPost.php

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,11 @@ class LoginPost extends AbstractAccount implements CsrfAwareActionInterface, Htt
6767
*/
6868
private $cookieMetadataManager;
6969

70+
/**
71+
* @var CustomerUrl
72+
*/
73+
private $customerUrl;
74+
7075
/**
7176
* @param Context $context
7277
* @param Session $customerSession
@@ -199,11 +204,11 @@ public function execute()
199204
return $resultRedirect;
200205
}
201206
} catch (EmailNotConfirmedException $e) {
202-
$value = $this->customerUrl->getEmailConfirmationUrl($login['username']);
203-
$message = __(
204-
'This account is not confirmed. <a href="%1">Click here</a> to resend confirmation email.',
205-
$value
207+
$this->messageManager->addComplexErrorMessage(
208+
'confirmAccountErrorMessage',
209+
['url' => $this->customerUrl->getEmailConfirmationUrl($login['username'])]
206210
);
211+
$this->session->setUsername($login['username']);
207212
} catch (AuthenticationException $e) {
208213
$message = __(
209214
'The account sign-in was incorrect or your account is disabled temporarily. '

app/code/Magento/Customer/Test/Unit/Controller/Account/ConfirmTest.php

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -23,77 +23,77 @@ class ConfirmTest extends \PHPUnit\Framework\TestCase
2323
protected $model;
2424

2525
/**
26-
* @var \Magento\Framework\App\RequestInterface|\PHPUnit_Framework_MockObject_MockObject
26+
* @var \Magento\Framework\App\RequestInterface|\PHPUnit\Framework\MockObject\MockObject
2727
*/
2828
protected $requestMock;
2929

3030
/**
31-
* @var \Magento\Framework\App\ResponseInterface|\PHPUnit_Framework_MockObject_MockObject
31+
* @var \Magento\Framework\App\ResponseInterface|\PHPUnit\Framework\MockObject\MockObject
3232
*/
3333
protected $responseMock;
3434

3535
/**
36-
* @var \Magento\Customer\Model\Session|\PHPUnit_Framework_MockObject_MockObject
36+
* @var \Magento\Customer\Model\Session|\PHPUnit\Framework\MockObject\MockObject
3737
*/
3838
protected $customerSessionMock;
3939

4040
/**
41-
* @var \Magento\Framework\App\Response\RedirectInterface|\PHPUnit_Framework_MockObject_MockObject
41+
* @var \Magento\Framework\App\Response\RedirectInterface|\PHPUnit\Framework\MockObject\MockObject
4242
*/
4343
protected $redirectMock;
4444

4545
/**
46-
* @var \Magento\Framework\Url|\PHPUnit_Framework_MockObject_MockObject
46+
* @var \Magento\Framework\Url|\PHPUnit\Framework\MockObject\MockObject
4747
*/
4848
protected $urlMock;
4949

5050
/**
51-
* @var \Magento\Customer\Api\AccountManagementInterface|\PHPUnit_Framework_MockObject_MockObject
51+
* @var \Magento\Customer\Api\AccountManagementInterface|\PHPUnit\Framework\MockObject\MockObject
5252
*/
5353
protected $customerAccountManagementMock;
5454

5555
/**
56-
* @var \Magento\Customer\Api\CustomerRepositoryInterface|\PHPUnit_Framework_MockObject_MockObject
56+
* @var \Magento\Customer\Api\CustomerRepositoryInterface|\PHPUnit\Framework\MockObject\MockObject
5757
*/
5858
protected $customerRepositoryMock;
5959

6060
/**
61-
* @var \Magento\Customer\Api\Data\CustomerInterface|\PHPUnit_Framework_MockObject_MockObject
61+
* @var \Magento\Customer\Api\Data\CustomerInterface|\PHPUnit\Framework\MockObject\MockObject
6262
*/
6363
protected $customerDataMock;
6464

6565
/**
66-
* @var \Magento\Framework\Message\ManagerInterface|\PHPUnit_Framework_MockObject_MockObject
66+
* @var \Magento\Framework\Message\ManagerInterface|\PHPUnit\Framework\MockObject\MockObject
6767
*/
6868
protected $messageManagerMock;
6969

7070
/**
71-
* @var \Magento\Customer\Helper\Address|\PHPUnit_Framework_MockObject_MockObject
71+
* @var \Magento\Customer\Helper\Address|\PHPUnit\Framework\MockObject\MockObject
7272
*/
7373
protected $addressHelperMock;
7474

7575
/**
76-
* @var \Magento\Store\Model\StoreManager|\PHPUnit_Framework_MockObject_MockObject
76+
* @var \Magento\Store\Model\StoreManager|\PHPUnit\Framework\MockObject\MockObject
7777
*/
7878
protected $storeManagerMock;
7979

8080
/**
81-
* @var \Magento\Store\Model\Store|\PHPUnit_Framework_MockObject_MockObject
81+
* @var \Magento\Store\Model\Store|\PHPUnit\Framework\MockObject\MockObject
8282
*/
8383
protected $storeMock;
8484

8585
/**
86-
* @var \Magento\Framework\App\Config\ScopeConfigInterface|\PHPUnit_Framework_MockObject_MockObject
86+
* @var \Magento\Framework\App\Config\ScopeConfigInterface|\PHPUnit\Framework\MockObject\MockObject
8787
*/
8888
protected $scopeConfigMock;
8989

9090
/**
91-
* @var \Magento\Framework\App\Action\Context|\PHPUnit_Framework_MockObject_MockObject
91+
* @var \Magento\Framework\App\Action\Context|\PHPUnit\Framework\MockObject\MockObject
9292
*/
9393
protected $contextMock;
9494

9595
/**
96-
* @var \Magento\Framework\Controller\Result\Redirect|\PHPUnit_Framework_MockObject_MockObject
96+
* @var \Magento\Framework\Controller\Result\Redirect|\PHPUnit\Framework\MockObject\MockObject
9797
*/
9898
protected $redirectResultMock;
9999

@@ -282,7 +282,7 @@ public function testSuccessMessage($customerId, $key, $vatValidationEnabled, $ad
282282
->willReturnSelf();
283283

284284
$this->messageManagerMock->expects($this->any())
285-
->method('addSuccessMessage')
285+
->method('addSuccess')
286286
->with($this->stringContains($successMessage))
287287
->willReturnSelf();
288288

@@ -402,7 +402,7 @@ public function testSuccessRedirect(
402402
->willReturnSelf();
403403

404404
$this->messageManagerMock->expects($this->any())
405-
->method('addSuccessMessage')
405+
->method('addSuccess')
406406
->with($this->stringContains($successMessage))
407407
->willReturnSelf();
408408

0 commit comments

Comments
 (0)