Skip to content

Commit 478f438

Browse files
committed
Merge remote-tracking branch 'origin/2.3-develop' into 387-test-coverage-cms-page
2 parents d7b7a2e + c56341c commit 478f438

File tree

330 files changed

+10467
-595
lines changed

Some content is hidden

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

330 files changed

+10467
-595
lines changed

app/code/Magento/Backend/Block/Store/Switcher.php

Lines changed: 46 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class Switcher extends \Magento\Backend\Block\Template
1717
/**
1818
* URL for store switcher hint
1919
*/
20-
const HINT_URL = 'http://docs.magento.com/m2/ce/user_guide/configuration/scope.html';
20+
const HINT_URL = 'https://docs.magento.com/m2/ce/user_guide/configuration/scope.html';
2121

2222
/**
2323
* Name of website variable
@@ -86,6 +86,8 @@ class Switcher extends \Magento\Backend\Block\Template
8686
protected $_storeFactory;
8787

8888
/**
89+
* Switcher constructor.
90+
*
8991
* @param \Magento\Backend\Block\Template\Context $context
9092
* @param \Magento\Store\Model\WebsiteFactory $websiteFactory
9193
* @param \Magento\Store\Model\GroupFactory $storeGroupFactory
@@ -106,7 +108,7 @@ public function __construct(
106108
}
107109

108110
/**
109-
* @return void
111+
* @inheritdoc
110112
*/
111113
protected function _construct()
112114
{
@@ -130,6 +132,8 @@ protected function _construct()
130132
}
131133

132134
/**
135+
* Get website collection.
136+
*
133137
* @return \Magento\Store\Model\ResourceModel\Website\Collection
134138
*/
135139
public function getWebsiteCollection()
@@ -169,6 +173,8 @@ public function isWebsiteSwitchEnabled()
169173
}
170174

171175
/**
176+
* Set website variable name.
177+
*
172178
* @param string $varName
173179
* @return $this
174180
*/
@@ -179,6 +185,8 @@ public function setWebsiteVarName($varName)
179185
}
180186

181187
/**
188+
* Get website variable name.
189+
*
182190
* @return string
183191
*/
184192
public function getWebsiteVarName()
@@ -191,6 +199,8 @@ public function getWebsiteVarName()
191199
}
192200

193201
/**
202+
* Check if current website selected.
203+
*
194204
* @param \Magento\Store\Model\Website $website
195205
* @return bool
196206
*/
@@ -200,6 +210,8 @@ public function isWebsiteSelected(\Magento\Store\Model\Website $website)
200210
}
201211

202212
/**
213+
* Return website Id.
214+
*
203215
* @return int|null
204216
*/
205217
public function getWebsiteId()
@@ -211,6 +223,8 @@ public function getWebsiteId()
211223
}
212224

213225
/**
226+
* Return group collection provided website.
227+
*
214228
* @param int|\Magento\Store\Model\Website $website
215229
* @return \Magento\Store\Model\ResourceModel\Group\Collection
216230
*/
@@ -247,6 +261,8 @@ public function isStoreGroupSwitchEnabled()
247261
}
248262

249263
/**
264+
* Sets store group variable name.
265+
*
250266
* @param string $varName
251267
* @return $this
252268
*/
@@ -257,6 +273,8 @@ public function setStoreGroupVarName($varName)
257273
}
258274

259275
/**
276+
* Return store group variable name.
277+
*
260278
* @return string
261279
*/
262280
public function getStoreGroupVarName()
@@ -269,6 +287,8 @@ public function getStoreGroupVarName()
269287
}
270288

271289
/**
290+
* Is provided group selected.
291+
*
272292
* @param \Magento\Store\Model\Group $group
273293
* @return bool
274294
*/
@@ -278,6 +298,8 @@ public function isStoreGroupSelected(\Magento\Store\Model\Group $group)
278298
}
279299

280300
/**
301+
* Return store group Id.
302+
*
281303
* @return int|null
282304
*/
283305
public function getStoreGroupId()
@@ -289,6 +311,8 @@ public function getStoreGroupId()
289311
}
290312

291313
/**
314+
* Return store collection.
315+
*
292316
* @param \Magento\Store\Model\Group|int $group
293317
* @return \Magento\Store\Model\ResourceModel\Store\Collection
294318
*/
@@ -328,6 +352,8 @@ public function getStores($group)
328352
}
329353

330354
/**
355+
* Return store Id.
356+
*
331357
* @return int|null
332358
*/
333359
public function getStoreId()
@@ -339,6 +365,8 @@ public function getStoreId()
339365
}
340366

341367
/**
368+
* Check is provided store selected.
369+
*
342370
* @param \Magento\Store\Model\Store $store
343371
* @return bool
344372
*/
@@ -358,6 +386,8 @@ public function isStoreSwitchEnabled()
358386
}
359387

360388
/**
389+
* Sets store variable name.
390+
*
361391
* @param string $varName
362392
* @return $this
363393
*/
@@ -368,6 +398,8 @@ public function setStoreVarName($varName)
368398
}
369399

370400
/**
401+
* Return store variable name.
402+
*
371403
* @return mixed|string
372404
*/
373405
public function getStoreVarName()
@@ -380,6 +412,8 @@ public function getStoreVarName()
380412
}
381413

382414
/**
415+
* Return switch url.
416+
*
383417
* @return string
384418
*/
385419
public function getSwitchUrl()
@@ -399,6 +433,8 @@ public function getSwitchUrl()
399433
}
400434

401435
/**
436+
* Checks if scope selected.
437+
*
402438
* @return bool
403439
*/
404440
public function hasScopeSelected()
@@ -472,6 +508,8 @@ public function getCurrentStoreName()
472508
}
473509

474510
/**
511+
* Sets store ids.
512+
*
475513
* @param array $storeIds
476514
* @return $this
477515
*/
@@ -482,6 +520,8 @@ public function setStoreIds($storeIds)
482520
}
483521

484522
/**
523+
* Return store ids.
524+
*
485525
* @return array
486526
*/
487527
public function getStoreIds()
@@ -490,6 +530,8 @@ public function getStoreIds()
490530
}
491531

492532
/**
533+
* Check if system is run in the single store mode.
534+
*
493535
* @return bool
494536
*/
495537
public function isShow()
@@ -498,6 +540,8 @@ public function isShow()
498540
}
499541

500542
/**
543+
* Render block.
544+
*
501545
* @return string
502546
*/
503547
protected function _toHtml()

app/code/Magento/Braintree/etc/adminhtml/system.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
</requires>
4242
</field>
4343
<group id="configuration_details" showInDefault="1" showInWebsite="1" showInStore="1" sortOrder="4">
44-
<comment>http://docs.magento.com/m2/ce/user_guide/payment/braintree.html</comment>
44+
<comment>https://docs.magento.com/m2/ce/user_guide/payment/braintree.html</comment>
4545
<frontend_model>Magento\Paypal\Block\Adminhtml\System\Config\Fieldset\Hint</frontend_model>
4646
</group>
4747
<group id="braintree_required" translate="label" showInDefault="1" showInWebsite="1" showInStore="1" sortOrder="5">
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
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="StorefrontSelectBundleProductDropDownOptionActionGroup">
12+
<arguments>
13+
<argument name="productName" type="string"/>
14+
</arguments>
15+
<click selector="{{StorefrontBundleProductActionSection.dropdownSelectOption}}" stepKey="clickOnSelectOption"/>
16+
<click selector="{{StorefrontBundleProductActionSection.dropdownProductSelection(productName)}}" stepKey="selectProduct"/>
17+
</actionGroup>
18+
</actionGroups>
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="StorefrontSelectCustomizeAndAddToTheCartButtonActionGroup">
12+
<waitForElementVisible selector="{{StorefrontBundleProductActionSection.customizeAndAddToCartButton}}" stepKey="waitForCustomizeAndAddToCartButton"/>
13+
<click selector="{{StorefrontBundleProductActionSection.customizeAndAddToCartButton}}" stepKey="clickOnCustomizeAndAddToCartButton"/>
14+
<waitForPageLoad stepKey="waitForPageLoad"/>
15+
</actionGroup>
16+
</actionGroups>

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

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,4 +91,20 @@
9191
<requiredEntity type="custom_attribute">CustomAttributeFixPrice</requiredEntity>
9292
<requiredEntity type="custom_attribute">CustomAttributePriceView</requiredEntity>
9393
</entity>
94+
<entity name="BundleProductPriceViewRange" type="product2">
95+
<data key="name" unique="suffix">BundleProduct</data>
96+
<data key="sku" unique="suffix">bundle-product</data>
97+
<data key="type_id">bundle</data>
98+
<data key="attribute_set_id">4</data>
99+
<data key="visibility">4</data>
100+
<data key="status">1</data>
101+
<data key="urlKey" unique="suffix">bundle-product</data>
102+
<requiredEntity type="product_extension_attribute">EavStockItem</requiredEntity>
103+
<requiredEntity type="custom_attribute">CustomAttributeCategoryIds</requiredEntity>
104+
<requiredEntity type="product_extension_attribute">EavStockItem</requiredEntity>
105+
<requiredEntity type="custom_attribute">ApiProductDescription</requiredEntity>
106+
<requiredEntity type="custom_attribute">ApiProductShortDescription</requiredEntity>
107+
<requiredEntity type="custom_attribute">CustomAttributeDynamicPrice</requiredEntity>
108+
<requiredEntity type="custom_attribute">CustomAttributePriceViewRange</requiredEntity>
109+
</entity>
94110
</entities>

app/code/Magento/Bundle/Test/Mftf/Section/StorefrontBundledSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,5 +37,6 @@
3737
<element name="multiselectOptionFourProducts" type="multiselect" selector="//label//span[contains(text(), '{{productName}}')]/../..//select[@multiple='multiple']" parameterized="true"/>
3838
<element name="currencyTrigger" type="select" selector="#switcher-currency-trigger" timeout="30"/>
3939
<element name="currency" type="select" selector="//a[text()='{{arg}}']" parameterized="true"/>
40+
<element name="multiSelectOption" type="select" selector="//div[@class='field option required']//select"/>
4041
</section>
4142
</sections>

app/code/Magento/Bundle/Test/Mftf/Section/StorefrontProductActionSection.xml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,10 @@
88
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
99
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
1010
<section name="StorefrontBundleProductActionSection">
11-
<element name="customizeAndAddToCartButton" type="button" selector="#bundle-slide"/>
11+
<element name="customizeAndAddToCartButton" type="button" selector="#bundle-slide" timeout="30"/>
1212
<element name="quantityField" type="input" selector="#qty"/>
13-
<element name="addToCartButton" type="button" selector="#product-addtocart-button"/>
13+
<element name="addToCartButton" type="button" selector="#product-addtocart-button" timeout="30"/>
14+
<element name="dropdownSelectOption" type="select" selector="//div[@class='control']/select"/>
15+
<element name="dropdownProductSelection" type="select" selector="//div[@class='control']/select/option[contains(.,'{{productName}}')]" parameterized="true"/>
1416
</section>
1517
</sections>

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,10 @@
1313
<features value="Bundle"/>
1414
<stories value="View bundle products"/>
1515
<title value="Check tier prices for bundle options"/>
16+
<description value="Check tier prices for bundle options"/>
1617
<testCaseId value="MAGETWO-98968"/>
1718
<useCaseId value="MAGETWO-98603"/>
19+
<severity value="AVERAGE"/>
1820
<group value="catalog"/>
1921
<group value="bundle"/>
2022
</annotations>

app/code/Magento/Catalog/Block/Product/View.php

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -169,8 +169,7 @@ public function getAddToCartUrl($product, $additional = [])
169169
}
170170

171171
/**
172-
* Get JSON encoded configuration array which can be used for JS dynamic
173-
* price calculation depending on product options
172+
* Get JSON encoded configuration which can be used for JS dynamic price calculation depending on product options
174173
*
175174
* @return string
176175
*/
@@ -262,6 +261,7 @@ public function isStartCustomization()
262261

263262
/**
264263
* Get default qty - either as preconfigured, or as 1.
264+
*
265265
* Also restricts it by minimal qty.
266266
*
267267
* @param null|\Magento\Catalog\Model\Product $product
@@ -323,10 +323,7 @@ public function getQuantityValidators()
323323
public function getIdentities()
324324
{
325325
$identities = $this->getProduct()->getIdentities();
326-
$category = $this->_coreRegistry->registry('current_category');
327-
if ($category) {
328-
$identities[] = Category::CACHE_TAG . '_' . $category->getId();
329-
}
326+
330327
return $identities;
331328
}
332329

app/code/Magento/Catalog/Model/Product/Gallery/Processor.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,7 @@ public function addImage(
157157
throw new LocalizedException(__("The image doesn't exist."));
158158
}
159159

160+
// phpcs:ignore Magento2.Functions.DiscouragedFunction
160161
$pathinfo = pathinfo($file);
161162
$imgExtensions = ['jpg', 'jpeg', 'gif', 'png'];
162163
if (!isset($pathinfo['extension']) || !in_array(strtolower($pathinfo['extension']), $imgExtensions)) {
@@ -196,7 +197,7 @@ public function addImage(
196197
$mediaGalleryData = $product->getData($attrCode);
197198
$position = 0;
198199

199-
$absoluteFilePath = $this->mediaDirectory->getAbsolutePath($file);
200+
$absoluteFilePath = $this->mediaDirectory->getAbsolutePath($destinationFile);
200201
$imageMimeType = $this->mime->getMimeType($absoluteFilePath);
201202
$imageContent = $this->mediaDirectory->readFile($absoluteFilePath);
202203
$imageBase64 = base64_encode($imageContent);
@@ -452,6 +453,7 @@ protected function getUniqueFileName($file, $forTmp = false)
452453
$destinationFile = $forTmp
453454
? $this->mediaDirectory->getAbsolutePath($this->mediaConfig->getTmpMediaPath($file))
454455
: $this->mediaDirectory->getAbsolutePath($this->mediaConfig->getMediaPath($file));
456+
// phpcs:ignore Magento2.Functions.DiscouragedFunction
455457
$destFile = dirname($file) . '/'
456458
. \Magento\MediaStorage\Model\File\Uploader::getNewFileName($destinationFile);
457459
}
@@ -494,7 +496,7 @@ protected function getNotDuplicatedFilename($fileName, $dispretionPath)
494496
/**
495497
* Retrieve data for update attribute
496498
*
497-
* @param \Magento\Catalog\Model\Product $object
499+
* @param \Magento\Catalog\Model\Product $object
498500
* @return array
499501
* @since 101.0.0
500502
*/

app/code/Magento/Catalog/Model/ResourceModel/Product/Collection.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
use Magento\Framework\DB\Select;
2020
use Magento\Framework\EntityManager\MetadataPool;
2121
use Magento\Framework\Indexer\DimensionFactory;
22-
use Magento\Framework\Model\ResourceModel\ResourceModelPoolInterface;
2322
use Magento\Store\Model\Indexer\WebsiteDimensionProvider;
2423
use Magento\Store\Model\Store;
2524

0 commit comments

Comments
 (0)