Skip to content

Commit ff8b9b1

Browse files
committed
Merge remote-tracking branch 'magento/2.4-develop' into fix-for-issue-36456
2 parents e53df6c + 9649f62 commit ff8b9b1

File tree

242 files changed

+6279
-817
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

242 files changed

+6279
-817
lines changed

app/code/Magento/Analytics/Test/Mftf/Test/AdminConfigurationPermissionTest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
<click selector="{{AdminUserGridSection.searchResultFirstRow}}" stepKey="clickFoundUsername"/>
3636
<waitForPageLoad time="30" stepKey="wait2"/>
3737
<seeInField selector="{{AdminEditUserSection.usernameTextField}}" userInput="$$noReportUser.username$$" stepKey="seeUsernameInField"/>
38-
<fillField selector="{{AdminEditUserSection.currentPasswordField}}" userInput="{{_ENV.MAGENTO_ADMIN_PASSWORD}}" stepKey="fillCurrentPassword"/>
38+
<fillField selector="{{AdminEditUserSection.currentPasswordField}}" userInput="{{_CREDS.magento/MAGENTO_ADMIN_PASSWORD}}" stepKey="fillCurrentPassword"/>
3939
<scrollToTopOfPage stepKey="scrollToTopOfPage"/>
4040

4141
<click selector="{{AdminEditUserSection.userRoleTab}}" stepKey="clickUserRoleTab"/>
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
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+
<suites xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Suite/etc/suiteSchema.xsd">
11+
<suite name="AsyncOperationsSuite">
12+
<include>
13+
<group name="async_operations"/>
14+
</include>
15+
</suite>
16+
</suites>

app/code/Magento/AsyncConfig/Test/Mftf/Test/AsyncConfigurationTest.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
<severity value="MAJOR"/>
1717
<testCaseId value="ACPT-885"/>
1818
<group value="configuration"/>
19+
<group value="async_operations" />
1920
</annotations>
2021
<before>
2122
<!--Enable Async Configuration-->

app/code/Magento/Backend/Block/Widget/Grid/Column/Filter/Date.php

Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -109,25 +109,16 @@ public function getHtml()
109109
' value="' .
110110
$this->localeResolver->getLocale() .
111111
'"/>';
112-
$scriptString = '
113-
require(["jquery", "mage/calendar"], function($){
114-
$("#' .
115-
$htmlId .
116-
'_range").dateRange({
117-
dateFormat: "' .
118-
$format .
119-
'",
120-
buttonText: "' . $this->escapeHtml(__('Date selector')) .
121-
'",
112+
$scriptString = 'require(["jquery", "mage/calendar"], function($){
113+
$("#' . $htmlId . '_range").dateRange({
114+
dateFormat: "' . $format . '",
115+
buttonText: "' . $this->escapeHtml(__('Date selector')) . '",
116+
buttonImage: "' . $this->getViewFileUrl('Magento_Theme::calendar.png') . '",
122117
from: {
123-
id: "' .
124-
$htmlId .
125-
'_from"
118+
id: "' . $htmlId . '_from"
126119
},
127120
to: {
128-
id: "' .
129-
$htmlId .
130-
'_to"
121+
id: "' . $htmlId . '_to"
131122
}
132123
})
133124
});';

app/code/Magento/Backend/Block/Widget/Grid/Column/Filter/Datetime.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class Datetime extends \Magento\Backend\Block\Widget\Grid\Column\Filter\Date
1717
/**
1818
* full day is 86400, we need 23 hours:59 minutes:59 seconds = 86399
1919
*/
20-
const END_OF_DAY_IN_SECONDS = 86399;
20+
public const END_OF_DAY_IN_SECONDS = 86399;
2121

2222
/**
2323
* @inheritdoc
@@ -123,6 +123,7 @@ public function getHtml()
123123
timeFormat: "' . $timeFormat . '",
124124
showsTime: ' . ($this->getColumn()->getFilterTime() ? 'true' : 'false') . ',
125125
buttonText: "' . $this->escapeHtml(__('Date selector')) . '",
126+
buttonImage: "' . $this->getViewFileUrl('Magento_Theme::calendar.png') . '",
126127
from: {
127128
id: "' . $htmlId . '_from"
128129
},

app/code/Magento/Backend/Test/Mftf/ActionGroup/AdminLoginActionGroup.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414
</annotations>
1515
<arguments>
1616
<argument name="username" type="string" defaultValue="{{_ENV.MAGENTO_ADMIN_USERNAME}}"/>
17-
<argument name="password" type="string" defaultValue="{{_CREDS.magento/MAGENTO_ADMIN_PASSWORD}}"/></arguments>
17+
<argument name="password" type="string" defaultValue="{{_CREDS.magento/MAGENTO_ADMIN_PASSWORD}}"/>
18+
</arguments>
1819

1920
<amOnPage url="{{AdminLoginPage.url}}" stepKey="navigateToAdmin"/>
2021
<fillField selector="{{AdminLoginFormSection.username}}" userInput="{{username}}" stepKey="fillUsername"/>

app/code/Magento/Backend/Test/Mftf/ActionGroup/SetAdminAccountActionGroup.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
<waitForElementVisible selector="{{AdminSystemAccountSection.interfaceLocale}}" stepKey="waitForInterfaceLocale"/>
2121
<!-- Change Admin locale to Français (France) / French (France) -->
2222
<selectOption userInput="{{InterfaceLocaleByValue}}" selector="{{AdminSystemAccountSection.interfaceLocale}}" stepKey="setInterfaceLocate"/>
23-
<fillField selector="{{AdminSystemAccountSection.currentPassword}}" userInput="{{_ENV.MAGENTO_ADMIN_PASSWORD}}" stepKey="fillPassword"/>
23+
<fillField selector="{{AdminSystemAccountSection.currentPassword}}" userInput="{{_CREDS.magento/MAGENTO_ADMIN_PASSWORD}}" stepKey="fillPassword"/>
2424
<click selector="{{AdminMainActionsSection.save}}" stepKey="clickSave"/>
2525
<waitForElementVisible selector="{{AdminMessagesSection.success}}" stepKey="waitSuccessMessage"/>
2626
<see selector="{{AdminMessagesSection.success}}" userInput="You saved the account." stepKey="seeSuccessMessage"/>

app/code/Magento/Backend/Test/Mftf/Test/AdminLoginFailedTest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
</annotations>
2323

2424
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin">
25-
<argument name="password" value="INVALID!{{_ENV.MAGENTO_ADMIN_PASSWORD}}"/>
25+
<argument name="password" value="INVALID!"/>
2626
</actionGroup>
2727
<actionGroup ref="AssertMessageOnAdminLoginActionGroup" stepKey="assertErrorMessage"/>
2828
</test>

app/code/Magento/Backend/Test/Unit/Block/Widget/Grid/Column/Filter/DateTest.php

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,21 @@
1010
use Magento\Backend\Block\Context;
1111
use Magento\Backend\Block\Widget\Grid\Column;
1212
use Magento\Backend\Block\Widget\Grid\Column\Filter\Date;
13+
use Magento\Framework\App\Request\Http;
1314
use Magento\Framework\Escaper;
1415
use Magento\Framework\Locale\ResolverInterface;
1516
use Magento\Framework\Math\Random;
1617
use Magento\Framework\Stdlib\DateTime\DateTimeFormatterInterface;
1718
use Magento\Framework\Stdlib\DateTime\TimezoneInterface;
1819
use Magento\Framework\TestFramework\Unit\Helper\ObjectManager;
20+
use Magento\Framework\View\Asset\Repository;
1921
use PHPUnit\Framework\MockObject\MockObject;
2022
use PHPUnit\Framework\TestCase;
2123

2224
/**
2325
* Class DateTest to test Magento\Backend\Block\Widget\Grid\Column\Filter\Date
2426
*
27+
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
2528
*/
2629
class DateTest extends TestCase
2730
{
@@ -49,6 +52,16 @@ class DateTest extends TestCase
4952
/** @var Context|MockObject */
5053
private $contextMock;
5154

55+
/**
56+
* @var Http|MockObject
57+
*/
58+
private $request;
59+
60+
/**
61+
* @var Repository|MockObject
62+
*/
63+
private $repositoryMock;
64+
5265
protected function setUp(): void
5366
{
5467
$this->mathRandomMock = $this->getMockBuilder(Random::class)
@@ -88,6 +101,23 @@ protected function setUp(): void
88101
$this->contextMock->expects($this->once())->method('getEscaper')->willReturn($this->escaperMock);
89102
$this->contextMock->expects($this->once())->method('getLocaleDate')->willReturn($this->localeDateMock);
90103

104+
$this->request = $this->getMockBuilder(Http::class)
105+
->disableOriginalConstructor()
106+
->getMock();
107+
108+
$this->contextMock->expects($this->once())
109+
->method('getRequest')
110+
->willReturn($this->request);
111+
112+
$this->repositoryMock = $this->getMockBuilder(Repository::class)
113+
->disableOriginalConstructor()
114+
->setMethods(['getUrlWithParams'])
115+
->getMock();
116+
117+
$this->contextMock->expects($this->once())
118+
->method('getAssetRepository')
119+
->willReturn($this->repositoryMock);
120+
91121
$objectManagerHelper = new ObjectManager($this);
92122
$this->model = $objectManagerHelper->getObject(
93123
Date::class,
@@ -116,6 +146,14 @@ public function testGetHtmlSuccessfulTimestamp()
116146
'from' => $yesterday->getTimestamp(),
117147
'to' => $tomorrow->getTimestamp()
118148
];
149+
$params = ['_secure' => false];
150+
$fileId = 'Magento_Theme::calendar.png';
151+
$fileUrl = 'file url';
152+
153+
$this->repositoryMock->expects($this->once())
154+
->method('getUrlWithParams')
155+
->with($fileId, $params)
156+
->willReturn($fileUrl);
119157

120158
$this->mathRandomMock->expects($this->any())->method('getUniqueHash')->willReturn($uniqueHash);
121159
$this->columnMock->expects($this->once())->method('getHtmlId')->willReturn($id);

app/code/Magento/Backend/Test/Unit/Block/Widget/Grid/Column/Filter/DatetimeTest.php

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,21 @@
1010
use Magento\Backend\Block\Context;
1111
use Magento\Backend\Block\Widget\Grid\Column;
1212
use Magento\Backend\Block\Widget\Grid\Column\Filter\Datetime;
13+
use Magento\Framework\App\Request\Http;
1314
use Magento\Framework\Escaper;
1415
use Magento\Framework\Locale\ResolverInterface;
1516
use Magento\Framework\Math\Random;
1617
use Magento\Framework\Stdlib\DateTime\DateTimeFormatterInterface;
1718
use Magento\Framework\Stdlib\DateTime\TimezoneInterface;
1819
use Magento\Framework\TestFramework\Unit\Helper\ObjectManager;
20+
use Magento\Framework\View\Asset\Repository;
1921
use PHPUnit\Framework\MockObject\MockObject;
2022
use PHPUnit\Framework\TestCase;
2123

2224
/**
2325
* Class DateTimeTest to test Magento\Backend\Block\Widget\Grid\Column\Filter\Date
26+
*
27+
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
2428
*/
2529
class DatetimeTest extends TestCase
2630
{
@@ -48,6 +52,16 @@ class DatetimeTest extends TestCase
4852
/** @var Context|MockObject */
4953
private $contextMock;
5054

55+
/**
56+
* @var Http|MockObject
57+
*/
58+
private $request;
59+
60+
/**
61+
* @var Repository|MockObject
62+
*/
63+
private $repositoryMock;
64+
5165
protected function setUp(): void
5266
{
5367
$this->mathRandomMock = $this->getMockBuilder(Random::class)
@@ -87,6 +101,23 @@ protected function setUp(): void
87101
$this->contextMock->expects($this->once())->method('getEscaper')->willReturn($this->escaperMock);
88102
$this->contextMock->expects($this->once())->method('getLocaleDate')->willReturn($this->localeDateMock);
89103

104+
$this->request = $this->getMockBuilder(Http::class)
105+
->disableOriginalConstructor()
106+
->getMock();
107+
108+
$this->contextMock->expects($this->once())
109+
->method('getRequest')
110+
->willReturn($this->request);
111+
112+
$this->repositoryMock = $this->getMockBuilder(Repository::class)
113+
->disableOriginalConstructor()
114+
->setMethods(['getUrlWithParams'])
115+
->getMock();
116+
117+
$this->contextMock->expects($this->once())
118+
->method('getAssetRepository')
119+
->willReturn($this->repositoryMock);
120+
90121
$objectManagerHelper = new ObjectManager($this);
91122
$this->model = $objectManagerHelper->getObject(
92123
Datetime::class,
@@ -115,6 +146,14 @@ public function testGetHtmlSuccessfulTimestamp()
115146
'from' => $yesterday->getTimestamp(),
116147
'to' => $tomorrow->getTimestamp()
117148
];
149+
$params = ['_secure' => false];
150+
$fileId = 'Magento_Theme::calendar.png';
151+
$fileUrl = 'file url';
152+
153+
$this->repositoryMock->expects($this->once())
154+
->method('getUrlWithParams')
155+
->with($fileId, $params)
156+
->willReturn($fileUrl);
118157

119158
$this->mathRandomMock->expects($this->any())->method('getUniqueHash')->willReturn($uniqueHash);
120159
$this->columnMock->expects($this->once())->method('getHtmlId')->willReturn($id);

0 commit comments

Comments
 (0)