Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/2.3-develop' into 419-test-cover…
Browse files Browse the repository at this point in the history
…age-getAvailablePaymentMethods-customer
  • Loading branch information
naydav committed Mar 12, 2019
2 parents 8786fbf + 9d231d1 commit 1356caa
Show file tree
Hide file tree
Showing 268 changed files with 7,383 additions and 521 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -408,6 +408,7 @@ protected function saveAndReplaceAdvancedPrices()
} elseif (\Magento\ImportExport\Model\Import::BEHAVIOR_APPEND == $behavior) {
$this->processCountExistingPrices($tierPrices, self::TABLE_TIER_PRICE)
->processCountNewPrices($tierPrices);

$this->saveProductPrices($tierPrices, self::TABLE_TIER_PRICE);
if ($listSku) {
$this->setUpdatedAt($listSku);
Expand Down Expand Up @@ -562,11 +563,14 @@ protected function processCountExistingPrices($prices, $table)

$tableName = $this->_resourceFactory->create()->getTable($table);
$productEntityLinkField = $this->getProductEntityLinkField();
$existingPrices = $this->_connection->fetchAssoc(
$existingPrices = $this->_connection->fetchAll(
$this->_connection->select()->from(
$tableName,
['value_id', $productEntityLinkField, 'all_groups', 'customer_group_id']
)->where($productEntityLinkField . ' IN (?)', $existProductIds)
[$productEntityLinkField, 'all_groups', 'customer_group_id', 'qty']
)->where(
$productEntityLinkField . ' IN (?)',
$existProductIds
)
);
foreach ($existingPrices as $existingPrice) {
foreach ($prices as $sku => $skuPrices) {
Expand All @@ -591,8 +595,10 @@ protected function incrementCounterUpdated($prices, $existingPrice)
foreach ($prices as $price) {
if ($existingPrice['all_groups'] == $price['all_groups']
&& $existingPrice['customer_group_id'] == $price['customer_group_id']
&& (int) $existingPrice['qty'] === (int) $price['qty']
) {
$this->countItemsUpdated++;
continue;
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -921,7 +921,7 @@ public function testProcessCountExistingPrices(
);
$dbSelectMock = $this->createMock(\Magento\Framework\DB\Select::class);
$this->connection->expects($this->once())
->method('fetchAssoc')
->method('fetchAll')
->willReturn($existingPrices);
$this->connection->expects($this->once())
->method('select')
Expand All @@ -930,7 +930,7 @@ public function testProcessCountExistingPrices(
->method('from')
->with(
self::TABLE_NAME,
['value_id', self::LINK_FIELD, 'all_groups', 'customer_group_id']
[self::LINK_FIELD, 'all_groups', 'customer_group_id', 'qty']
)->willReturnSelf();
$this->advancedPricing->expects($this->once())
->method('retrieveOldSkus')
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
<section name="AdminAdvancedReportingSection">
<element name="goToAdvancedReporting" type="text" selector="//div[@class='dashboard-advanced-reports-actions']/a[@title='Go to Advanced Reporting']" timeout="30"/>
</section>
</sections>
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
<test name="AdminAdvancedReportingButtonTest">
<annotations>
<stories value="AdvancedReporting"/>
<title value="AdvancedReportingButtonTest"/>
<description value="Test log in to AdvancedReporting and tests AdvancedReportingButtonTest"/>
<testCaseId value="MC-14800"/>
<severity value="CRITICAL"/>
<group value="analytics"/>
<group value="mtf_migrated"/>
</annotations>

<before>
<actionGroup ref = "LoginAsAdmin" stepKey="loginAsAdmin"/>
</before>
<after>
<actionGroup ref="logout" stepKey="logout"/>
</after>

<!--Navigate through Advanced Reporting button on dashboard to Sign Up page-->
<amOnPage url="{{AdminDashboardPage.url}}" stepKey="amOnDashboardPage"/>
<waitForPageLoad stepKey="waitForDashboardPageLoad"/>
<click selector="{{AdminAdvancedReportingSection.goToAdvancedReporting}}" stepKey="clickGoToAdvancedReporting"/>
<switchToNextTab stepKey="switchToNewTab"/>
<seeInCurrentUrl url="advancedreporting.rjmetrics.com/report" stepKey="seeAssertAdvancedReportingPageUrl"/>
</test>
</tests>
7 changes: 7 additions & 0 deletions app/code/Magento/AuthorizenetAcceptjs/etc/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Store:etc/config.xsd">
<default>
<dev>
<js>
<minify_exclude>
<authorizenet_acceptjs>\.authorize\.net/v1/Accept</authorizenet_acceptjs>
</minify_exclude>
</js>
</dev>
<payment>
<authorizenet_acceptjs>
<active>0</active>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,16 @@
*/

var config = {
map: {
'*': {
acceptjssandbox: 'https://jstest.authorize.net/v1/Accept.js',
acceptjs: 'https://js.authorize.net/v1/Accept.js'
shim: {
acceptjs: {
exports: 'Accept'
},
acceptjssandbox: {
exports: 'Accept'
}
},
paths: {
acceptjssandbox: 'https://jstest.authorize.net/v1/Accept',
acceptjs: 'https://js.authorize.net/v1/Accept'
}
};
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ define([
dependency = 'acceptjssandbox';
}

require([dependency], function () {
require([dependency], function (accept) {
var $body = $('body');

/*
Expand All @@ -26,16 +26,7 @@ define([
* Dynamically-loading-Accept-js-E-WC-03-Accept-js-is-not-loaded/td-p/63283
*/
$body.on('handshake.acceptjs', function () {
/*
* Accept.js doesn't return the library when loading
* and requirejs "shim" can't be used because it only works with the "paths" config option
* and we can't use "paths" because require will try to load ".min.js" in production
* and that doesn't work because it doesn't exist
* and we can't add a query string to force a URL because accept.js will reject it
* and we can't include it locally because they check in the script before loading more scripts
* So, we use the global version as "shim" would
*/
deferred.resolve(window.Accept);
deferred.resolve(accept);
$body.off('handshake.acceptjs');
});
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
<click selector="{{AdminGridTableSection.backupRowCheckbox(backup.name)}}" stepKey="selectBackupRow"/>
<selectOption selector="{{AdminGridActionSection.actionSelect}}" userInput="Delete" stepKey="selectDeleteAction"/>
<click selector="{{AdminGridActionSection.submitButton}}" stepKey="clickSubmit"/>
<waitForPageLoad stepKey="waitForConfirmWindowToAppear"/>
<see selector="{{AdminConfirmationModalSection.message}}" userInput="Are you sure you want to delete the selected backup(s)?" stepKey="seeConfirmationModal"/>
<click selector="{{AdminConfirmationModalSection.ok}}" stepKey="clickOkConfirmDelete"/>
<dontSee selector="{{AdminGridTableSection.backupNameColumn}}" userInput="{{backup.name}}" stepKey="dontSeeBackupInGrid"/>
Expand Down
6 changes: 5 additions & 1 deletion app/code/Magento/Backup/Test/Mftf/Data/BackupData.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,8 @@
<data key="name" unique="suffix">databaseBackup</data>
<data key="type">Database</data>
</entity>
</entities>
<entity name="WebSetupWizardBackup" type="backup">
<data key="name">WebSetupWizard</data>
<data key="type">Database</data>
</entity>
</entities>
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?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="VerifyProductTypeOrder">
<seeElement stepKey="seeBundleInOrder" selector="{{AdminProductDropdownOrderSection.bundleProduct}}"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
<section name="AdminProductDropdownOrderSection">
<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']"/>
</section>
</sections>
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@
<deleteData createDataKey="createPreReqCategory" stepKey="deletePreReqCategory"/>
<deleteData createDataKey="simpleProduct1" stepKey="deleteSimpleProduct1"/>
<deleteData createDataKey="simpleProduct2" stepKey="deleteSimpleProduct2"/>
<!-- Delete the bundled product we created in the test body -->
<actionGroup ref="deleteProductBySku" stepKey="deleteBundleProduct">
<argument name="sku" value="{{BundleProduct.sku}}"/>
</actionGroup>
<actionGroup ref="logout" stepKey="logout"/>
</after>
<!--Go to bundle product creation page-->
Expand Down
10 changes: 7 additions & 3 deletions app/code/Magento/Catalog/Api/ProductRenderListInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,22 @@
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/

namespace Magento\Catalog\Api;

/**
* Interface which provides product renders information for products
* Interface which provides product renders information for products.
*
* @api
* @since 101.1.0
*/
interface ProductRenderListInterface
{
/**
* Collect and retrieve the list of product render info
* This info contains raw prices and formated prices, product name, stock status, store_id, etc
* Collect and retrieve the list of product render info.
*
* This info contains raw prices and formatted prices, product name, stock status, store_id, etc.
*
* @see \Magento\Catalog\Api\Data\ProductRenderInfoDtoInterface
*
* @param \Magento\Framework\Api\SearchCriteriaInterface $searchCriteria
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,14 @@
*
* @author Magento Core Team <core@magentocommerce.com>
*/

namespace Magento\Catalog\Block\Product\View\Options;

use Magento\Catalog\Pricing\Price\CustomOptionPriceInterface;

/**
* Product aoptions section abstract block.
*
* @api
* @since 100.0.2
*/
Expand Down Expand Up @@ -46,7 +49,7 @@ abstract class AbstractOptions extends \Magento\Framework\View\Element\Template
/**
* @param \Magento\Framework\View\Element\Template\Context $context
* @param \Magento\Framework\Pricing\Helper\Data $pricingHelper
* @param \Magento\Catalog\Helper\Data $catalogData,
* @param \Magento\Catalog\Helper\Data $catalogData
* @param array $data
*/
public function __construct(
Expand Down Expand Up @@ -123,6 +126,8 @@ public function getFormattedPrice()
}

/**
* Retrieve formatted price.
*
* @return string
*
* @deprecated
Expand All @@ -134,7 +139,7 @@ public function getFormatedPrice()
}

/**
* Return formated price
* Return formatted price
*
* @param array $value
* @param bool $flag
Expand Down
30 changes: 28 additions & 2 deletions app/code/Magento/Catalog/Model/Category/Tree.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,27 +32,40 @@ class Tree
*/
protected $treeFactory;

/**
* @var \Magento\Catalog\Model\ResourceModel\Category\TreeFactory
*/
private $treeResourceFactory;

/**
* @param \Magento\Catalog\Model\ResourceModel\Category\Tree $categoryTree
* @param \Magento\Store\Model\StoreManagerInterface $storeManager
* @param \Magento\Catalog\Model\ResourceModel\Category\Collection $categoryCollection
* @param \Magento\Catalog\Api\Data\CategoryTreeInterfaceFactory $treeFactory
* @param \Magento\Catalog\Model\ResourceModel\Category\TreeFactory|null $treeResourceFactory
*/
public function __construct(
\Magento\Catalog\Model\ResourceModel\Category\Tree $categoryTree,
\Magento\Store\Model\StoreManagerInterface $storeManager,
\Magento\Catalog\Model\ResourceModel\Category\Collection $categoryCollection,
\Magento\Catalog\Api\Data\CategoryTreeInterfaceFactory $treeFactory
\Magento\Catalog\Api\Data\CategoryTreeInterfaceFactory $treeFactory,
\Magento\Catalog\Model\ResourceModel\Category\TreeFactory $treeResourceFactory = null
) {
$this->categoryTree = $categoryTree;
$this->storeManager = $storeManager;
$this->categoryCollection = $categoryCollection;
$this->treeFactory = $treeFactory;
$this->treeResourceFactory = $treeResourceFactory ?? \Magento\Framework\App\ObjectManager::getInstance()
->get(\Magento\Catalog\Model\ResourceModel\Category\TreeFactory::class);
}

/**
* Get root node by category.
*
* @param \Magento\Catalog\Model\Category|null $category
* @return Node|null
* @throws \Magento\Framework\Exception\LocalizedException
* @throws \Magento\Framework\Exception\NoSuchEntityException
*/
public function getRootNode($category = null)
{
Expand All @@ -71,21 +84,30 @@ public function getRootNode($category = null)
}

/**
* Get node by category.
*
* @param \Magento\Catalog\Model\Category $category
* @return Node
* @throws \Magento\Framework\Exception\LocalizedException
* @throws \Magento\Framework\Exception\NoSuchEntityException
*/
protected function getNode(\Magento\Catalog\Model\Category $category)
{
$nodeId = $category->getId();
$node = $this->categoryTree->loadNode($nodeId);
$categoryTree = $this->treeResourceFactory->create();
$node = $categoryTree->loadNode($nodeId);
$node->loadChildren();
$this->prepareCollection();
$this->categoryTree->addCollectionData($this->categoryCollection);
return $node;
}

/**
* Prepare category collection.
*
* @return void
* @throws \Magento\Framework\Exception\LocalizedException
* @throws \Magento\Framework\Exception\NoSuchEntityException
*/
protected function prepareCollection()
{
Expand All @@ -104,6 +126,8 @@ protected function prepareCollection()
}

/**
* Get tree by node.
*
* @param \Magento\Framework\Data\Tree\Node $node
* @param int $depth
* @param int $currentLevel
Expand All @@ -127,6 +151,8 @@ public function getTree($node, $depth = null, $currentLevel = 0)
}

/**
* Get node children.
*
* @param \Magento\Framework\Data\Tree\Node $node
* @param int $depth
* @param int $currentLevel
Expand Down
Loading

0 comments on commit 1356caa

Please sign in to comment.