Skip to content

Commit

Permalink
Merge branch '2.4-develop' into asi-1813
Browse files Browse the repository at this point in the history
  • Loading branch information
engcom-Golf authored Sep 9, 2020
2 parents f8fd731 + 20b7e0d commit a948194
Show file tree
Hide file tree
Showing 119 changed files with 1,256 additions and 397 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
use Magento\ImportExport\Model\Import\ErrorProcessing\ProcessingErrorAggregatorInterface;

/**
* Class AdvancedPricing
* Import advanced pricing class
*
* @SuppressWarnings(PHPMD.ExcessiveParameterList)
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
Expand All @@ -19,43 +19,27 @@
class AdvancedPricing extends \Magento\ImportExport\Model\Import\Entity\AbstractEntity
{
const VALUE_ALL_GROUPS = 'ALL GROUPS';

const VALUE_ALL_WEBSITES = 'All Websites';

const COL_SKU = 'sku';

const COL_TIER_PRICE_WEBSITE = 'tier_price_website';

const COL_TIER_PRICE_CUSTOMER_GROUP = 'tier_price_customer_group';

const COL_TIER_PRICE_QTY = 'tier_price_qty';

const COL_TIER_PRICE = 'tier_price';

const COL_TIER_PRICE_PERCENTAGE_VALUE = 'percentage_value';

const COL_TIER_PRICE_TYPE = 'tier_price_value_type';

const TIER_PRICE_TYPE_FIXED = 'Fixed';

const TIER_PRICE_TYPE_PERCENT = 'Discount';

const TABLE_TIER_PRICE = 'catalog_product_entity_tier_price';

const DEFAULT_ALL_GROUPS_GROUPED_PRICE_VALUE = '0';

const ENTITY_TYPE_CODE = 'advanced_pricing';

const VALIDATOR_MAIN = 'validator';

const VALIDATOR_WEBSITE = 'validator_website';

/**
* @deprecated
* @see VALIDATOR_TIER_PRICE
*/
private const VALIDATOR_TEAR_PRICE = 'validator_tier_price';

private const VALIDATOR_TIER_PRICE = 'validator_tier_price';

/**
Expand Down Expand Up @@ -176,10 +160,8 @@ class AdvancedPricing extends \Magento\ImportExport\Model\Import\Entity\Abstract
* @param \Magento\Framework\Json\Helper\Data $jsonHelper
* @param \Magento\ImportExport\Helper\Data $importExportData
* @param \Magento\ImportExport\Model\ResourceModel\Import\Data $importData
* @param \Magento\Eav\Model\Config $config
* @param \Magento\Framework\App\ResourceConnection $resource
* @param \Magento\ImportExport\Model\ResourceModel\Helper $resourceHelper
* @param \Magento\Framework\Stdlib\StringUtils $string
* @param ProcessingErrorAggregatorInterface $errorAggregator
* @param \Magento\Framework\Stdlib\DateTime\DateTime $dateTime
* @param \Magento\CatalogImportExport\Model\Import\Proxy\Product\ResourceModelFactory $resourceFactory
Expand All @@ -197,10 +179,8 @@ public function __construct(
\Magento\Framework\Json\Helper\Data $jsonHelper,
\Magento\ImportExport\Helper\Data $importExportData,
\Magento\ImportExport\Model\ResourceModel\Import\Data $importData,
\Magento\Eav\Model\Config $config,
\Magento\Framework\App\ResourceConnection $resource,
\Magento\ImportExport\Model\ResourceModel\Helper $resourceHelper,
\Magento\Framework\Stdlib\StringUtils $string,
ProcessingErrorAggregatorInterface $errorAggregator,
\Magento\Framework\Stdlib\DateTime\DateTime $dateTime,
\Magento\CatalogImportExport\Model\Import\Proxy\Product\ResourceModelFactory $resourceFactory,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
use Magento\CatalogImportExport\Model\Import\Product\RowValidatorInterface as RowValidatorInterface;
use Magento\CatalogImportExport\Model\Import\Product\StoreResolver;
use Magento\CatalogImportExport\Model\Import\Proxy\Product\ResourceModelFactory as ResourceFactory;
use Magento\Eav\Model\Config;
use Magento\Eav\Model\Entity\Type;
use Magento\Framework\App\ResourceConnection;
use Magento\Framework\DB\Adapter\AdapterInterface;
Expand All @@ -26,7 +25,6 @@
use Magento\Framework\Json\Helper\Data;
use Magento\Framework\Stdlib\DateTime\DateTime;
use Magento\Framework\Stdlib\DateTime\TimezoneInterface;
use Magento\Framework\Stdlib\StringUtils;
use Magento\ImportExport\Model\Import;
use Magento\ImportExport\Model\Import\ErrorProcessing\ProcessingErrorAggregatorInterface;
use Magento\ImportExport\Model\ResourceModel\Helper;
Expand Down Expand Up @@ -99,11 +97,6 @@ class AdvancedPricingTest extends AbstractImportTestCase
*/
protected $dataSourceModel;

/**
* @var Config
*/
protected $eavConfig;

/**
* @var TimezoneInterface|MockObject
*/
Expand Down Expand Up @@ -139,11 +132,6 @@ class AdvancedPricingTest extends AbstractImportTestCase
*/
protected $advancedPricing;

/**
* @var StringUtils
*/
protected $stringObject;

/**
* @var ProcessingErrorAggregatorInterface
*/
Expand All @@ -165,10 +153,8 @@ protected function setUp(): void
);
$this->resource->method('getConnection')->willReturn($this->connection);
$this->dataSourceModel = $this->createMock(\Magento\ImportExport\Model\ResourceModel\Import\Data::class);
$this->eavConfig = $this->createMock(Config::class);
$entityType = $this->createMock(Type::class);
$entityType->method('getEntityTypeId')->willReturn('');
$this->eavConfig->method('getEntityType')->willReturn($entityType);
$this->resourceFactory = $this->getMockBuilder(
\Magento\CatalogImportExport\Model\Import\Proxy\Product\ResourceModelFactory::class
)
Expand All @@ -193,7 +179,6 @@ protected function setUp(): void
$this->tierPriceValidator = $this->createMock(
TierPrice::class
);
$this->stringObject = $this->createMock(StringUtils::class);
$this->errorAggregator = $this->getErrorAggregatorObject();
$this->dateTime = $this->getMockBuilder(DateTime::class)
->disableOriginalConstructor()
Expand Down Expand Up @@ -1070,10 +1055,8 @@ private function getAdvancedPricingMock($methods = [])
$this->jsonHelper,
$this->importExportData,
$this->dataSourceModel,
$this->eavConfig,
$this->resource,
$this->resourceHelper,
$this->stringObject,
$this->errorAggregator,
$this->dateTime,
$this->resourceFactory,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,7 @@
<argument name="tags" value=""/>
</actionGroup>
<!--Open Index Management Page -->
<amOnPage url="{{AdminIndexManagementPage.url}}" stepKey="openIndexManagementPage"/>
<waitForPageLoad stepKey="waitForIndexPageToBeLoaded"/>
<actionGroup ref="AdminOpenIndexManagementPageActionGroup" stepKey="openIndexManagementPage"/>
<see stepKey="seeIndexStatus" selector="{{AdminIndexManagementSection.indexerStatus('Category Flat Data')}}" userInput="Ready"/>
<!--Verify Category In Store Front-->
<amOnPage url="/$$createCategory.name$$.html" stepKey="openCategoryPage1"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,7 @@
<actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache">
<argument name="tags" value=""/>
</actionGroup>
<!--Open Index Management Page -->
<amOnPage url="{{AdminIndexManagementPage.url}}" stepKey="openIndexManagementPage"/>
<waitForPageLoad stepKey="waitForIndexPageToBeLoaded"/>
<actionGroup ref="AdminOpenIndexManagementPageActionGroup" stepKey="openIndexManagementPage"/>
<see stepKey="seeIndexStatus" selector="{{AdminIndexManagementSection.indexerStatus('Category Flat Data')}}" userInput="Ready"/>
<!--Verify Category In Store Front-->
<amOnPage url="/$$createCategory.name$$.html" stepKey="openCategoryPage1"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,7 @@
<actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache">
<argument name="tags" value=""/>
</actionGroup>
<!--Open Index Management Page -->
<amOnPage url="{{AdminIndexManagementPage.url}}" stepKey="openIndexManagementPage"/>
<waitForPageLoad stepKey="waitForIndexPageToBeLoaded"/>
<actionGroup ref="AdminOpenIndexManagementPageActionGroup" stepKey="openIndexManagementPage"/>
<see stepKey="seeIndexStatus" selector="{{AdminIndexManagementSection.indexerStatus('Category Flat Data')}}" userInput="Ready"/>
<!--Verify Category In Store Front-->
<amOnPage url="/$$category.name$$.html" stepKey="openCategoryPage1"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@
<createData entity="_defaultCategory" stepKey="createSecondCategory"/>

<!-- Switch "Category Product" and "Product Category" indexers to "Update by Schedule" mode -->
<amOnPage url="{{AdminIndexManagementPage.url}}" stepKey="onIndexManagement"/>
<waitForPageLoad stepKey="waitForManagementPage"/>
<actionGroup ref="AdminOpenIndexManagementPageActionGroup" stepKey="onIndexManagement"/>

<actionGroup ref="AdminSwitchIndexerToActionModeActionGroup" stepKey="switchCategoryProduct">
<argument name="indexerValue" value="catalog_category_product"/>
Expand All @@ -38,8 +37,7 @@

<after>
<!-- Switch "Category Product" and "Product Category" indexers to "Update by Save" mode -->
<amOnPage url="{{AdminIndexManagementPage.url}}" stepKey="onIndexManagement"/>
<waitForPageLoad stepKey="waitForManagementPage"/>
<actionGroup ref="AdminOpenIndexManagementPageActionGroup" stepKey="onIndexManagement"/>

<actionGroup ref="AdminSwitchIndexerToActionModeActionGroup" stepKey="switchCategoryProduct">
<argument name="indexerValue" value="catalog_category_product"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,7 @@
<actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache">
<argument name="tags" value=""/>
</actionGroup>
<!--Open Index Management Page -->
<amOnPage url="{{AdminIndexManagementPage.url}}" stepKey="openIndexManagementPage"/>
<waitForPageLoad stepKey="waitForIndexPageToLoad"/>
<actionGroup ref="AdminOpenIndexManagementPageActionGroup" stepKey="openIndexManagementPage"/>
<see stepKey="seeCategoryIndexStatus" selector="{{AdminIndexManagementSection.indexerStatus('Category Flat Data')}}" userInput="Ready"/>
<!--Verify Product In Store Front-->
<amOnPage url="$$createSimpleProduct.name$$.html" stepKey="goToStorefrontPage"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,7 @@
<actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache">
<argument name="tags" value=""/>
</actionGroup>
<!--Open Index Management Page -->
<amOnPage url="{{AdminIndexManagementPage.url}}" stepKey="openIndexManagementPage"/>
<waitForPageLoad stepKey="waitForIndexPageToBeLoaded"/>
<actionGroup ref="AdminOpenIndexManagementPageActionGroup" stepKey="openIndexManagementPage"/>
<see stepKey="seeIndexStatus" selector="{{AdminIndexManagementSection.indexerStatus('Category Flat Data')}}" userInput="Ready"/>
<!--Verify Category In Store Front-->
<amOnPage url="/$$createCategory.name$$.html" stepKey="openCategoryPage1"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,7 @@
<actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache">
<argument name="tags" value=""/>
</actionGroup>
<!--Open Index Management Page -->
<amOnPage url="{{AdminIndexManagementPage.url}}" stepKey="openIndexManagementPage"/>
<waitForPageLoad stepKey="waitForIndexPageToLoad"/>
<actionGroup ref="AdminOpenIndexManagementPageActionGroup" stepKey="openIndexManagementPage"/>
<see stepKey="seeIndexStatus" selector="{{AdminIndexManagementSection.indexerStatus('Category Flat Data')}}" userInput="READY"/>
<!--Verify Category In Store Front-->
<amOnPage url="{{SimpleSubCategory.name}}.html" stepKey="goToStorefrontPage"/>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?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="AdminOpenCatalogSearchTermIndexPageActionGroup">
<annotations>
<description>Open catalog search term index page.</description>
</annotations>

<amOnPage url="{{AdminCatalogSearchTermIndexPage.url}}" stepKey="openCatalogSearchTermIndexPage"/>
<waitForPageLoad stepKey="waitForPageLoad"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@
<deleteData createDataKey="createCategory1" stepKey="deleteCategory1"/>

<!-- Delete all search terms -->
<amOnPage url="{{AdminCatalogSearchTermIndexPage.url}}" stepKey="openAdminCatalogSearchTermIndexPage"/>
<waitForPageLoad stepKey="waitForAdminCatalogSearchTermIndexPageLoad"/>
<actionGroup ref="AdminOpenCatalogSearchTermIndexPageActionGroup" stepKey="openAdminCatalogSearchTermIndexPage"/>
<comment userInput="Delete all search terms" stepKey="deleteAllSearchTermsComment"/>
<actionGroup ref="AdminDeleteAllSearchTermsActionGroup" stepKey="deleteAllSearchTerms"/>

Expand All @@ -53,8 +52,7 @@

<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin1"/>

<amOnPage url="{{AdminCatalogSearchTermIndexPage.url}}" stepKey="openAdminCatalogSearchTermIndexPage1"/>
<waitForPageLoad stepKey="waitForPageLoad1"/>
<actionGroup ref="AdminOpenCatalogSearchTermIndexPageActionGroup" stepKey="openAdminCatalogSearchTermIndexPage1"/>

<actionGroup ref="AdminSearchTermFilterBySearchQueryActionGroup" stepKey="filterByFirstSearchQuery1">
<argument name="searchQuery" value="$$createProduct1.name$$"/>
Expand All @@ -67,8 +65,7 @@
<argument name="searchTerm" value="UpdatedSearchTermData1"/>
</actionGroup>

<amOnPage url="{{AdminCatalogSearchTermIndexPage.url}}" stepKey="openAdminCatalogSearchTermIndexPage2"/>
<waitForPageLoad stepKey="waitForPageLoad3"/>
<actionGroup ref="AdminOpenCatalogSearchTermIndexPageActionGroup" stepKey="openAdminCatalogSearchTermIndexPage2"/>

<actionGroup ref="AdminSearchTermFilterBySearchQueryActionGroup" stepKey="filterByFirstSearchQuery2">
<argument name="searchQuery" value="{{UpdatedSearchTermData1.query_text}}"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ protected function _construct()
'type' => 'button'
],
0,
0,
100,
'header'
);
}
Expand Down
11 changes: 7 additions & 4 deletions app/code/Magento/Customer/Observer/AfterAddressSaveObserver.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
declare(strict_types=1);

namespace Magento\Customer\Observer;

Expand All @@ -17,6 +18,7 @@
use Magento\Framework\App\State as AppState;
use Magento\Framework\DataObject;
use Magento\Framework\Escaper;
use Magento\Framework\Event\Observer;
use Magento\Framework\Event\ObserverInterface;
use Magento\Framework\Message\ManagerInterface;
use Magento\Framework\Registry;
Expand All @@ -25,6 +27,7 @@
/**
* Customer Observer Model
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
* @SuppressWarnings(PHPMD.CookieAndSessionMisuse)
*/
class AfterAddressSaveObserver implements ObserverInterface
{
Expand Down Expand Up @@ -114,11 +117,11 @@ public function __construct(
/**
* Address after save event handler
*
* @param \Magento\Framework\Event\Observer $observer
* @param Observer $observer
* @return void
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
*/
public function execute(\Magento\Framework\Event\Observer $observer)
public function execute(Observer $observer)
{
/** @var $customerAddress Address */
$customerAddress = $observer->getCustomerAddress();
Expand Down Expand Up @@ -280,7 +283,7 @@ protected function addInvalidMessage($customerAddress)
$message[] = (string)__('You will be charged tax.');
}

$this->messageManager->addError(implode(' ', $message));
$this->messageManager->addErrorMessage(implode(' ', $message));

return $this;
}
Expand All @@ -307,7 +310,7 @@ protected function addErrorMessage($customerAddress)
$email = $this->scopeConfig->getValue('trans_email/ident_support/email', ScopeInterface::SCOPE_STORE);
$message[] = (string)__('If you believe this is an error, please contact us at %1', $email);

$this->messageManager->addError(implode(' ', $message));
$this->messageManager->addErrorMessage(implode(' ', $message));

return $this;
}
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="AssertStorefrontCustomerLogoutSuccessPageActionGroup">
<annotations>
<description>Assert on the Storefront Customer Logout Success Page page.</description>
</annotations>

<seeInCurrentUrl url="{{StorefrontCustomerLogoutSuccessPage.url}}" stepKey="seeOnSignInPage"/>
</actionGroup>
</actionGroups>
Loading

0 comments on commit a948194

Please sign in to comment.