Skip to content
This repository was archived by the owner on Apr 29, 2019. It is now read-only.

Commit 7a30913

Browse files
Merge pull request #16 from sanganinamrata/2.3-develop-PR-port-16691
[Forwardport] Added 'title' attribute to 'img' tag in knockout template files.
2 parents 08ad531 + 20483c5 commit 7a30913

File tree

190 files changed

+2513
-188
lines changed

Some content is hidden

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

190 files changed

+2513
-188
lines changed

app/code/Magento/AdvancedPricingImportExport/Model/Export/AdvancedPricing.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,6 @@ class AdvancedPricing extends \Magento\CatalogImportExport\Model\Export\Product
104104
* @param \Magento\CatalogImportExport\Model\Export\RowCustomizerInterface $rowCustomizer
105105
* @param ImportProduct\StoreResolver $storeResolver
106106
* @param \Magento\Customer\Api\GroupRepositoryInterface $groupRepository
107-
* @throws \Magento\Framework\Exception\LocalizedException
108107
* @SuppressWarnings(PHPMD.ExcessiveParameterList)
109108
*/
110109
public function __construct(
@@ -193,6 +192,7 @@ protected function initTypeModels()
193192
* Export process
194193
*
195194
* @return string
195+
* @throws \Magento\Framework\Exception\LocalizedException
196196
*/
197197
public function export()
198198
{
@@ -586,8 +586,8 @@ protected function getTierPrices(array $listSku, $table)
586586
* Get Website code.
587587
*
588588
* @param int $websiteId
589-
*
590589
* @return string
590+
* @throws \Magento\Framework\Exception\LocalizedException
591591
*/
592592
protected function _getWebsiteCode(int $websiteId): string
593593
{
@@ -617,8 +617,9 @@ protected function _getWebsiteCode(int $websiteId): string
617617
*
618618
* @param int $groupId
619619
* @param int $allGroups
620-
*
621620
* @return string
621+
* @throws \Magento\Framework\Exception\LocalizedException
622+
* @throws \Magento\Framework\Exception\NoSuchEntityException
622623
*/
623624
protected function _getCustomerGroupById(
624625
int $groupId,

app/code/Magento/AdvancedPricingImportExport/Model/Import/AdvancedPricing.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
use Magento\CatalogImportExport\Model\Import\Product as ImportProduct;
99
use Magento\CatalogImportExport\Model\Import\Product\RowValidatorInterface as ValidatorInterface;
1010
use Magento\ImportExport\Model\Import\ErrorProcessing\ProcessingErrorAggregatorInterface;
11-
use Magento\Framework\App\ResourceConnection;
1211

1312
/**
1413
* Class AdvancedPricing
@@ -618,6 +617,7 @@ protected function processCountNewPrices(array $tierPrices)
618617
* Get product entity link field
619618
*
620619
* @return string
620+
* @throws \Exception
621621
*/
622622
private function getProductEntityLinkField()
623623
{

app/code/Magento/AdvancedPricingImportExport/Model/Import/AdvancedPricing/Validator.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ public function __construct($validators = [])
2828
*
2929
* @param array $value
3030
* @return bool
31+
* @throws \Zend_Validate_Exception
3132
*/
3233
public function isValid($value)
3334
{

app/code/Magento/AdvancedPricingImportExport/Test/Unit/Model/Export/AdvancedPricingTest.php

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -151,10 +151,13 @@ protected function setUp()
151151
]
152152
);
153153
$this->exportConfig = $this->createMock(\Magento\ImportExport\Model\Export\Config::class);
154-
$this->productFactory = $this->createPartialMock(\Magento\Catalog\Model\ResourceModel\ProductFactory::class, [
154+
$this->productFactory = $this->createPartialMock(
155+
\Magento\Catalog\Model\ResourceModel\ProductFactory::class,
156+
[
155157
'create',
156158
'getTypeId',
157-
]);
159+
]
160+
);
158161
$this->attrSetColFactory = $this->createPartialMock(
159162
\Magento\Eav\Model\ResourceModel\Entity\Attribute\Set\CollectionFactory::class,
160163
[
@@ -185,11 +188,14 @@ protected function setUp()
185188
\Magento\CatalogImportExport\Model\Import\Product\StoreResolver::class
186189
);
187190
$this->groupRepository = $this->createMock(\Magento\Customer\Api\GroupRepositoryInterface::class);
188-
$this->writer = $this->createPartialMock(\Magento\ImportExport\Model\Export\Adapter\AbstractAdapter::class, [
189-
'setHeaderCols',
190-
'writeRow',
191-
'getContents',
192-
]);
191+
$this->writer = $this->createPartialMock(
192+
\Magento\ImportExport\Model\Export\Adapter\AbstractAdapter::class,
193+
[
194+
'setHeaderCols',
195+
'writeRow',
196+
'getContents',
197+
]
198+
);
193199
$constructorMethods = [
194200
'initTypeModels',
195201
'initAttributes',
@@ -347,6 +353,7 @@ protected function tearDown()
347353
* @param $object
348354
* @param $property
349355
* @return mixed
356+
* @throws \ReflectionException
350357
*/
351358
protected function getPropertyValue($object, $property)
352359
{
@@ -362,6 +369,8 @@ protected function getPropertyValue($object, $property)
362369
* @param $object
363370
* @param $property
364371
* @param $value
372+
* @return mixed
373+
* @throws \ReflectionException
365374
*/
366375
protected function setPropertyValue(&$object, $property, $value)
367376
{

app/code/Magento/AdvancedPricingImportExport/Test/Unit/Model/Import/AdvancedPricing/Validator/TierPriceTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -346,6 +346,7 @@ public function isValidAddMessagesCallDataProvider()
346346
* @param object $object
347347
* @param string $property
348348
* @return mixed
349+
* @throws \ReflectionException
349350
*/
350351
protected function getPropertyValue($object, $property)
351352
{
@@ -363,6 +364,7 @@ protected function getPropertyValue($object, $property)
363364
* @param string $property
364365
* @param mixed $value
365366
* @return object
367+
* @throws \ReflectionException
366368
*/
367369
protected function setPropertyValue(&$object, $property, $value)
368370
{

app/code/Magento/AdvancedPricingImportExport/Test/Unit/Model/Import/AdvancedPricingTest.php

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,10 @@ public function testGetEntityTypeCode()
209209
* Test method validateRow against its result.
210210
*
211211
* @dataProvider validateRowResultDataProvider
212+
* @param array $rowData
213+
* @param string|null $behavior
214+
* @param bool $expectedResult
215+
* @throws \ReflectionException
212216
*/
213217
public function testValidateRowResult($rowData, $behavior, $expectedResult)
214218
{
@@ -234,6 +238,10 @@ public function testValidateRowResult($rowData, $behavior, $expectedResult)
234238
* Test method validateRow whether AddRowError is called.
235239
*
236240
* @dataProvider validateRowAddRowErrorCallDataProvider
241+
* @param array $rowData
242+
* @param string|null $behavior
243+
* @param string $error
244+
* @throws \ReflectionException
237245
*/
238246
public function testValidateRowAddRowErrorCall($rowData, $behavior, $error)
239247
{
@@ -324,6 +332,13 @@ public function testSaveAdvancedPricing()
324332
* Take into consideration different data and check relative internal calls.
325333
*
326334
* @dataProvider saveAndReplaceAdvancedPricesAppendBehaviourDataProvider
335+
* @param array $data
336+
* @param string $tierCustomerGroupId
337+
* @param string $groupCustomerGroupId
338+
* @param string $tierWebsiteId
339+
* @param string $groupWebsiteId
340+
* @param array $expectedTierPrices
341+
* @throws \ReflectionException
327342
*/
328343
public function testSaveAndReplaceAdvancedPricesAppendBehaviourDataAndCalls(
329344
$data,
@@ -956,6 +971,7 @@ public function processCountExistingPricesDataProvider()
956971
* @param $object
957972
* @param $property
958973
* @return mixed
974+
* @throws \ReflectionException
959975
*/
960976
protected function getPropertyValue($object, $property)
961977
{
@@ -972,6 +988,8 @@ protected function getPropertyValue($object, $property)
972988
* @param $object
973989
* @param $property
974990
* @param $value
991+
* @return mixed
992+
* @throws \ReflectionException
975993
*/
976994
protected function setPropertyValue(&$object, $property, $value)
977995
{
@@ -989,8 +1007,8 @@ protected function setPropertyValue(&$object, $property, $value)
9891007
* @param object $object
9901008
* @param string $method
9911009
* @param array $args
992-
*
993-
* @return mixed the method result.
1010+
* @return mixed
1011+
* @throws \ReflectionException
9941012
*/
9951013
private function invokeMethod($object, $method, $args = [])
9961014
{
@@ -1007,6 +1025,7 @@ private function invokeMethod($object, $method, $args = [])
10071025
* @param array $methods
10081026
*
10091027
* @return \PHPUnit_Framework_MockObject_MockObject
1028+
* @throws \ReflectionException
10101029
*/
10111030
private function getAdvancedPricingMock($methods = [])
10121031
{

app/code/Magento/AdvancedSearch/Block/SearchData.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ abstract class SearchData extends Template implements SearchDataInterface
3030
/**
3131
* @var string
3232
*/
33-
protected $_template = 'search_data.phtml';
33+
protected $_template = 'Magento_AdvancedSearch::search_data.phtml';
3434

3535
/**
3636
* @param Template\Context $context

app/code/Magento/Analytics/Test/Mftf/Test/AdminConfigurationTimeToSendDataTest.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
</after>
2424
<actionGroup ref="LoginActionGroup" stepKey="loginAsAdmin"/>
2525
<amOnPage stepKey="amOnAdminConfig" url="{{AdminConfigPage.url}}"/>
26+
<waitForPageLoad stepKey="waitForAdminConfig"/>
2627
<click stepKey="clickAdvancedReportingConfigMenu" selector="{{AdminConfigSection.advancedReportingMenuItem}}"/>
2728
<selectOption stepKey="selectAdvancedReportingIndustry" selector="{{AdminConfigSection.advancedReportingIndustry}}" userInput="Apps and Games"/>
2829
<selectOption stepKey="selectAdvancedReportingHour" selector="{{AdminConfigSection.advancedReportingHour}}" userInput="11"/>

app/code/Magento/Backend/Block/Widget/Form/Element/Dependence.php

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -124,14 +124,18 @@ protected function _toHtml()
124124
if (!$this->_depends) {
125125
return '';
126126
}
127-
return '<script>
128-
require(["mage/adminhtml/form"], function(){
129-
new FormElementDependenceController(' .
130-
$this->_getDependsJson() .
131-
($this->_configOptions ? ', ' .
132-
$this->_jsonEncoder->encode(
133-
$this->_configOptions
134-
) : '') . '); });</script>';
127+
128+
$params = $this->_getDependsJson();
129+
130+
if ($this->_configOptions) {
131+
$params .= ', ' . $this->_jsonEncoder->encode($this->_configOptions);
132+
}
133+
134+
return "<script>
135+
require(['mage/adminhtml/form'], function(){
136+
new FormElementDependenceController({$params});
137+
});
138+
</script>";
135139
}
136140

137141
/**

app/code/Magento/Backend/Test/Mftf/Section/AdminMessagesSection.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,7 @@
1010
xsi:noNamespaceSchemaLocation="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Page/etc/SectionObject.xsd">
1111
<section name="AdminMessagesSection">
1212
<element name="success" type="text" selector="#messages div.message-success"/>
13+
<element name="nthSuccess" type="text" selector=".message.message-success.success:nth-of-type({{n}})>div" parameterized="true"/>
14+
<element name="error" type="text" selector="#messages div.message-error"/>
1315
</section>
1416
</sections>

app/code/Magento/Backend/Test/Mftf/Section/AdminSecondaryGridSection.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@
1111
<section name="AdminSecondaryGridSection">
1212
<element name="resetFilters" type="button" selector="[title='Reset Filter']"/>
1313
<element name="taxIdentifierSearch" type="input" selector=".col-code .admin__control-text"/>
14+
<element name="catalogRuleIdentifierSearch" type="input" selector=".col-name .admin__control-text"/>
1415
<element name="searchButton" type="input" selector=".admin__filter-actions [title='Search']"/>
1516
<element name="firstRow" type="block" selector="tr[data-role='row']"/>
1617
</section>
1718
</sections>
19+

app/code/Magento/Braintree/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
},
77
"require": {
88
"php": "~7.1.3||~7.2.0",
9-
"braintree/braintree_php": "3.28.0",
9+
"braintree/braintree_php": "3.34.0",
1010
"magento/framework": "*",
1111
"magento/magento-composer-installer": "*",
1212
"magento/module-catalog": "*",

app/code/Magento/Braintree/view/frontend/web/template/payment/paypal.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
data-bind="attr: {'id': getCode()}, value: getCode(), checked: isChecked, click: selectPaymentMethod, visible: isRadioButtonVisible()" />
1313
<label class="label" data-bind="attr: {'for': getCode()}">
1414
<!-- PayPal Logo -->
15-
<img data-bind="attr: {src: getPaymentAcceptanceMarkSrc(), alt: $t('Acceptance Mark')}"
15+
<img data-bind="attr: {src: getPaymentAcceptanceMarkSrc(), alt: $t('Acceptance Mark')}, title: $t('Acceptance Mark')}"
1616
class="payment-icon"/>
1717
<!-- PayPal Logo -->
1818
<span text="getTitle()"></span>

app/code/Magento/Bundle/Model/Product/Type.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -534,12 +534,12 @@ public function updateQtyOption($options, \Magento\Framework\DataObject $option,
534534

535535
foreach ($selections as $selection) {
536536
if ($selection->getProductId() == $optionProduct->getId()) {
537-
foreach ($options as &$option) {
538-
if ($option->getCode() == 'selection_qty_' . $selection->getSelectionId()) {
537+
foreach ($options as $quoteItemOption) {
538+
if ($quoteItemOption->getCode() == 'selection_qty_' . $selection->getSelectionId()) {
539539
if ($optionUpdateFlag) {
540-
$option->setValue(intval($option->getValue()));
540+
$quoteItemOption->setValue(intval($quoteItemOption->getValue()));
541541
} else {
542-
$option->setValue($value);
542+
$quoteItemOption->setValue($value);
543543
}
544544
}
545545
}

app/code/Magento/Bundle/Test/Mftf/ActionGroup/CreateBundleProductActionGroup.xml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,38 @@
2121
<!--Fill URL input-->
2222
<fillField userInput="{{BundleProduct.urlKey}}" selector="{{AdminProductFormBundleSection.urlKey}}" stepKey="FillsinSEOlinkExtension"/>
2323
</actionGroup>
24+
25+
<actionGroup name="addBundleOptionWithTwoProducts">
26+
<arguments>
27+
<argument name="x" type="string"/>
28+
<argument name="n" type="string"/>
29+
<argument name="prodOneSku" type="string"/>
30+
<argument name="prodTwoSku" type="string"/>
31+
<argument name="optionTitle" type="string"/>
32+
<argument name="inputType" type="string"/>
33+
</arguments>
34+
<conditionalClick selector="{{AdminProductFormBundleSection.bundleItemsToggle}}" dependentSelector="{{AdminProductFormBundleSection.bundleItemsToggle}}" visible="false" stepKey="conditionallyOpenSectionBundleItems"/>
35+
<scrollTo selector="{{AdminProductFormBundleSection.bundleItemsToggle}}" stepKey="scrollUpABit"/>
36+
<click selector="{{AdminProductFormBundleSection.addOption}}" stepKey="clickAddOption"/>
37+
<waitForElementVisible selector="{{AdminProductFormBundleSection.bundleOptionXTitle(x)}}" stepKey="waitForOptions"/>
38+
<fillField selector="{{AdminProductFormBundleSection.bundleOptionXTitle(x)}}" userInput="{{optionTitle}}" stepKey="fillTitle"/>
39+
<selectOption selector="{{AdminProductFormBundleSection.bundleOptionXInputType(x)}}" userInput="{{inputType}}" stepKey="selectType"/>
40+
<waitForElementVisible selector="{{AdminProductFormBundleSection.nthAddProductsToOption(n)}}" stepKey="waitForAddBtn"/>
41+
<click selector="{{AdminProductFormBundleSection.nthAddProductsToOption(n)}}" stepKey="clickAdd"/>
42+
<conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFilters1"/>
43+
<click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters1"/>
44+
<fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{prodOneSku}}" stepKey="fillProductSkuFilter1"/>
45+
<click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters1"/>
46+
<waitForElementNotVisible selector="{{AdminProductGridSection.loadingMask}}" stepKey="waitForFilteredGridLoad1" time="30"/>
47+
<checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectProduct1"/>
48+
<conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFilters2"/>
49+
<click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters2"/>
50+
<fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{prodTwoSku}}" stepKey="fillProductSkuFilter2"/>
51+
<click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters2"/>
52+
<waitForElementNotVisible selector="{{AdminProductGridSection.loadingMask}}" stepKey="waitForFilteredGridLoad2" time="30"/>
53+
<checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectProduct2"/>
54+
<click selector="{{AdminAddProductsToOptionPanel.addSelectedProducts}}" stepKey="clickAddButton1"/>
55+
<fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity(x, '0')}}" userInput="50" stepKey="fillQuantity1"/>
56+
<fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity(x, '1')}}" userInput="50" stepKey="fillQuantity2"/>
57+
</actionGroup>
2458
</actionGroups>

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
<data key="default_quantity2">20</data>
2727
<data key="set">4</data>
2828
<data key="type">bundle</data>
29+
<data key="price">10</data>
2930
<data key="fixedPrice">10</data>
3031
<data key="fixedPriceFormatted">$10.00</data>
3132
<data key="defaultAttribute">Default</data>

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
<element name="bundleOptionXRequired" type="checkbox" selector="[name='bundle_options[bundle_options][{{x}}][required]']" parameterized="true"/>
2222
<element name="bundleOptionXProductYQuantity" type="input" selector="[name='bundle_options[bundle_options][{{x}}][bundle_selections][{{y}}][selection_qty]']" parameterized="true"/>
2323
<element name="addProductsToOption" type="button" selector="[data-index='modal_set']" timeout="30"/>
24+
<element name="nthAddProductsToOption" type="button" selector="//tr[{{var}}]//button[@data-index='modal_set']" timeout="30" parameterized="true"/>
2425
<!--Select"url Key"InputForm-->
2526
<element name="urlKey" type="input" selector="//input[@name='product[url_key]']" timeout="30"/>
2627
<!--AddSelectedProducts-->
@@ -60,5 +61,12 @@
6061
<element name="listedBundleItem2" type="text" selector="//tr[@data-repeat-index='2']//div"/>
6162
<!--FirstProductOption-->
6263
<element name="firstProductOption" type="checkbox" selector="//div[@class='admin__data-grid-outer-wrap']//tr[@data-repeat-index='0']//input[@type='checkbox']"/>
64+
<!--Category Selection-->
65+
<element name="categoriesDropDown" type="multiselect" selector="//div[@data-index='category_ids']//div" timeout="30"/>
66+
<element name="defaultCategory" type="multiselect" selector="//div[@data-index='category_ids']//span[contains(text(), 'Default Category')]"/>
67+
<element name="categoryByName" type="multiselect" selector="//div[@data-index='category_ids']//span[contains(text(), '{{category}}')]" parameterized="true"/>
68+
<element name="searchForCategory" type="input" selector="div.action-menu._active > div.admin__action-multiselect-search-wrap input" timeout="30"/>
69+
<element name="selectCategory" type="multiselect" selector="//div[@class='action-menu _active']//label[@class='admin__action-multiselect-label']"/>
70+
<element name="categoriesLabel" type="text" selector="//div[@class='action-menu _active']//button[@data-action='close-advanced-select']"/>
6371
</section>
6472
</sections>

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,8 @@
1818
<element name="customizeProduct" type="button" selector="//*[@id='bundle-slide']"/>
1919
<element name="customizableBundleItemOption" type="text" selector="//div[@class='field choice'][1]//input[@type='checkbox']"/>
2020
<element name="customizableBundleItemOption2" type="text" selector="//div[@class='field choice'][2]//input[@type='checkbox']"/>
21+
<element name="nthOptionDiv" type="block" selector="#product-options-wrapper div.field.option:nth-of-type({{var}})" parameterized="true"/>
22+
<element name="nthItemOptionsTitle" type="text" selector="dl.item-options dt:nth-of-type({{var}})" parameterized="true"/>
23+
<element name="nthItemOptionsValue" type="text" selector="dl.item-options dd:nth-of-type({{var}})" parameterized="true"/>
2124
</section>
2225
</sections>

0 commit comments

Comments
 (0)