Skip to content

Commit 4550597

Browse files
committed
Merge remote-tracking branch 'origin/2.3-develop' into 429-test-coverage-nonExistentCart
2 parents 990a373 + 9d231d1 commit 4550597

File tree

269 files changed

+7386
-526
lines changed

Some content is hidden

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

269 files changed

+7386
-526
lines changed

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

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -408,6 +408,7 @@ protected function saveAndReplaceAdvancedPrices()
408408
} elseif (\Magento\ImportExport\Model\Import::BEHAVIOR_APPEND == $behavior) {
409409
$this->processCountExistingPrices($tierPrices, self::TABLE_TIER_PRICE)
410410
->processCountNewPrices($tierPrices);
411+
411412
$this->saveProductPrices($tierPrices, self::TABLE_TIER_PRICE);
412413
if ($listSku) {
413414
$this->setUpdatedAt($listSku);
@@ -562,11 +563,14 @@ protected function processCountExistingPrices($prices, $table)
562563

563564
$tableName = $this->_resourceFactory->create()->getTable($table);
564565
$productEntityLinkField = $this->getProductEntityLinkField();
565-
$existingPrices = $this->_connection->fetchAssoc(
566+
$existingPrices = $this->_connection->fetchAll(
566567
$this->_connection->select()->from(
567568
$tableName,
568-
['value_id', $productEntityLinkField, 'all_groups', 'customer_group_id']
569-
)->where($productEntityLinkField . ' IN (?)', $existProductIds)
569+
[$productEntityLinkField, 'all_groups', 'customer_group_id', 'qty']
570+
)->where(
571+
$productEntityLinkField . ' IN (?)',
572+
$existProductIds
573+
)
570574
);
571575
foreach ($existingPrices as $existingPrice) {
572576
foreach ($prices as $sku => $skuPrices) {
@@ -591,8 +595,10 @@ protected function incrementCounterUpdated($prices, $existingPrice)
591595
foreach ($prices as $price) {
592596
if ($existingPrice['all_groups'] == $price['all_groups']
593597
&& $existingPrice['customer_group_id'] == $price['customer_group_id']
598+
&& (int) $existingPrice['qty'] === (int) $price['qty']
594599
) {
595600
$this->countItemsUpdated++;
601+
continue;
596602
}
597603
}
598604
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -921,7 +921,7 @@ public function testProcessCountExistingPrices(
921921
);
922922
$dbSelectMock = $this->createMock(\Magento\Framework\DB\Select::class);
923923
$this->connection->expects($this->once())
924-
->method('fetchAssoc')
924+
->method('fetchAll')
925925
->willReturn($existingPrices);
926926
$this->connection->expects($this->once())
927927
->method('select')
@@ -930,7 +930,7 @@ public function testProcessCountExistingPrices(
930930
->method('from')
931931
->with(
932932
self::TABLE_NAME,
933-
['value_id', self::LINK_FIELD, 'all_groups', 'customer_group_id']
933+
[self::LINK_FIELD, 'all_groups', 'customer_group_id', 'qty']
934934
)->willReturnSelf();
935935
$this->advancedPricing->expects($this->once())
936936
->method('retrieveOldSkus')
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
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+
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
9+
<section name="AdminAdvancedReportingSection">
10+
<element name="goToAdvancedReporting" type="text" selector="//div[@class='dashboard-advanced-reports-actions']/a[@title='Go to Advanced Reporting']" timeout="30"/>
11+
</section>
12+
</sections>
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
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+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
10+
<test name="AdminAdvancedReportingButtonTest">
11+
<annotations>
12+
<stories value="AdvancedReporting"/>
13+
<title value="AdvancedReportingButtonTest"/>
14+
<description value="Test log in to AdvancedReporting and tests AdvancedReportingButtonTest"/>
15+
<testCaseId value="MC-14800"/>
16+
<severity value="CRITICAL"/>
17+
<group value="analytics"/>
18+
<group value="mtf_migrated"/>
19+
</annotations>
20+
21+
<before>
22+
<actionGroup ref = "LoginAsAdmin" stepKey="loginAsAdmin"/>
23+
</before>
24+
<after>
25+
<actionGroup ref="logout" stepKey="logout"/>
26+
</after>
27+
28+
<!--Navigate through Advanced Reporting button on dashboard to Sign Up page-->
29+
<amOnPage url="{{AdminDashboardPage.url}}" stepKey="amOnDashboardPage"/>
30+
<waitForPageLoad stepKey="waitForDashboardPageLoad"/>
31+
<click selector="{{AdminAdvancedReportingSection.goToAdvancedReporting}}" stepKey="clickGoToAdvancedReporting"/>
32+
<switchToNextTab stepKey="switchToNewTab"/>
33+
<seeInCurrentUrl url="advancedreporting.rjmetrics.com/report" stepKey="seeAssertAdvancedReportingPageUrl"/>
34+
</test>
35+
</tests>

app/code/Magento/AuthorizenetAcceptjs/etc/config.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,13 @@
77
-->
88
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Store:etc/config.xsd">
99
<default>
10+
<dev>
11+
<js>
12+
<minify_exclude>
13+
<authorizenet_acceptjs>\.authorize\.net/v1/Accept</authorizenet_acceptjs>
14+
</minify_exclude>
15+
</js>
16+
</dev>
1017
<payment>
1118
<authorizenet_acceptjs>
1219
<active>0</active>

app/code/Magento/AuthorizenetAcceptjs/view/base/requirejs-config.js

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,16 @@
44
*/
55

66
var config = {
7-
map: {
8-
'*': {
9-
acceptjssandbox: 'https://jstest.authorize.net/v1/Accept.js',
10-
acceptjs: 'https://js.authorize.net/v1/Accept.js'
7+
shim: {
8+
acceptjs: {
9+
exports: 'Accept'
10+
},
11+
acceptjssandbox: {
12+
exports: 'Accept'
1113
}
14+
},
15+
paths: {
16+
acceptjssandbox: 'https://jstest.authorize.net/v1/Accept',
17+
acceptjs: 'https://js.authorize.net/v1/Accept'
1218
}
1319
};

app/code/Magento/AuthorizenetAcceptjs/view/base/web/js/view/payment/acceptjs-factory.js

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ define([
1616
dependency = 'acceptjssandbox';
1717
}
1818

19-
require([dependency], function () {
19+
require([dependency], function (accept) {
2020
var $body = $('body');
2121

2222
/*
@@ -26,16 +26,7 @@ define([
2626
* Dynamically-loading-Accept-js-E-WC-03-Accept-js-is-not-loaded/td-p/63283
2727
*/
2828
$body.on('handshake.acceptjs', function () {
29-
/*
30-
* Accept.js doesn't return the library when loading
31-
* and requirejs "shim" can't be used because it only works with the "paths" config option
32-
* and we can't use "paths" because require will try to load ".min.js" in production
33-
* and that doesn't work because it doesn't exist
34-
* and we can't add a query string to force a URL because accept.js will reject it
35-
* and we can't include it locally because they check in the script before loading more scripts
36-
* So, we use the global version as "shim" would
37-
*/
38-
deferred.resolve(window.Accept);
29+
deferred.resolve(accept);
3930
$body.off('handshake.acceptjs');
4031
});
4132
},

app/code/Magento/Backup/Test/Mftf/ActionGroup/DeleteBackupActionGroup.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
<click selector="{{AdminGridTableSection.backupRowCheckbox(backup.name)}}" stepKey="selectBackupRow"/>
1818
<selectOption selector="{{AdminGridActionSection.actionSelect}}" userInput="Delete" stepKey="selectDeleteAction"/>
1919
<click selector="{{AdminGridActionSection.submitButton}}" stepKey="clickSubmit"/>
20+
<waitForPageLoad stepKey="waitForConfirmWindowToAppear"/>
2021
<see selector="{{AdminConfirmationModalSection.message}}" userInput="Are you sure you want to delete the selected backup(s)?" stepKey="seeConfirmationModal"/>
2122
<click selector="{{AdminConfirmationModalSection.ok}}" stepKey="clickOkConfirmDelete"/>
2223
<dontSee selector="{{AdminGridTableSection.backupNameColumn}}" userInput="{{backup.name}}" stepKey="dontSeeBackupInGrid"/>

app/code/Magento/Backup/Test/Mftf/Data/BackupData.xml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,8 @@
2020
<data key="name" unique="suffix">databaseBackup</data>
2121
<data key="type">Database</data>
2222
</entity>
23-
</entities>
23+
<entity name="WebSetupWizardBackup" type="backup">
24+
<data key="name">WebSetupWizard</data>
25+
<data key="type">Database</data>
26+
</entity>
27+
</entities>
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
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="VerifyProductTypeOrder">
12+
<seeElement stepKey="seeBundleInOrder" selector="{{AdminProductDropdownOrderSection.bundleProduct}}"/>
13+
</actionGroup>
14+
</actionGroups>
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
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+
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
11+
<section name="AdminProductDropdownOrderSection">
12+
<element name="bundleProduct" type="text" selector="//li[not(preceding-sibling::li[span[@title='Downloadable Product']]) and not(following-sibling::li[span[@title='Simple Product']]) and not(following-sibling::li[span[@title='Configurable Product']]) and not(following-sibling::li[span[@title='Grouped Product']]) and not(following-sibling::li[span[@title='Virtual Product']])]/span[@title='Bundle Product']"/>
13+
</section>
14+
</sections>

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@
3131
<deleteData createDataKey="createPreReqCategory" stepKey="deletePreReqCategory"/>
3232
<deleteData createDataKey="simpleProduct1" stepKey="deleteSimpleProduct1"/>
3333
<deleteData createDataKey="simpleProduct2" stepKey="deleteSimpleProduct2"/>
34+
<!-- Delete the bundled product we created in the test body -->
35+
<actionGroup ref="deleteProductBySku" stepKey="deleteBundleProduct">
36+
<argument name="sku" value="{{BundleProduct.sku}}"/>
37+
</actionGroup>
3438
<actionGroup ref="logout" stepKey="logout"/>
3539
</after>
3640
<!--Go to bundle product creation page-->

app/code/Magento/Catalog/Api/ProductRenderListInterface.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,22 @@
44
* Copyright © Magento, Inc. All rights reserved.
55
* See COPYING.txt for license details.
66
*/
7+
78
namespace Magento\Catalog\Api;
89

910
/**
10-
* Interface which provides product renders information for products
11+
* Interface which provides product renders information for products.
12+
*
1113
* @api
1214
* @since 101.1.0
1315
*/
1416
interface ProductRenderListInterface
1517
{
1618
/**
17-
* Collect and retrieve the list of product render info
18-
* This info contains raw prices and formated prices, product name, stock status, store_id, etc
19+
* Collect and retrieve the list of product render info.
20+
*
21+
* This info contains raw prices and formatted prices, product name, stock status, store_id, etc.
22+
*
1923
* @see \Magento\Catalog\Api\Data\ProductRenderInfoDtoInterface
2024
*
2125
* @param \Magento\Framework\Api\SearchCriteriaInterface $searchCriteria

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

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,14 @@
99
*
1010
* @author Magento Core Team <[email protected]>
1111
*/
12+
1213
namespace Magento\Catalog\Block\Product\View\Options;
1314

1415
use Magento\Catalog\Pricing\Price\CustomOptionPriceInterface;
1516

1617
/**
18+
* Product aoptions section abstract block.
19+
*
1720
* @api
1821
* @since 100.0.2
1922
*/
@@ -46,7 +49,7 @@ abstract class AbstractOptions extends \Magento\Framework\View\Element\Template
4649
/**
4750
* @param \Magento\Framework\View\Element\Template\Context $context
4851
* @param \Magento\Framework\Pricing\Helper\Data $pricingHelper
49-
* @param \Magento\Catalog\Helper\Data $catalogData,
52+
* @param \Magento\Catalog\Helper\Data $catalogData
5053
* @param array $data
5154
*/
5255
public function __construct(
@@ -123,6 +126,8 @@ public function getFormattedPrice()
123126
}
124127

125128
/**
129+
* Retrieve formatted price.
130+
*
126131
* @return string
127132
*
128133
* @deprecated
@@ -134,7 +139,7 @@ public function getFormatedPrice()
134139
}
135140

136141
/**
137-
* Return formated price
142+
* Return formatted price
138143
*
139144
* @param array $value
140145
* @param bool $flag

app/code/Magento/Catalog/Model/Category/Tree.php

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,27 +32,40 @@ class Tree
3232
*/
3333
protected $treeFactory;
3434

35+
/**
36+
* @var \Magento\Catalog\Model\ResourceModel\Category\TreeFactory
37+
*/
38+
private $treeResourceFactory;
39+
3540
/**
3641
* @param \Magento\Catalog\Model\ResourceModel\Category\Tree $categoryTree
3742
* @param \Magento\Store\Model\StoreManagerInterface $storeManager
3843
* @param \Magento\Catalog\Model\ResourceModel\Category\Collection $categoryCollection
3944
* @param \Magento\Catalog\Api\Data\CategoryTreeInterfaceFactory $treeFactory
45+
* @param \Magento\Catalog\Model\ResourceModel\Category\TreeFactory|null $treeResourceFactory
4046
*/
4147
public function __construct(
4248
\Magento\Catalog\Model\ResourceModel\Category\Tree $categoryTree,
4349
\Magento\Store\Model\StoreManagerInterface $storeManager,
4450
\Magento\Catalog\Model\ResourceModel\Category\Collection $categoryCollection,
45-
\Magento\Catalog\Api\Data\CategoryTreeInterfaceFactory $treeFactory
51+
\Magento\Catalog\Api\Data\CategoryTreeInterfaceFactory $treeFactory,
52+
\Magento\Catalog\Model\ResourceModel\Category\TreeFactory $treeResourceFactory = null
4653
) {
4754
$this->categoryTree = $categoryTree;
4855
$this->storeManager = $storeManager;
4956
$this->categoryCollection = $categoryCollection;
5057
$this->treeFactory = $treeFactory;
58+
$this->treeResourceFactory = $treeResourceFactory ?? \Magento\Framework\App\ObjectManager::getInstance()
59+
->get(\Magento\Catalog\Model\ResourceModel\Category\TreeFactory::class);
5160
}
5261

5362
/**
63+
* Get root node by category.
64+
*
5465
* @param \Magento\Catalog\Model\Category|null $category
5566
* @return Node|null
67+
* @throws \Magento\Framework\Exception\LocalizedException
68+
* @throws \Magento\Framework\Exception\NoSuchEntityException
5669
*/
5770
public function getRootNode($category = null)
5871
{
@@ -71,21 +84,30 @@ public function getRootNode($category = null)
7184
}
7285

7386
/**
87+
* Get node by category.
88+
*
7489
* @param \Magento\Catalog\Model\Category $category
7590
* @return Node
91+
* @throws \Magento\Framework\Exception\LocalizedException
92+
* @throws \Magento\Framework\Exception\NoSuchEntityException
7693
*/
7794
protected function getNode(\Magento\Catalog\Model\Category $category)
7895
{
7996
$nodeId = $category->getId();
80-
$node = $this->categoryTree->loadNode($nodeId);
97+
$categoryTree = $this->treeResourceFactory->create();
98+
$node = $categoryTree->loadNode($nodeId);
8199
$node->loadChildren();
82100
$this->prepareCollection();
83101
$this->categoryTree->addCollectionData($this->categoryCollection);
84102
return $node;
85103
}
86104

87105
/**
106+
* Prepare category collection.
107+
*
88108
* @return void
109+
* @throws \Magento\Framework\Exception\LocalizedException
110+
* @throws \Magento\Framework\Exception\NoSuchEntityException
89111
*/
90112
protected function prepareCollection()
91113
{
@@ -104,6 +126,8 @@ protected function prepareCollection()
104126
}
105127

106128
/**
129+
* Get tree by node.
130+
*
107131
* @param \Magento\Framework\Data\Tree\Node $node
108132
* @param int $depth
109133
* @param int $currentLevel
@@ -127,6 +151,8 @@ public function getTree($node, $depth = null, $currentLevel = 0)
127151
}
128152

129153
/**
154+
* Get node children.
155+
*
130156
* @param \Magento\Framework\Data\Tree\Node $node
131157
* @param int $depth
132158
* @param int $currentLevel

0 commit comments

Comments
 (0)