Skip to content

Commit 59d1ca7

Browse files
committed
Merge branch '2.4-develop' of https://github.com/adobe-commerce-tier-4/magento2ce into ACP2E-2791
2 parents 7a1f203 + 2ad9f14 commit 59d1ca7

File tree

85 files changed

+1752
-373
lines changed

Some content is hidden

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

85 files changed

+1752
-373
lines changed

app/code/Magento/Backend/Block/Menu.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
*/
1919
class Menu extends \Magento\Backend\Block\Template
2020
{
21-
const CACHE_TAGS = 'BACKEND_MAINMENU';
21+
public const CACHE_TAGS = 'BACKEND_MAINMENU';
2222

2323
/**
2424
* @var string
@@ -347,6 +347,11 @@ protected function _columnBrake($items, $limit)
347347
}
348348
$result[] = ['place' => $place, 'colbrake' => $colbrake];
349349
}
350+
351+
if (isset($result[1]) && $result[1]['colbrake'] === true && isset($result[2])) {
352+
$result[2]['colbrake'] = true;
353+
}
354+
350355
return $result;
351356
}
352357

app/code/Magento/Backend/Console/Command/CacheCleanCommand.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
class CacheCleanCommand extends AbstractCacheTypeManageCommand
1616
{
1717
/**
18-
* {@inheritdoc}
18+
* @inheritdoc
1919
*/
2020
protected function configure()
2121
{
@@ -32,12 +32,15 @@ protected function configure()
3232
*/
3333
protected function performAction(array $cacheTypes)
3434
{
35-
$this->eventManager->dispatch('adminhtml_cache_flush_system');
35+
if ($cacheTypes === [] || in_array('full_page', $cacheTypes)) {
36+
$this->eventManager->dispatch('adminhtml_cache_flush_system');
37+
}
38+
3639
$this->cacheManager->clean($cacheTypes);
3740
}
3841

3942
/**
40-
* {@inheritdoc}
43+
* @inheritdoc
4144
*/
4245
protected function getDisplayMessage()
4346
{

app/code/Magento/Backend/Console/Command/CacheFlushCommand.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
class CacheFlushCommand extends AbstractCacheTypeManageCommand
1616
{
1717
/**
18-
* {@inheritdoc}
18+
* @inheritdoc
1919
*/
2020
protected function configure()
2121
{
@@ -32,12 +32,15 @@ protected function configure()
3232
*/
3333
protected function performAction(array $cacheTypes)
3434
{
35-
$this->eventManager->dispatch('adminhtml_cache_flush_all');
35+
if ($cacheTypes === [] || in_array('full_page', $cacheTypes)) {
36+
$this->eventManager->dispatch('adminhtml_cache_flush_all');
37+
}
38+
3639
$this->cacheManager->flush($cacheTypes);
3740
}
3841

3942
/**
40-
* {@inheritdoc}
43+
* @inheritdoc
4144
*/
4245
protected function getDisplayMessage()
4346
{

app/code/Magento/Backend/Test/Unit/Console/Command/AbstractCacheManageCommandTest.php

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,22 @@ public function executeDataProvider()
3535
return [
3636
'implicit all' => [
3737
[],
38-
['A', 'B', 'C'],
39-
$this->getExpectedExecutionOutput(['A', 'B', 'C']),
38+
['A', 'B', 'C', 'full_page'],
39+
true,
40+
$this->getExpectedExecutionOutput(['A', 'B', 'C', 'full_page']),
4041
],
4142
'specified types' => [
4243
['types' => ['A', 'B']],
4344
['A', 'B'],
45+
false,
4446
$this->getExpectedExecutionOutput(['A', 'B']),
4547
],
48+
'fpc_only' => [
49+
['types' => ['full_page']],
50+
['full_page'],
51+
true,
52+
$this->getExpectedExecutionOutput(['full_page']),
53+
],
4654
];
4755
}
4856

app/code/Magento/Backend/Test/Unit/Console/Command/CacheCleanCommandTest.php

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,22 @@ protected function setUp(): void
2222
/**
2323
* @param array $param
2424
* @param array $types
25+
* @param bool $shouldDispatch
2526
* @param string $output
2627
* @dataProvider executeDataProvider
2728
*/
28-
public function testExecute($param, $types, $output)
29+
public function testExecute($param, $types, $shouldDispatch, $output)
2930
{
30-
$this->cacheManagerMock->expects($this->once())->method('getAvailableTypes')->willReturn(['A', 'B', 'C']);
31+
$this->cacheManagerMock->expects($this->once())->method('getAvailableTypes')->willReturn([
32+
'A', 'B', 'C', 'full_page'
33+
]);
3134
$this->cacheManagerMock->expects($this->once())->method('clean')->with($types);
32-
$this->eventManagerMock->expects($this->once())->method('dispatch')->with($this->cacheEventName);
35+
36+
if ($shouldDispatch) {
37+
$this->eventManagerMock->expects($this->once())->method('dispatch')->with($this->cacheEventName);
38+
} else {
39+
$this->eventManagerMock->expects($this->never())->method('dispatch');
40+
}
3341

3442
$commandTester = new CommandTester($this->command);
3543
$commandTester->execute($param);

app/code/Magento/Backend/Test/Unit/Console/Command/CacheFlushCommandTest.php

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,22 @@ protected function setUp(): void
2222
/**
2323
* @param array $param
2424
* @param array $types
25+
* @param bool $shouldDispatch
2526
* @param string $output
2627
* @dataProvider executeDataProvider
2728
*/
28-
public function testExecute($param, $types, $output)
29+
public function testExecute($param, $types, $shouldDispatch, $output)
2930
{
30-
$this->cacheManagerMock->expects($this->once())->method('getAvailableTypes')->willReturn(['A', 'B', 'C']);
31+
$this->cacheManagerMock->expects($this->once())->method('getAvailableTypes')->willReturn([
32+
'A', 'B', 'C', 'full_page'
33+
]);
3134
$this->cacheManagerMock->expects($this->once())->method('flush')->with($types);
32-
$this->eventManagerMock->expects($this->once())->method('dispatch')->with($this->cacheEventName);
35+
36+
if ($shouldDispatch) {
37+
$this->eventManagerMock->expects($this->once())->method('dispatch')->with($this->cacheEventName);
38+
} else {
39+
$this->eventManagerMock->expects($this->never())->method('dispatch');
40+
}
3341

3442
$commandTester = new CommandTester($this->command);
3543
$commandTester->execute($param);

app/code/Magento/Bundle/Test/Mftf/Test/AdminBundleDynamicAttributesAfterMassUpdateTest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
<argument name="consumerName" value="{{AdminProductAttributeUpdateConsumerData.consumerName}}"/>
4848
<argument name="maxMessages" value="{{AdminProductAttributeUpdateConsumerData.messageLimit}}"/>
4949
</actionGroup>
50-
<magentoCron stepKey="runCron"/>
50+
<magentoCron groups="default" stepKey="runCron"/>
5151

5252
<actionGroup ref="OpenProductForEditByClickingRowXColumnYInProductGridActionGroup" stepKey="openProductForEdit"/>
5353

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
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="AddCostPriceToProductActionGroup">
12+
<annotations>
13+
<description>Sets the provided Cost Price on the Admin Product creation/edit page.</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="price" type="string" defaultValue="10"/>
17+
</arguments>
18+
19+
<waitForPageLoad stepKey="waitForPageLoad"/>
20+
<click selector="{{AdminProductFormSection.advancedPricingLink}}" stepKey="clickAdvancedPricingLink"/>
21+
<waitForPageLoad stepKey="waitForAdvancedPricingModal"/>
22+
<waitForElementVisible selector="{{AdminProductFormCostPricingSection.costPrice}}" stepKey="waitCostPrice"/>
23+
<fillField userInput="{{price}}" selector="{{AdminProductFormCostPricingSection.costPrice}}" stepKey="fillCostPrice"/>
24+
<click selector="{{AdminProductFormAdvancedPricingSection.doneButton}}" stepKey="clickDone"/>
25+
<waitForPageLoad stepKey="waitForAdvancedPricingModalGone"/>
26+
<dontSeeElement selector="{{AdminProductFormAdvancedPricingSection.advancedPricingCloseButton}}" stepKey="clickAdvancedPricingCloseButton"/>
27+
</actionGroup>
28+
</actionGroups>

app/code/Magento/Catalog/Test/Mftf/Data/ProductData.xml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1488,4 +1488,35 @@
14881488
<data key="name">Simple Product with special characters in SKU</data>
14891489
<data key="sku">s000&amp;01</data>
14901490
</entity>
1491+
<entity name="simpleProductwithTaxNone" type="product">
1492+
<data key="name" unique="suffix">Product1</data>
1493+
<data key="sku" unique="suffix">product-1</data>
1494+
<data key="urlKey" unique="suffix">product1</data>
1495+
<data key="price">200.00</data>
1496+
<data key="quantity">100</data>
1497+
<data key="status">1</data>
1498+
<data key="cost">150.00</data>
1499+
<data key="productTaxClass">None</data>
1500+
<data key="type_id">simple</data>
1501+
<data key="attribute_set_id">4</data>
1502+
<data key="weight">1</data>
1503+
<requiredEntity type="product_extension_attribute">EavStockItem</requiredEntity>
1504+
<requiredEntity type="custom_attribute_array">CustomAttributeCategoryIds</requiredEntity>
1505+
</entity>
1506+
<entity name="simpleProductwithTaxGoods" type="product">
1507+
<data key="urlKey" unique="suffix">product2</data>
1508+
<data key="name" unique="suffix">Product2</data>
1509+
<data key="sku" unique="suffix">product-2</data>
1510+
<data key="price">300.00</data>
1511+
<data key="quantity">300</data>
1512+
<data key="status">1</data>
1513+
<data key="storefrontStatus">IN STOCK</data>
1514+
<data key="cost">250.00</data>
1515+
<data key="productTaxClass">Taxable Goods</data>
1516+
<data key="type_id">simple</data>
1517+
<data key="attribute_set_id">4</data>
1518+
<data key="weight">1</data>
1519+
<requiredEntity type="product_extension_attribute">EavStockItem</requiredEntity>
1520+
<requiredEntity type="custom_attribute_array">CustomAttributeCategoryIds</requiredEntity>
1521+
</entity>
14911522
</entities>
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+
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
10+
<section name="AdminProductFormCostPricingSection">
11+
<element name="costPrice" type="input" selector="input[name='product[cost]']"/>
12+
<element name="doneButton" type="button" selector=".product_form_product_form_advanced_pricing_modal button.action-primary" timeout="30"/>
13+
</section>
14+
</sections>

0 commit comments

Comments
 (0)