Skip to content

Commit 86b9056

Browse files
authored
Merge branch '2.4-develop' into no-author/wishlist
2 parents 11d3106 + 0b41085 commit 86b9056

File tree

2,050 files changed

+79372
-69488
lines changed

Some content is hidden

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

2,050 files changed

+79372
-69488
lines changed

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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,18 @@
2121
<before>
2222
<!--Enable Async Configuration-->
2323
<magentoCLI stepKey="EnableAsyncConfig" command="setup:config:set --no-interaction --config-async 1"/>
24-
<magentoCLI stepKey="ClearConfigCache" command="cache:flush"/>
24+
<actionGroup ref="CliCacheFlushActionGroup" stepKey="ClearConfigCache">
25+
<argument name="tags" value=""/>
26+
</actionGroup>
2527
<!--Login to Admin-->
2628
<actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/>
2729
</before>
2830
<after>
2931
<magentoCLI stepKey="DisableAsyncConfig" command="setup:config:set --no-interaction --config-async 0"/>
3032
<magentoCLI stepKey="setBackDefaultConfigValue" command="config:set catalog/frontend/grid_per_page 12" />
31-
<magentoCLI stepKey="ClearConfigCache" command="cache:clean"/>
33+
<actionGroup ref="CliCacheCleanActionGroup" stepKey="ClearConfigCache">
34+
<argument name="tags" value="config"/>
35+
</actionGroup>
3236
<actionGroup ref="AdminLogoutActionGroup" stepKey="adminLogout"/>
3337
</after>
3438

app/code/Magento/AsynchronousOperations/Model/ResourceModel/System/Message/Collection/Synchronized/Plugin.php

Lines changed: 23 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
*/
1111
class Plugin
1212
{
13+
private const MESSAGES_LIMIT = 5;
1314
/**
1415
* @var \Magento\AdminNotification\Model\System\MessageFactory
1516
*/
@@ -95,27 +96,32 @@ public function afterToArray(
9596
$this->bulkNotificationManagement->getAcknowledgedBulksByUser($userId)
9697
);
9798
$bulkMessages = [];
99+
$messagesCount = 0;
100+
$data = [];
98101
foreach ($userBulks as $bulk) {
99102
$bulkUuid = $bulk->getBulkId();
100103
if (!in_array($bulkUuid, $acknowledgedBulks)) {
101-
$details = $this->operationDetails->getDetails($bulkUuid);
102-
$text = $this->getText($details);
103-
$bulkStatus = $this->statusMapper->operationStatusToBulkSummaryStatus($bulk->getStatus());
104-
if ($bulkStatus === \Magento\Framework\Bulk\BulkSummaryInterface::IN_PROGRESS) {
105-
$text = __('%1 item(s) are currently being updated.', $details['operations_total']) . $text;
104+
if ($messagesCount < self::MESSAGES_LIMIT) {
105+
$details = $this->operationDetails->getDetails($bulkUuid);
106+
$text = $this->getText($details);
107+
$bulkStatus = $this->statusMapper->operationStatusToBulkSummaryStatus($bulk->getStatus());
108+
if ($bulkStatus === \Magento\Framework\Bulk\BulkSummaryInterface::IN_PROGRESS) {
109+
$text = __('%1 item(s) are currently being updated.', $details['operations_total']) . $text;
110+
}
111+
$data = [
112+
'data' => [
113+
'text' => __('Task "%1": ', $bulk->getDescription()) . $text,
114+
'severity' => \Magento\Framework\Notification\MessageInterface::SEVERITY_MAJOR,
115+
// md5() here is not for cryptographic use.
116+
// phpcs:ignore Magento2.Security.InsecureFunction
117+
'identity' => md5('bulk' . $bulkUuid),
118+
'uuid' => $bulkUuid,
119+
'status' => $bulkStatus,
120+
'created_at' => $bulk->getStartTime()
121+
]
122+
];
123+
$messagesCount++;
106124
}
107-
$data = [
108-
'data' => [
109-
'text' => __('Task "%1": ', $bulk->getDescription()) . $text,
110-
'severity' => \Magento\Framework\Notification\MessageInterface::SEVERITY_MAJOR,
111-
// md5() here is not for cryptographic use.
112-
// phpcs:ignore Magento2.Security.InsecureFunction
113-
'identity' => md5('bulk' . $bulkUuid),
114-
'uuid' => $bulkUuid,
115-
'status' => $bulkStatus,
116-
'created_at' => $bulk->getStartTime()
117-
]
118-
];
119125
$bulkMessages[] = $this->messageFactory->create($data)->toArray();
120126
}
121127
}

app/code/Magento/AsynchronousOperations/Test/Unit/Model/ResourceModel/System/Message/Collection/Synchronized/PluginTest.php

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
*/
2828
class PluginTest extends TestCase
2929
{
30+
private const MESSAGES_LIMIT = 5;
3031
/**
3132
* @var Plugin
3233
*/
@@ -163,6 +164,60 @@ public function testAfterTo($operationDetails)
163164
$this->assertEquals(2, $result2['totalRecords']);
164165
}
165166

167+
/**
168+
* Tests that message building operations don't get called more than Plugin::MESSAGES_LIMIT times
169+
*
170+
* @return void
171+
*/
172+
public function testAfterToWithMessageLimit()
173+
{
174+
$result = ['items' =>[], 'totalRecords' => 1];
175+
$messagesCount = self::MESSAGES_LIMIT + 1;
176+
$userId = 1;
177+
$bulkUuid = 2;
178+
$bulkArray = [
179+
'status' => BulkSummaryInterface::NOT_STARTED
180+
];
181+
182+
$bulkMock = $this->getMockBuilder(BulkSummary::class)
183+
->addMethods(['getStatus'])
184+
->onlyMethods(['getBulkId', 'getDescription', 'getStartTime'])
185+
->disableOriginalConstructor()
186+
->getMock();
187+
$userBulks = array_fill(0, $messagesCount, $bulkMock);
188+
$bulkMock->expects($this->exactly($messagesCount))
189+
->method('getBulkId')->willReturn($bulkUuid);
190+
$this->operationsDetailsMock
191+
->expects($this->exactly(self::MESSAGES_LIMIT))
192+
->method('getDetails')
193+
->with($bulkUuid)
194+
->willReturn([
195+
'operations_successful' => 1,
196+
'operations_failed' => 0
197+
]);
198+
$bulkMock->expects($this->exactly(self::MESSAGES_LIMIT))
199+
->method('getDescription')->willReturn('Bulk Description');
200+
$this->messagefactoryMock->expects($this->exactly($messagesCount))
201+
->method('create')->willReturn($this->messageMock);
202+
$this->messageMock->expects($this->exactly($messagesCount))->method('toArray')->willReturn($bulkArray);
203+
$this->authorizationMock
204+
->expects($this->once())
205+
->method('isAllowed')
206+
->with($this->resourceName)
207+
->willReturn(true);
208+
$this->userContextMock->expects($this->once())->method('getUserId')->willReturn($userId);
209+
$this->bulkNotificationMock
210+
->expects($this->once())
211+
->method('getAcknowledgedBulksByUser')
212+
->with($userId)
213+
->willReturn([]);
214+
$this->statusMapper->expects($this->exactly(self::MESSAGES_LIMIT))
215+
->method('operationStatusToBulkSummaryStatus');
216+
$this->bulkStatusMock->expects($this->once())->method('getBulksByUser')->willReturn($userBulks);
217+
$result2 = $this->plugin->afterToArray($this->collectionMock, $result);
218+
$this->assertEquals($result['totalRecords'] + $messagesCount, $result2['totalRecords']);
219+
}
220+
166221
/**
167222
* @return array
168223
*/

app/code/Magento/AwsS3/Test/Mftf/Test/AwsS3AdminCreateDownloadableProductWithLinkTest.xml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
<comment userInput="BIC workaround" stepKey="disableRemoteStorage"/>
3636
<magentoCLI stepKey="removeDownloadableDomain" command="downloadable:domains:remove static.magento.com"/>
3737
<!-- Delete customer -->
38+
<actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="logoutCustomer" />
3839
<deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/>
3940

4041
<!-- Delete category -->
@@ -81,7 +82,9 @@
8182

8283
<!-- Save product -->
8384
<actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/>
84-
<magentoCron stepKey="runIndexCronJobs" groups="index"/>
85+
<actionGroup ref="CliIndexerReindexActionGroup" stepKey="runIndexCronJobs">
86+
<argument name="indices" value=""/>
87+
</actionGroup>
8588

8689
<!-- Login to frontend -->
8790
<actionGroup ref="LoginToStorefrontActionGroup" stepKey="signIn">

app/code/Magento/Backend/Block/Widget/Grid/Extended.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1022,6 +1022,7 @@ public function getCsvFile()
10221022
$stream = $this->_directory->openFile($file, 'w+');
10231023

10241024
$stream->lock();
1025+
$stream->write(pack('CCC', 0xef, 0xbb, 0xbf));
10251026
$stream->writeCsv($this->_getExportHeaders());
10261027
$this->_exportIterateCollection('_exportCsvItem', [$stream]);
10271028

app/code/Magento/Backend/Model/Auth/Session.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,16 @@ public function __construct(
114114
);
115115
}
116116

117+
/**
118+
* @inheritDoc
119+
*/
120+
public function _resetState(): void
121+
{
122+
parent::_resetState();
123+
$this->_isFirstAfterLogin = null;
124+
$this->acl = null;
125+
}
126+
117127
/**
118128
* Refresh ACL resources stored in session
119129
*

app/code/Magento/Backend/Model/Session/Quote.php

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,17 @@ public function __construct(
139139
}
140140
}
141141

142+
/**
143+
* @inheritDoc
144+
*/
145+
public function _resetState(): void
146+
{
147+
parent::_resetState();
148+
$this->_quote = null;
149+
$this->_store = null;
150+
$this->_order = null;
151+
}
152+
142153
/**
143154
* Retrieve quote model object
144155
*
@@ -154,7 +165,7 @@ public function getQuote()
154165
$this->_quote->setCustomerGroupId($customerGroupId);
155166
$this->_quote->setIsActive(false);
156167
$this->_quote->setStoreId($this->getStoreId());
157-
168+
158169
$this->quoteRepository->save($this->_quote);
159170
$this->setQuoteId($this->_quote->getId());
160171
$this->_quote = $this->quoteRepository->get($this->getQuoteId(), [$this->getStoreId()]);

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,13 @@
2323
<click stepKey="resetFilters" selector="{{AdminSecondaryGridSection.resetFilters}}"/>
2424
<fillField stepKey="fillIdentifier" selector="{{searchInput}}" userInput="{{name}}"/>
2525
<click stepKey="searchForName" selector="{{AdminSecondaryGridSection.searchButton}}"/>
26+
<waitForPageLoad stepKey="waitForPageLoad" />
27+
<waitForElementClickable selector="{{AdminSecondaryGridSection.firstRow}}" stepKey="waitForResult"/>
2628
<click stepKey="clickResult" selector="{{AdminSecondaryGridSection.firstRow}}"/>
2729
<waitForPageLoad stepKey="waitForTaxRateLoad"/>
2830

2931
<!-- delete the rule -->
30-
<waitForElementVisible selector="{{AdminStoresMainActionsSection.deleteButton}}" stepKey="waitForDelete"/>
32+
<waitForElementClickable selector="{{AdminStoresMainActionsSection.deleteButton}}" stepKey="waitForDelete"/>
3133
<click stepKey="clickDelete" selector="{{AdminStoresMainActionsSection.deleteButton}}"/>
3234
<waitForElementVisible selector="{{AdminConfirmationModalSection.ok}}" stepKey="waitForConfirmationModal"/>
3335
<click stepKey="clickOk" selector="{{AdminConfirmationModalSection.ok}}"/>

app/code/Magento/Backend/Test/Mftf/Section/LocaleOptionsSection.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,8 @@
1818
<element name="defaultLocale" type="checkbox" selector="#general_locale_code_inherit"/>
1919
<element name="checkIfTabExpand" type="button" selector="#general_locale-head:not(.open)"/>
2020
<element name="timeZoneDropdown" type="select" selector="//select[@id='general_locale_timezone']"/>
21+
<element name="changeStoreConfigButton" type="button" selector="//button[@id='store-change-button']"/>
22+
<element name="changeStoreConfigToSpecificWebsite" type="select" selector="//a[contains(text(),'{{var}}')]" parameterized="true"/>
23+
<element name="changeWebsiteConfirmButton" type="button" selector="//button[@class='action-primary action-accept']/span"/>
2124
</section>
2225
</sections>

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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,9 @@
5858
<actionGroup ref="AdminDeleteStoreViewActionGroup" stepKey="deleteStoreView10">
5959
<argument name="customStore" value="storeViewData7"/>
6060
</actionGroup>
61-
<magentoCron groups="index" stepKey="reindex"/>
61+
<actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex">
62+
<argument name="indices" value=""/>
63+
</actionGroup>
6264

6365
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
6466
</after>
@@ -94,7 +96,9 @@
9496
<actionGroup ref="AdminCreateStoreViewActionGroup" stepKey="createStoreView10">
9597
<argument name="customStore" value="storeViewData7"/>
9698
</actionGroup>
97-
<magentoCron groups="index" stepKey="reindex"/>
99+
<actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex">
100+
<argument name="indices" value=""/>
101+
</actionGroup>
98102

99103
<!--Navigate to Product attribute page-->
100104
<actionGroup ref="AdminNavigateToNewProductAttributePageActionGroup" stepKey="navigateToNewProductAttributePage"/>

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

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,23 @@
1515
<title value="Admin should be able to manage settings of Email To A Friend Functionality"/>
1616
<description value="Admin should be able to enable Email To A Friend functionality in Magento Admin backend and see additional options"/>
1717
<group value="backend"/>
18-
<severity value="MINOR"></severity>
18+
<severity value="MINOR"/>
1919
<testCaseId value="MC-35895"/>
2020
<group value="pr_exclude"/>
2121
</annotations>
2222

2323
<before>
2424
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
2525
<magentoCLI stepKey="enableSendFriend" command="config:set sendfriend/email/enabled 1"/>
26-
<magentoCLI stepKey="cacheClean" command="cache:clean config"/>
26+
<actionGroup ref="CliCacheCleanActionGroup" stepKey="cacheClean">
27+
<argument name="tags" value="config"/>
28+
</actionGroup>
2729
</before>
2830
<after>
2931
<magentoCLI stepKey="disableSendFriend" command="config:set sendfriend/email/enabled 0"/>
30-
<magentoCLI stepKey="cacheClean" command="cache:clean config"/>
32+
<actionGroup ref="CliCacheCleanActionGroup" stepKey="cacheClean">
33+
<argument name="tags" value="config"/>
34+
</actionGroup>
3135
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
3236
</after>
3337

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@
5151
<argument name="tags" value="config full_page"/>
5252
</actionGroup>
5353
<deleteData createDataKey="createProduct" stepKey="deleteProduct"/>
54+
<actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="logoutCustomer" />
5455
<deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/>
5556
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
5657
</after>

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
<group value="backend"/>
2121
<skip>
2222
<issueId value="DEPRECATED">Use AdminCheckDashboardWithChartsTest instead</issueId>
23-
</skip>
23+
</skip>
2424
<group value="pr_exclude"/>
2525
</annotations>
2626
<before>
@@ -32,14 +32,17 @@
3232
<field key="firstname">John1</field>
3333
<field key="lastname">Doe1</field>
3434
</createData>
35-
<magentoCron stepKey="runCronIndex" groups="index"/>
35+
<actionGroup ref="CliIndexerReindexActionGroup" stepKey="runCronIndex">
36+
<argument name="indices" value=""/>
37+
</actionGroup>
3638
</before>
3739
<after>
3840
<!-- Reset admin order filter -->
3941
<comment userInput="Reset admin order filter" stepKey="resetAdminOrderFilter"/>
4042
<actionGroup ref="AdminOrdersGridClearFiltersActionGroup" stepKey="clearOrderFilters"/>
4143
<magentoCLI command="config:set admin/dashboard/enable_charts 0" stepKey="setDisableChartsAsDefault"/>
4244
<deleteData createDataKey="createProduct" stepKey="deleteProduct"/>
45+
<actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="logoutCustomer" />
4346
<deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/>
4447
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
4548
</after>

0 commit comments

Comments
 (0)