Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/2.3-develop' into 387-test-cover…
Browse files Browse the repository at this point in the history
…age-cms-page
  • Loading branch information
naydav committed May 8, 2019
2 parents d7b7a2e + c56341c commit 478f438
Show file tree
Hide file tree
Showing 330 changed files with 10,467 additions and 595 deletions.
48 changes: 46 additions & 2 deletions app/code/Magento/Backend/Block/Store/Switcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class Switcher extends \Magento\Backend\Block\Template
/**
* URL for store switcher hint
*/
const HINT_URL = 'http://docs.magento.com/m2/ce/user_guide/configuration/scope.html';
const HINT_URL = 'https://docs.magento.com/m2/ce/user_guide/configuration/scope.html';

/**
* Name of website variable
Expand Down Expand Up @@ -86,6 +86,8 @@ class Switcher extends \Magento\Backend\Block\Template
protected $_storeFactory;

/**
* Switcher constructor.
*
* @param \Magento\Backend\Block\Template\Context $context
* @param \Magento\Store\Model\WebsiteFactory $websiteFactory
* @param \Magento\Store\Model\GroupFactory $storeGroupFactory
Expand All @@ -106,7 +108,7 @@ public function __construct(
}

/**
* @return void
* @inheritdoc
*/
protected function _construct()
{
Expand All @@ -130,6 +132,8 @@ protected function _construct()
}

/**
* Get website collection.
*
* @return \Magento\Store\Model\ResourceModel\Website\Collection
*/
public function getWebsiteCollection()
Expand Down Expand Up @@ -169,6 +173,8 @@ public function isWebsiteSwitchEnabled()
}

/**
* Set website variable name.
*
* @param string $varName
* @return $this
*/
Expand All @@ -179,6 +185,8 @@ public function setWebsiteVarName($varName)
}

/**
* Get website variable name.
*
* @return string
*/
public function getWebsiteVarName()
Expand All @@ -191,6 +199,8 @@ public function getWebsiteVarName()
}

/**
* Check if current website selected.
*
* @param \Magento\Store\Model\Website $website
* @return bool
*/
Expand All @@ -200,6 +210,8 @@ public function isWebsiteSelected(\Magento\Store\Model\Website $website)
}

/**
* Return website Id.
*
* @return int|null
*/
public function getWebsiteId()
Expand All @@ -211,6 +223,8 @@ public function getWebsiteId()
}

/**
* Return group collection provided website.
*
* @param int|\Magento\Store\Model\Website $website
* @return \Magento\Store\Model\ResourceModel\Group\Collection
*/
Expand Down Expand Up @@ -247,6 +261,8 @@ public function isStoreGroupSwitchEnabled()
}

/**
* Sets store group variable name.
*
* @param string $varName
* @return $this
*/
Expand All @@ -257,6 +273,8 @@ public function setStoreGroupVarName($varName)
}

/**
* Return store group variable name.
*
* @return string
*/
public function getStoreGroupVarName()
Expand All @@ -269,6 +287,8 @@ public function getStoreGroupVarName()
}

/**
* Is provided group selected.
*
* @param \Magento\Store\Model\Group $group
* @return bool
*/
Expand All @@ -278,6 +298,8 @@ public function isStoreGroupSelected(\Magento\Store\Model\Group $group)
}

/**
* Return store group Id.
*
* @return int|null
*/
public function getStoreGroupId()
Expand All @@ -289,6 +311,8 @@ public function getStoreGroupId()
}

/**
* Return store collection.
*
* @param \Magento\Store\Model\Group|int $group
* @return \Magento\Store\Model\ResourceModel\Store\Collection
*/
Expand Down Expand Up @@ -328,6 +352,8 @@ public function getStores($group)
}

/**
* Return store Id.
*
* @return int|null
*/
public function getStoreId()
Expand All @@ -339,6 +365,8 @@ public function getStoreId()
}

/**
* Check is provided store selected.
*
* @param \Magento\Store\Model\Store $store
* @return bool
*/
Expand All @@ -358,6 +386,8 @@ public function isStoreSwitchEnabled()
}

/**
* Sets store variable name.
*
* @param string $varName
* @return $this
*/
Expand All @@ -368,6 +398,8 @@ public function setStoreVarName($varName)
}

/**
* Return store variable name.
*
* @return mixed|string
*/
public function getStoreVarName()
Expand All @@ -380,6 +412,8 @@ public function getStoreVarName()
}

/**
* Return switch url.
*
* @return string
*/
public function getSwitchUrl()
Expand All @@ -399,6 +433,8 @@ public function getSwitchUrl()
}

/**
* Checks if scope selected.
*
* @return bool
*/
public function hasScopeSelected()
Expand Down Expand Up @@ -472,6 +508,8 @@ public function getCurrentStoreName()
}

/**
* Sets store ids.
*
* @param array $storeIds
* @return $this
*/
Expand All @@ -482,6 +520,8 @@ public function setStoreIds($storeIds)
}

/**
* Return store ids.
*
* @return array
*/
public function getStoreIds()
Expand All @@ -490,6 +530,8 @@ public function getStoreIds()
}

/**
* Check if system is run in the single store mode.
*
* @return bool
*/
public function isShow()
Expand All @@ -498,6 +540,8 @@ public function isShow()
}

/**
* Render block.
*
* @return string
*/
protected function _toHtml()
Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/Braintree/etc/adminhtml/system.xml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
</requires>
</field>
<group id="configuration_details" showInDefault="1" showInWebsite="1" showInStore="1" sortOrder="4">
<comment>http://docs.magento.com/m2/ce/user_guide/payment/braintree.html</comment>
<comment>https://docs.magento.com/m2/ce/user_guide/payment/braintree.html</comment>
<frontend_model>Magento\Paypal\Block\Adminhtml\System\Config\Fieldset\Hint</frontend_model>
</group>
<group id="braintree_required" translate="label" showInDefault="1" showInWebsite="1" showInStore="1" sortOrder="5">
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="StorefrontSelectBundleProductDropDownOptionActionGroup">
<arguments>
<argument name="productName" type="string"/>
</arguments>
<click selector="{{StorefrontBundleProductActionSection.dropdownSelectOption}}" stepKey="clickOnSelectOption"/>
<click selector="{{StorefrontBundleProductActionSection.dropdownProductSelection(productName)}}" stepKey="selectProduct"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="StorefrontSelectCustomizeAndAddToTheCartButtonActionGroup">
<waitForElementVisible selector="{{StorefrontBundleProductActionSection.customizeAndAddToCartButton}}" stepKey="waitForCustomizeAndAddToCartButton"/>
<click selector="{{StorefrontBundleProductActionSection.customizeAndAddToCartButton}}" stepKey="clickOnCustomizeAndAddToCartButton"/>
<waitForPageLoad stepKey="waitForPageLoad"/>
</actionGroup>
</actionGroups>
16 changes: 16 additions & 0 deletions app/code/Magento/Bundle/Test/Mftf/Data/ProductData.xml
Original file line number Diff line number Diff line change
Expand Up @@ -91,4 +91,20 @@
<requiredEntity type="custom_attribute">CustomAttributeFixPrice</requiredEntity>
<requiredEntity type="custom_attribute">CustomAttributePriceView</requiredEntity>
</entity>
<entity name="BundleProductPriceViewRange" type="product2">
<data key="name" unique="suffix">BundleProduct</data>
<data key="sku" unique="suffix">bundle-product</data>
<data key="type_id">bundle</data>
<data key="attribute_set_id">4</data>
<data key="visibility">4</data>
<data key="status">1</data>
<data key="urlKey" unique="suffix">bundle-product</data>
<requiredEntity type="product_extension_attribute">EavStockItem</requiredEntity>
<requiredEntity type="custom_attribute">CustomAttributeCategoryIds</requiredEntity>
<requiredEntity type="product_extension_attribute">EavStockItem</requiredEntity>
<requiredEntity type="custom_attribute">ApiProductDescription</requiredEntity>
<requiredEntity type="custom_attribute">ApiProductShortDescription</requiredEntity>
<requiredEntity type="custom_attribute">CustomAttributeDynamicPrice</requiredEntity>
<requiredEntity type="custom_attribute">CustomAttributePriceViewRange</requiredEntity>
</entity>
</entities>
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,6 @@
<element name="multiselectOptionFourProducts" type="multiselect" selector="//label//span[contains(text(), '{{productName}}')]/../..//select[@multiple='multiple']" parameterized="true"/>
<element name="currencyTrigger" type="select" selector="#switcher-currency-trigger" timeout="30"/>
<element name="currency" type="select" selector="//a[text()='{{arg}}']" parameterized="true"/>
<element name="multiSelectOption" type="select" selector="//div[@class='field option required']//select"/>
</section>
</sections>
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
<section name="StorefrontBundleProductActionSection">
<element name="customizeAndAddToCartButton" type="button" selector="#bundle-slide"/>
<element name="customizeAndAddToCartButton" type="button" selector="#bundle-slide" timeout="30"/>
<element name="quantityField" type="input" selector="#qty"/>
<element name="addToCartButton" type="button" selector="#product-addtocart-button"/>
<element name="addToCartButton" type="button" selector="#product-addtocart-button" timeout="30"/>
<element name="dropdownSelectOption" type="select" selector="//div[@class='control']/select"/>
<element name="dropdownProductSelection" type="select" selector="//div[@class='control']/select/option[contains(.,'{{productName}}')]" parameterized="true"/>
</section>
</sections>
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@
<features value="Bundle"/>
<stories value="View bundle products"/>
<title value="Check tier prices for bundle options"/>
<description value="Check tier prices for bundle options"/>
<testCaseId value="MAGETWO-98968"/>
<useCaseId value="MAGETWO-98603"/>
<severity value="AVERAGE"/>
<group value="catalog"/>
<group value="bundle"/>
</annotations>
Expand Down
9 changes: 3 additions & 6 deletions app/code/Magento/Catalog/Block/Product/View.php
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,7 @@ public function getAddToCartUrl($product, $additional = [])
}

/**
* Get JSON encoded configuration array which can be used for JS dynamic
* price calculation depending on product options
* Get JSON encoded configuration which can be used for JS dynamic price calculation depending on product options
*
* @return string
*/
Expand Down Expand Up @@ -262,6 +261,7 @@ public function isStartCustomization()

/**
* Get default qty - either as preconfigured, or as 1.
*
* Also restricts it by minimal qty.
*
* @param null|\Magento\Catalog\Model\Product $product
Expand Down Expand Up @@ -323,10 +323,7 @@ public function getQuantityValidators()
public function getIdentities()
{
$identities = $this->getProduct()->getIdentities();
$category = $this->_coreRegistry->registry('current_category');
if ($category) {
$identities[] = Category::CACHE_TAG . '_' . $category->getId();
}

return $identities;
}

Expand Down
6 changes: 4 additions & 2 deletions app/code/Magento/Catalog/Model/Product/Gallery/Processor.php
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ public function addImage(
throw new LocalizedException(__("The image doesn't exist."));
}

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

$absoluteFilePath = $this->mediaDirectory->getAbsolutePath($file);
$absoluteFilePath = $this->mediaDirectory->getAbsolutePath($destinationFile);
$imageMimeType = $this->mime->getMimeType($absoluteFilePath);
$imageContent = $this->mediaDirectory->readFile($absoluteFilePath);
$imageBase64 = base64_encode($imageContent);
Expand Down Expand Up @@ -452,6 +453,7 @@ protected function getUniqueFileName($file, $forTmp = false)
$destinationFile = $forTmp
? $this->mediaDirectory->getAbsolutePath($this->mediaConfig->getTmpMediaPath($file))
: $this->mediaDirectory->getAbsolutePath($this->mediaConfig->getMediaPath($file));
// phpcs:ignore Magento2.Functions.DiscouragedFunction
$destFile = dirname($file) . '/'
. \Magento\MediaStorage\Model\File\Uploader::getNewFileName($destinationFile);
}
Expand Down Expand Up @@ -494,7 +496,7 @@ protected function getNotDuplicatedFilename($fileName, $dispretionPath)
/**
* Retrieve data for update attribute
*
* @param \Magento\Catalog\Model\Product $object
* @param \Magento\Catalog\Model\Product $object
* @return array
* @since 101.0.0
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
use Magento\Framework\DB\Select;
use Magento\Framework\EntityManager\MetadataPool;
use Magento\Framework\Indexer\DimensionFactory;
use Magento\Framework\Model\ResourceModel\ResourceModelPoolInterface;
use Magento\Store\Model\Indexer\WebsiteDimensionProvider;
use Magento\Store\Model\Store;

Expand Down
Loading

0 comments on commit 478f438

Please sign in to comment.