Skip to content

Commit d6d3a52

Browse files
authored
Merge branch '2.4-develop' into introducing-generic-types-in-docblocks-for-improved-static-analysis
2 parents f815154 + fe72c40 commit d6d3a52

File tree

207 files changed

+4111
-806
lines changed

Some content is hidden

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

207 files changed

+4111
-806
lines changed

app/code/Magento/AsynchronousOperations/Controller/Adminhtml/Index/Index.php

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,23 @@
66

77
namespace Magento\AsynchronousOperations\Controller\Adminhtml\Index;
88

9-
class Index extends \Magento\Backend\App\Action
9+
use Magento\Backend\App\Action;
10+
use Magento\Backend\App\Action\Context;
11+
use Magento\Framework\App\Action\HttpGetActionInterface;
12+
use Magento\Framework\View\Result\Page;
13+
use Magento\Framework\View\Result\PageFactory;
14+
15+
class Index extends Action implements HttpGetActionInterface
1016
{
1117
/**
1218
* Authorization level of a basic admin session
1319
*
1420
* @see _isAllowed()
1521
*/
16-
const ADMIN_RESOURCE = 'Magento_Logging::system_magento_logging_bulk_operations';
22+
public const ADMIN_RESOURCE = 'Magento_Logging::system_magento_logging_bulk_operations';
1723

1824
/**
19-
* @var \Magento\Framework\View\Result\PageFactory
25+
* @var PageFactory
2026
*/
2127
private $resultPageFactory;
2228

@@ -26,33 +32,24 @@ class Index extends \Magento\Backend\App\Action
2632
private $menuId;
2733

2834
/**
29-
* Details constructor.
30-
* @param \Magento\Backend\App\Action\Context $context
31-
* @param \Magento\Framework\View\Result\PageFactory $resultPageFactory
35+
* @param Context $context
36+
* @param PageFactory $resultPageFactory
3237
* @param string $menuId
3338
*/
3439
public function __construct(
35-
\Magento\Backend\App\Action\Context $context,
36-
\Magento\Framework\View\Result\PageFactory $resultPageFactory,
40+
Context $context,
41+
PageFactory $resultPageFactory,
3742
$menuId = 'Magento_AsynchronousOperations::system_magento_logging_bulk_operations'
3843
) {
3944
$this->resultPageFactory = $resultPageFactory;
4045
$this->menuId = $menuId;
4146
parent::__construct($context);
4247
}
4348

44-
/**
45-
* @inheritDoc
46-
*/
47-
protected function _isAllowed()
48-
{
49-
return parent::_isAllowed();
50-
}
51-
5249
/**
5350
* Bulk list action
5451
*
55-
* @return \Magento\Framework\View\Result\Page
52+
* @return Page
5653
*/
5754
public function execute()
5855
{
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright 2025 Adobe
5+
* All Rights Reserved.
6+
*/
7+
-->
8+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
10+
<actionGroup name="AdminCreateCustomConditionWithMultipleSelectInCartPriceRuleActionGroup" extends="AdminCreateCustomConditionInCartPriceRuleActionGroup">
11+
<annotations>
12+
<description>Create custom condition in action tab in cart price rule</description>
13+
</annotations>
14+
<arguments>
15+
<argument name="productAttributeOption" type="string" defaultValue="{{productAttributeColour.black}}"/>
16+
</arguments>
17+
<remove keyForRemoval="fillCategoryId"/>
18+
<selectOption selector="{{AdminCartPriceRulesFormSection.ruleFieldByIndex('1--1--1')}}" userInput="{{productAttributeOption}}" stepKey="selectProductAttributeValue"/>
19+
</actionGroup>
20+
</actionGroups>

app/code/Magento/Backend/Test/Mftf/Data/BackenedData.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,8 @@
1414
<entity name="WebdriverKey">
1515
<data key="tabKey">[\Facebook\WebDriver\WebDriverKeys::TAB]</data>
1616
</entity>
17+
<entity name="productAttributeColour" type="productAttribute">
18+
<data key="gold">gold</data>
19+
<data key="black">black</data>
20+
</entity>
1721
</entities>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright 2025 Adobe
5+
* All Rights Reserved.
6+
*/
7+
-->
8+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
10+
<test name="AdminProductAttributeAdminValuesUsedInsteadOfDefaultValueTest">
11+
<annotations>
12+
<features value="Backend"/>
13+
<stories value="Product attribute admin values should be used in backend"/>
14+
<title value="Product attribute admin values should be used instead of default store view values in backend"/>
15+
<description value="Verify that product attribute admin values should be used in cart price rule instead of default store view values in backend"/>
16+
<testCaseId value="AC-13048"/>
17+
<severity value="MINOR"/>
18+
<group value="backend"/>
19+
</annotations>
20+
<before>
21+
<createData entity="productAttributeMultiselectTwoOptions" stepKey="createColourProductAttribute"/>
22+
</before>
23+
<after>
24+
<!-- Delete cart price rule -->
25+
<actionGroup ref="DeleteCartPriceRuleByName" stepKey="deleteCartPriceRule">
26+
<argument name="ruleName" value="{{CustomSalesRuleWithNoCouponCode.name}}"/>
27+
</actionGroup>
28+
<!-- Delete attribute -->
29+
<actionGroup ref="NavigateToCreatedProductAttributeActionGroup" stepKey="openAttributeFromGrid">
30+
<argument name="ProductAttribute" value="$$createColourProductAttribute$$"/>
31+
</actionGroup>
32+
<actionGroup ref="DeleteProductAttributeByAttributeCodeActionGroup" stepKey="deleteProductAttribute"/>
33+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
34+
</after>
35+
<!-- Login as admin -->
36+
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
37+
<!--Step-1 Set Admin value & Default store view value in product attribute & Save the product -->
38+
<actionGroup ref="AdminOpenProductAttributePageActionGroup" stepKey="goToProductAttributes"/>
39+
<actionGroup ref="NavigateToCreatedProductAttributeActionGroup" stepKey="openAttributeFromGrid">
40+
<argument name="ProductAttribute" value="$$createColourProductAttribute$$"/>
41+
</actionGroup>
42+
<fillField selector="{{AttributePropertiesSection.DefaultLabel}}" userInput="$$createColourProductAttribute.attribute_code$$" stepKey="fillDefaultLabel"/>
43+
<actionGroup ref="CreateAttributeDropdownNthOptionActionGroup" stepKey="createColourOptionWhichAsDifferentValuesInAdminAndDefaultStoreView">
44+
<argument name="adminName" value="{{productAttributeColour.black}}"/>
45+
<argument name="frontName" value="{{productAttributeColour.gold}}"/>
46+
<argument name="row" value="1"/>
47+
</actionGroup>
48+
<actionGroup ref="AdminSaveProductAttributeActionGroup" stepKey="saveMultiSelectAttribute"/>
49+
<!-- Product Attribute added to default Attribute set -->
50+
<actionGroup ref="AdminOpenAttributeSetGridPageActionGroup" stepKey="openAttributeSetPage"/>
51+
<actionGroup ref="AdminOpenAttributeSetByNameActionGroup" stepKey="openDefaultAttributeSet"/>
52+
<actionGroup ref="AssignAttributeToGroupActionGroup" stepKey="assignAttributeToGroup">
53+
<argument name="group" value="Product Details"/>
54+
<argument name="attribute" value="$$createColourProductAttribute.attribute_code$$"/>
55+
</actionGroup>
56+
<actionGroup ref="SaveAttributeSetActionGroup" stepKey="saveAttributeSet"/>
57+
<!--Step 2: Create cart price rule with custom condition and verify admin value is displayed under product attribute combination -->
58+
<actionGroup ref="AdminCreateCartPriceRuleActionGroup" stepKey="createCartPriceRule">
59+
<argument name="ruleName" value="CustomSalesRuleWithNoCouponCode"/>
60+
</actionGroup>
61+
<actionGroup ref="AdminFilterCartPriceRuleActionGroup" stepKey="filterCreatedCartPriceRule">
62+
<argument name="ruleName" value="CustomSalesRuleWithNoCouponCode.name"/>
63+
</actionGroup>
64+
<actionGroup ref="AdminCreateCustomConditionWithMultipleSelectInCartPriceRuleActionGroup" stepKey="createProductAttributeCombinationCondition">
65+
<argument name="productAttribute" value="$$createColourProductAttribute.attribute_code$$"/>
66+
</actionGroup>
67+
<waitForText selector="{{AdminCartPriceRulesFormSection.ruleFieldByIndex('1--1--1')}}" userInput="{{productAttributeColour.black}}" stepKey="verifyAdminValueIsVisibleInTheConditionInsteadOfDefaultStoreViewValue"/>
68+
<dontSee selector="{{AdminCartPriceRulesFormSection.ruleFieldByIndex('1--1--1')}}" userInput="{{productAttributeColour.gold}}" stepKey="verifyDefaultStoreViewValueIsNotVisible"/>
69+
<actionGroup ref="AssertCartPriceRuleSuccessSaveMessageActionGroup" stepKey="saveAndAssertCartPriceRuleSuccessSaveMessage"/>
70+
</test>
71+
</tests>

app/code/Magento/Backup/Block/Adminhtml/Backup.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,18 @@
1111
* Adminhtml backup page content block
1212
*
1313
* @api
14-
* @author Magento Core Team <[email protected]>
1514
* @since 100.0.2
1615
*/
1716
class Backup extends \Magento\Backend\Block\Template
1817
{
1918
/**
20-
* Block's template
21-
*
2219
* @var string
2320
*/
2421
protected $_template = 'Magento_Backup::backup/list.phtml';
2522

2623
/**
24+
* Prepare the layout
25+
*
2726
* @return AbstractBlock|void
2827
*/
2928
protected function _prepareLayout()
@@ -62,6 +61,8 @@ protected function _prepareLayout()
6261
}
6362

6463
/**
64+
* Return HTML for the backups grid
65+
*
6566
* @return string
6667
*/
6768
public function getGridHtml()

app/code/Magento/Backup/Block/Adminhtml/Grid/Column/Renderer/Download.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66

77
/**
88
* Backup grid item renderer
9-
*
10-
* @author Magento Core Team <[email protected]>
119
*/
1210
namespace Magento\Backup\Block\Adminhtml\Grid\Column\Renderer;
1311

app/code/Magento/Backup/Block/Adminhtml/Grid/Column/Rollback.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66

77
/**
88
* Grid column block that is displayed only if rollback allowed
9-
*
10-
* @author Magento Core Team <[email protected]>
119
*/
1210
namespace Magento\Backup\Block\Adminhtml\Grid\Column;
1311

app/code/Magento/Backup/Controller/Adminhtml/Index.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
/**
1313
* Backup admin controller
1414
*
15-
* @author Magento Core Team <[email protected]>
15+
* @phpcs:ignore Magento2.Classes.AbstractApi.AbstractApi
1616
* @api
1717
* @since 100.0.2
1818
* @SuppressWarnings(PHPMD.AllPurposeAction)
@@ -24,11 +24,9 @@ abstract class Index extends Action
2424
*
2525
* @see _isAllowed()
2626
*/
27-
const ADMIN_RESOURCE = 'Magento_Backup::backup';
27+
public const ADMIN_RESOURCE = 'Magento_Backup::backup';
2828

2929
/**
30-
* Core registry
31-
*
3230
* @var \Magento\Framework\Registry
3331
*/
3432
protected $_coreRegistry = null;

app/code/Magento/Backup/Model/Config/Source/Type.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,12 @@
88
/**
99
* Backups types' source model for system configuration
1010
*
11-
* @author Magento Core Team <[email protected]>
1211
* @api
1312
* @since 100.0.2
1413
*/
1514
class Type implements \Magento\Framework\Option\ArrayInterface
1615
{
1716
/**
18-
* Backup data
19-
*
2017
* @var \Magento\Backup\Helper\Data
2118
*/
2219
protected $_backupData = null;
@@ -30,7 +27,7 @@ public function __construct(\Magento\Backup\Helper\Data $backupData)
3027
}
3128

3229
/**
33-
* {@inheritdoc}
30+
* @inheritDoc
3431
*/
3532
public function toOptionArray()
3633
{

app/code/Magento/Backup/Model/Grid/Options.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,11 @@
44
* All Rights Reserved.
55
*/
66

7-
/**
8-
* Backup types option array
9-
*
10-
* @author Magento Core Team <[email protected]>
11-
*/
127
namespace Magento\Backup\Model\Grid;
138

149
/**
10+
* Backup types option array
11+
*
1512
* @api
1613
* @since 100.0.2
1714
*/
@@ -32,6 +29,7 @@ public function __construct(\Magento\Backup\Helper\Data $backupHelper)
3229

3330
/**
3431
* Return backup types array
32+
*
3533
* @return array
3634
*/
3735
public function toOptionArray()

0 commit comments

Comments
 (0)