Skip to content

Commit 305406a

Browse files
merge magento/2.4-develop into magento-tsg/2.4-develop-com-int-improve-pr2
2 parents f036380 + c43d763 commit 305406a

File tree

56 files changed

+552
-184
lines changed

Some content is hidden

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

56 files changed

+552
-184
lines changed

app/code/Magento/Catalog/Model/FilterProductCustomAttribute.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,21 @@
88
namespace Magento\Catalog\Model;
99

1010
/**
11-
* Filter custom attributes for product using the blacklist
11+
* Filter custom attributes for product using the excluded list
1212
*/
1313
class FilterProductCustomAttribute
1414
{
1515
/**
1616
* @var array
1717
*/
18-
private $blackList;
18+
private $excludedList;
1919

2020
/**
21-
* @param array $blackList
21+
* @param array $excludedList
2222
*/
23-
public function __construct(array $blackList = [])
23+
public function __construct(array $excludedList = [])
2424
{
25-
$this->blackList = $blackList;
25+
$this->excludedList = $excludedList;
2626
}
2727

2828
/**
@@ -33,6 +33,6 @@ public function __construct(array $blackList = [])
3333
*/
3434
public function execute(array $attributes): array
3535
{
36-
return array_diff_key($attributes, array_flip($this->blackList));
36+
return array_diff_key($attributes, array_flip($this->excludedList));
3737
}
3838
}

app/code/Magento/Catalog/Test/Mftf/Test/StorefrontCheckNoAppearDefaultOptionConfigurableProductTest.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
<title value="Check for Configurable Product the default option doesn't appear."/>
1515
<description value="Check for Configurable Product the default option doesn't appear on the list options product when an option use."/>
1616
<testCaseId value="MC-35074"/>
17+
<severity value="CRITICAL"/>
1718
</annotations>
1819
<before>
1920
<createData entity="ApiCategory" stepKey="createCategory"/>

app/code/Magento/CatalogInventory/etc/di.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
</type>
3838
<type name="Magento\Catalog\Model\FilterProductCustomAttribute">
3939
<arguments>
40-
<argument name="blackList" xsi:type="array">
40+
<argument name="excludedList" xsi:type="array">
4141
<item name="quantity_and_stock_status" xsi:type="string">quantity_and_stock_status</item>
4242
</argument>
4343
</arguments>

app/code/Magento/Checkout/Test/Mftf/ActionGroup/AssertStorefronElementVisibleActionGroup.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@
1616
<argument name="selector" type="string"/>
1717
<argument name="userInput" type="string"/>
1818
</arguments>
19-
19+
20+
<waitForElementVisible selector="{{selector}}" time="60" stepKey="waitForElementVisible"/>
2021
<see selector="{{selector}}" userInput="{{userInput}}" stepKey="assertElement"/>
2122
</actionGroup>
2223
</actionGroups>

app/code/Magento/Checkout/Test/Mftf/ActionGroup/AssertStorefrontCheckoutCartItemsActionGroup.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
<argument name="qty" type="string"/>
2020
</arguments>
2121

22+
<waitForElementVisible selector="{{CheckoutCartProductSection.productName}}" time="60" stepKey="waitForProductNameVisible"/>
2223
<see selector="{{CheckoutCartProductSection.productName}}" userInput="{{productName}}" stepKey="seeProductNameInCheckoutSummary"/>
2324
<see selector="{{CheckoutCartProductSection.ProductPriceByName(productName)}}" userInput="{{productPrice}}" stepKey="seeProductPriceInCart"/>
2425
<see selector="{{CheckoutCartProductSection.productSubtotalByName(productName)}}" userInput="{{subtotal}}" stepKey="seeSubtotalPrice"/>

app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddBundleDynamicProductToShoppingCartTest.xml

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
1010
<test name="StorefrontAddBundleDynamicProductToShoppingCartTest">
1111
<annotations>
12+
<features value="Checkout"/>
1213
<stories value="Shopping Cart"/>
1314
<title value="Add bundle dynamic product to the cart"/>
1415
<description value="Add bundle dynamic product to the cart"/>
@@ -18,6 +19,7 @@
1819
</annotations>
1920

2021
<before>
22+
<magentoCLI command="config:set {{DisableFreeShippingConfigData.path}} {{DisableFreeShippingConfigData.value}}" stepKey="disableFreeShipping"/>
2123
<magentoCLI command="config:set {{EnableFlatRateConfigData.path}} {{EnableFlatRateConfigData.value}}" stepKey="enableFlatRate"/>
2224
<magentoCLI command="config:set {{EnableFlatRateDefaultPriceConfigData.path}} {{EnableFlatRateDefaultPriceConfigData.value}}" stepKey="enableFlatRateDefaultPrice"/>
2325
<createData entity="SimpleSubCategory" stepKey="createSubCategory"/>
@@ -46,19 +48,23 @@
4648
<requiredEntity createDataKey="createBundleOption1_1"/>
4749
<requiredEntity createDataKey="simpleProduct2"/>
4850
</createData>
49-
<magentoCLI command="indexer:reindex" stepKey="reindex"/>
50-
<magentoCLI command="cache:flush" stepKey="flushCache"/>
51+
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
52+
<actionGroup ref="AdminCartPriceRuleDeleteAllActionGroup" stepKey="deleteAllRules"/>
53+
<actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex">
54+
<argument name="indices" value="cataloginventory_stock"/>
55+
</actionGroup>
5156
</before>
5257
<after>
5358
<deleteData createDataKey="simpleProduct1" stepKey="deleteProduct1"/>
5459
<deleteData createDataKey="simpleProduct2" stepKey="deleteProduct2"/>
5560
<deleteData createDataKey="createBundleProduct" stepKey="deleteBundleProduct"/>
5661
<deleteData createDataKey="createSubCategory" stepKey="deleteCategory"/>
62+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logoutAsAdmin"/>
5763
</after>
5864

5965
<!--Open Product page in StoreFront -->
6066
<actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="openProductPageAndVerifyProduct">
61-
<argument name="product" value="$$createBundleProduct$$"/>
67+
<argument name="product" value="$createBundleProduct$"/>
6268
</actionGroup>
6369

6470
<!--Assert Product Price Range -->
@@ -93,8 +99,8 @@
9399

94100
<!--Assert Product items in cart -->
95101
<actionGroup ref="AssertStorefrontCheckoutCartItemsActionGroup" stepKey="assertSimpleProduct1ItemsInCheckOutCart">
96-
<argument name="productName" value="$$createBundleProduct.name$$"/>
97-
<argument name="productSku" value="$$createBundleProduct.sku$$"/>
102+
<argument name="productName" value="$createBundleProduct.name$"/>
103+
<argument name="productSku" value="$createBundleProduct.sku$"/>
98104
<argument name="productPrice" value="$50.00"/>
99105
<argument name="subtotal" value="$100.00" />
100106
<argument name="qty" value="2"/>
@@ -107,13 +113,13 @@
107113
</actionGroup>
108114
<actionGroup ref="AssertStorefrontElementVisibleActionGroup" stepKey="seeProductOptionInCart">
109115
<argument name="selector" value="{{CheckoutCartProductSection.productOptionLabel}}"/>
110-
<argument name="userInput" value="1 x $$simpleProduct2.name$$ $50.00"/>
116+
<argument name="userInput" value="1 x $simpleProduct2.name$ $50.00"/>
111117
</actionGroup>
112118

113119
<!-- Assert Product in Mini Cart -->
114120
<actionGroup ref="StorefrontClickOnMiniCartActionGroup" stepKey="clickOnMiniCart"/>
115121
<actionGroup ref="AssertStorefrontMiniCartItemsActionGroup" stepKey="assertSimpleProduct3MiniCart">
116-
<argument name="productName" value="$$createBundleProduct.name$$"/>
122+
<argument name="productName" value="$createBundleProduct.name$"/>
117123
<argument name="productPrice" value="$50.00"/>
118124
<argument name="cartSubtotal" value="$100.00" />
119125
<argument name="qty" value="2"/>

app/code/Magento/Customer/Test/Mftf/ActionGroup/CreateCustomerOrderActionGroup.xml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,6 @@
1212
<annotations>
1313
<description>Create Order via API assigned to Customer.</description>
1414
</annotations>
15-
<arguments>
16-
<argument name="Customer" />
17-
<argument name="Product" />
18-
</arguments>
1915

2016
<createData entity="CustomerCart" stepKey="CustomerCart">
2117
<requiredEntity createDataKey="Customer"/>

app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithInvalidDomainLinkUrlTest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
<argument name="link" value="downloadableLink"/>
3838
<argument name="index" value="0"/>
3939
</actionGroup>
40-
<actionGroup ref="SaveProductFormActionGroup" stepKey="saveProductAfterAddingDomainToWhitelist" after="addDownloadableProductLinkAgain" />
40+
<actionGroup ref="SaveProductFormActionGroup" stepKey="saveProductAfterAddingDomainToAllowlist" after="addDownloadableProductLinkAgain" />
4141
<scrollTo selector="{{StorefrontDownloadableProductSection.downloadableLinkByTitle(downloadableLink.title)}}" stepKey="scrollToLinks"/>
4242
<click selector="{{StorefrontDownloadableProductSection.downloadableLinkByTitle(downloadableLink.title)}}" stepKey="selectProductLink"/>
4343
<see selector="{{CheckoutCartProductSection.ProductPriceByName(DownloadableProduct.name)}}" userInput="$52.99" stepKey="assertProductPriceInCart"/>

app/code/Magento/Eav/Model/Validator/Attribute/Data.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@ class Data extends \Magento\Framework\Validator\AbstractValidator
2323
/**
2424
* @var array
2525
*/
26-
protected $_attributesWhiteList = [];
26+
protected $allowedAttributesList = [];
2727

2828
/**
2929
* @var array
3030
*/
31-
protected $_attributesBlackList = [];
31+
protected $deniedAttributesList = [];
3232

3333
/**
3434
* @var array
@@ -68,9 +68,9 @@ public function setAttributes(array $attributes)
6868
* @param array $attributesCodes
6969
* @return $this
7070
*/
71-
public function setAttributesWhiteList(array $attributesCodes)
71+
public function setAllowedAttributesList(array $attributesCodes)
7272
{
73-
$this->_attributesWhiteList = $attributesCodes;
73+
$this->allowedAttributesList = $attributesCodes;
7474
return $this;
7575
}
7676

@@ -82,9 +82,9 @@ public function setAttributesWhiteList(array $attributesCodes)
8282
* @param array $attributesCodes
8383
* @return $this
8484
*/
85-
public function setAttributesBlackList(array $attributesCodes)
85+
public function setDeniedAttributesList(array $attributesCodes)
8686
{
87-
$this->_attributesBlackList = $attributesCodes;
87+
$this->deniedAttributesList = $attributesCodes;
8888
return $this;
8989
}
9090

@@ -171,11 +171,11 @@ protected function _getAttributes($entity)
171171
$attributesCodes[] = $attributeCode;
172172
}
173173

174-
$ignoreAttributes = $this->_attributesBlackList;
175-
if ($this->_attributesWhiteList) {
174+
$ignoreAttributes = $this->deniedAttributesList;
175+
if ($this->allowedAttributesList) {
176176
$ignoreAttributes = array_merge(
177177
$ignoreAttributes,
178-
array_diff($attributesCodes, $this->_attributesWhiteList)
178+
array_diff($attributesCodes, $this->allowedAttributesList)
179179
);
180180
}
181181

app/code/Magento/Eav/Test/Unit/Model/Validator/Attribute/DataTest.php

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -249,10 +249,10 @@ public function testIsValidAttributesFromCollection()
249249
}
250250

251251
/**
252-
* @dataProvider whiteBlackListProvider
252+
* @dataProvider allowDenyListProvider
253253
* @param callable $callback
254254
*/
255-
public function testIsValidBlackListWhiteListChecks($callback)
255+
public function testIsValidExclusionInclusionListChecks($callback)
256256
{
257257
$attribute = $this->_getAttributeMock(
258258
[
@@ -302,19 +302,19 @@ public function testIsValidBlackListWhiteListChecks($callback)
302302
/**
303303
* @return array
304304
*/
305-
public function whiteBlackListProvider()
305+
public function allowDenyListProvider()
306306
{
307-
$whiteCallback = function ($validator) {
308-
$validator->setAttributesWhiteList(['attribute']);
307+
$allowedCallbackList = function ($validator) {
308+
$validator->setAllowedAttributesList(['attribute']);
309309
};
310310

311-
$blackCallback = function ($validator) {
312-
$validator->setAttributesBlackList(['attribute2']);
311+
$deniedCallbackList = function ($validator) {
312+
$validator->setDeniedAttributesList(['attribute2']);
313313
};
314-
return ['white_list' => [$whiteCallback], 'black_list' => [$blackCallback]];
314+
return ['allowed' => [$allowedCallbackList], 'denied' => [$deniedCallbackList]];
315315
}
316316

317-
public function testSetAttributesWhiteList()
317+
public function testSetAttributesAllowedList()
318318
{
319319
$this->markTestSkipped('Skipped in #27500 due to testing protected/private methods and properties');
320320

@@ -328,12 +328,14 @@ public function testSetAttributesWhiteList()
328328
)
329329
->getMock();
330330
$validator = new Data($attrDataFactory);
331-
$result = $validator->setAttributesWhiteList($attributes);
332-
$this->assertAttributeEquals($attributes, '_attributesWhiteList', $validator);
331+
$result = $validator->setIncludedAttributesList($attributes);
332+
333+
// phpstan:ignore
334+
$this->assertAttributeEquals($attributes, '_attributesAllowed', $validator);
333335
$this->assertEquals($validator, $result);
334336
}
335337

336-
public function testSetAttributesBlackList()
338+
public function testSetAttributesDeniedList()
337339
{
338340
$this->markTestSkipped('Skipped in #27500 due to testing protected/private methods and properties');
339341

@@ -347,8 +349,9 @@ public function testSetAttributesBlackList()
347349
)
348350
->getMock();
349351
$validator = new Data($attrDataFactory);
350-
$result = $validator->setAttributesBlackList($attributes);
351-
$this->assertAttributeEquals($attributes, '_attributesBlackList', $validator);
352+
$result = $validator->setDeniedAttributesList($attributes);
353+
// phpstan:ignore
354+
$this->assertAttributeEquals($attributes, '_attributesDenied', $validator);
352355
$this->assertEquals($validator, $result);
353356
}
354357

0 commit comments

Comments
 (0)