Skip to content

Commit

Permalink
Merge branch '2.4-develop' into fix-CategoryWithOverriddenUrlKey
Browse files Browse the repository at this point in the history
  • Loading branch information
swnsma authored Jul 21, 2020
2 parents 54457b4 + 2841088 commit aea1d8e
Show file tree
Hide file tree
Showing 1,147 changed files with 34,826 additions and 5,720 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,25 @@
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/

declare(strict_types=1);

namespace Magento\AdvancedPricingImportExport\Model\Import\AdvancedPricing\Validator;

use Magento\AdvancedPricingImportExport\Model\Import\AdvancedPricing;
use Magento\CatalogImportExport\Model\Import\Product;
use Magento\CatalogImportExport\Model\Import\Product\RowValidatorInterface;
use Magento\CatalogImportExport\Model\Import\Product\StoreResolver;
use Magento\CatalogImportExport\Model\Import\Product\Validator\AbstractImportValidator;
use Magento\CatalogImportExport\Model\Import\Product\Validator\AbstractPrice;
use Magento\Customer\Api\GroupRepositoryInterface;
use Magento\Framework\Api\SearchCriteriaBuilder;
use Magento\Framework\Exception\LocalizedException;

class TierPrice extends \Magento\CatalogImportExport\Model\Import\Product\Validator\AbstractPrice
class TierPrice extends AbstractPrice
{
/**
* @var \Magento\CatalogImportExport\Model\Import\Product\StoreResolver
* @var StoreResolver
*/
protected $storeResolver;

Expand All @@ -27,21 +37,26 @@ class TierPrice extends \Magento\CatalogImportExport\Model\Import\Product\Valida
];

/**
* @param \Magento\Customer\Api\GroupRepositoryInterface $groupRepository
* @param \Magento\Framework\Api\SearchCriteriaBuilder $searchCriteriaBuilder
* @param \Magento\CatalogImportExport\Model\Import\Product\StoreResolver $storeResolver
* @param GroupRepositoryInterface $groupRepository
* @param SearchCriteriaBuilder $searchCriteriaBuilder
* @param StoreResolver $storeResolver
*/
public function __construct(
\Magento\Customer\Api\GroupRepositoryInterface $groupRepository,
\Magento\Framework\Api\SearchCriteriaBuilder $searchCriteriaBuilder,
\Magento\CatalogImportExport\Model\Import\Product\StoreResolver $storeResolver
GroupRepositoryInterface $groupRepository,
SearchCriteriaBuilder $searchCriteriaBuilder,
StoreResolver $storeResolver
) {
$this->storeResolver = $storeResolver;
parent::__construct($groupRepository, $searchCriteriaBuilder);
}

/**
* {@inheritdoc}
* Initialize method
*
* @param Product $context
*
* @return RowValidatorInterface|AbstractImportValidator|void
* @throws LocalizedException
*/
public function init($context)
{
Expand All @@ -52,7 +67,10 @@ public function init($context)
}

/**
* Add decimal error
*
* @param string $attribute
*
* @return void
*/
protected function addDecimalError($attribute)
Expand Down Expand Up @@ -83,12 +101,12 @@ public function getCustomerGroups()
}

/**
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
* Validation
*
* @param mixed $value
* @return bool
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
*/
public function isValid($value)
{
Expand Down Expand Up @@ -133,6 +151,7 @@ public function isValid($value)
* Check if at list one value and length are valid
*
* @param array $value
*
* @return bool
*/
protected function isValidValueAndLength(array $value)
Expand All @@ -150,6 +169,7 @@ protected function isValidValueAndLength(array $value)
* Check if value has empty columns
*
* @param array $value
*
* @return bool
*/
protected function hasEmptyColumns(array $value)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,24 @@
* See COPYING.txt for license details.
*/

declare(strict_types=1);

namespace Magento\AdvancedPricingImportExport\Model\Import\AdvancedPricing\Validator;

use Magento\AdvancedPricingImportExport\Model\Import\AdvancedPricing;
use Magento\CatalogImportExport\Model\Import\Product\RowValidatorInterface;
use Magento\CatalogImportExport\Model\Import\Product\Validator\AbstractImportValidator;

/**
* Class TierPriceType validates tier price type.
*/
class TierPriceType extends \Magento\CatalogImportExport\Model\Import\Product\Validator\AbstractImportValidator
class TierPriceType extends AbstractImportValidator
{
/**
* {@inheritdoc}
*/
public function init($context)
{
return parent::init($context);
}

/**
* Validate tier price type.
*
* @param array $value
*
* @return bool
*/
public function isValid($value)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,49 +3,47 @@
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/

declare(strict_types=1);

namespace Magento\AdvancedPricingImportExport\Model\Import\AdvancedPricing\Validator;

use Magento\AdvancedPricingImportExport\Model\Import\AdvancedPricing;
use Magento\CatalogImportExport\Model\Import\Product\Validator\AbstractImportValidator;
use Magento\CatalogImportExport\Model\Import\Product\RowValidatorInterface;
use Magento\CatalogImportExport\Model\Import\Product\StoreResolver;
use Magento\CatalogImportExport\Model\Import\Product\Validator\AbstractImportValidator;
use Magento\Store\Model\Website as WebsiteModel;

class Website extends AbstractImportValidator implements RowValidatorInterface
{
/**
* @var \Magento\CatalogImportExport\Model\Import\Product\StoreResolver
* @var StoreResolver
*/
protected $storeResolver;

/**
* @var \Magento\Store\Model\Website
* @var WebsiteModel
*/
protected $websiteModel;

/**
* @param \Magento\CatalogImportExport\Model\Import\Product\StoreResolver $storeResolver
* @param \Magento\Store\Model\Website $websiteModel
* @param StoreResolver $storeResolver
* @param WebsiteModel $websiteModel
*/
public function __construct(
\Magento\CatalogImportExport\Model\Import\Product\StoreResolver $storeResolver,
\Magento\Store\Model\Website $websiteModel
StoreResolver $storeResolver,
WebsiteModel $websiteModel
) {
$this->storeResolver = $storeResolver;
$this->websiteModel = $websiteModel;
}

/**
* {@inheritdoc}
*/
public function init($context)
{
return parent::init($context);
}

/**
* Validate by website type
*
* @param array $value
* @param string $websiteCode
*
* @return bool
*/
protected function isWebsiteValid($value, $websiteCode)
Expand All @@ -62,7 +60,8 @@ protected function isWebsiteValid($value, $websiteCode)
/**
* Validate value
*
* @param mixed $value
* @param array $value
*
* @return bool
*/
public function isValid($value)
Expand All @@ -85,6 +84,7 @@ public function isValid($value)
*/
public function getAllWebsitesValue()
{
return AdvancedPricing::VALUE_ALL_WEBSITES . ' ['.$this->websiteModel->getBaseCurrency()->getCurrencyCode().']';
return AdvancedPricing::VALUE_ALL_WEBSITES .
' [' . $this->websiteModel->getBaseCurrency()->getCurrencyCode() . ']';
}
}
10 changes: 9 additions & 1 deletion app/code/Magento/AsynchronousOperations/Model/MassConsumer.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,19 @@ public function process($maxNumberOfMessages = null)
$this->registry->register('isSecureArea', true, true);

$queue = $this->configuration->getQueue();
$maxIdleTime = $this->configuration->getMaxIdleTime();
$sleep = $this->configuration->getSleep();

if (!isset($maxNumberOfMessages)) {
$queue->subscribe($this->getTransactionCallback($queue));
} else {
$this->invoker->invoke($queue, $maxNumberOfMessages, $this->getTransactionCallback($queue));
$this->invoker->invoke(
$queue,
$maxNumberOfMessages,
$this->getTransactionCallback($queue),
$maxIdleTime,
$sleep
);
}

$this->registry->unregister('isSecureArea');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ public function testSaveRelNoResources()
/**
* Test LocalizedException throw case.
*/
public function testLocalizedExceptionOccurance()
public function testLocalizedExceptionOccurrence()
{
$this->expectException(LocalizedException::class);
$this->expectExceptionMessage("TestException");
Expand Down Expand Up @@ -212,7 +212,7 @@ public function testLocalizedExceptionOccurance()
/**
* Test generic exception throw case.
*/
public function testGenericExceptionOccurance()
public function testGenericExceptionOccurrence()
{
$exception = new \Exception('GenericException');

Expand Down
10 changes: 5 additions & 5 deletions app/code/Magento/Backend/Test/Mftf/Section/AdminMenuSection.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
<element name="widgets" type="button" selector="#nav li[data-ui-id='menu-magento-widget-cms-widget-instance']"/>
<element name="stores" type="button" selector="#menu-magento-backend-stores"/>
<element name="configuration" type="button" selector="#nav li[data-ui-id='menu-magento-config-system-config']"/>
<element name="dashboard" type="button" selector="//li[@id='menu-magento-backend-dashboard']"/>
<element name="sales" type="button" selector="//li[@id='menu-magento-sales-sales']"/>
<element name="marketing" type="button" selector="//li[@id='menu-magento-backend-marketing']"/>
<element name="system" type="button" selector="//li[@id='menu-magento-backend-system']"/>
<element name="findPartners" type="button" selector="//li[@id='menu-magento-marketplace-partners']"/>
<element name="dashboard" type="button" selector="#menu-magento-backend-dashboard"/>
<element name="sales" type="button" selector="#menu-magento-sales-sales"/>
<element name="marketing" type="button" selector="#menu-magento-backend-marketing"/>
<element name="system" type="button" selector="#menu-magento-backend-system"/>
<element name="findPartners" type="button" selector="#menu-magento-marketplace-partners"/>

<!-- Navigate menu selectors -->
<element name="menuItem" type="button" selector="li[data-ui-id='menu-{{dataUiId}}']" parameterized="true" timeout="30"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,7 @@
</actionGroup>

<!--Navigate to Product attribute page-->
<amOnPage url="{{ProductAttributePage.url}}" stepKey="navigateToNewProductAttributePage"/>
<waitForPageLoad stepKey="waitForPageLoad"/>
<actionGroup ref="AdminNavigateToNewProductAttributePageActionGroup" stepKey="navigateToNewProductAttributePage"/>
<fillField userInput="test_label" selector="{{AttributePropertiesSection.DefaultLabel}}" stepKey="fillDefaultLabel"/>
<selectOption selector="{{AttributePropertiesSection.InputType}}" userInput="Text Swatch" stepKey="selectInputType"/>
<click selector="{{AttributePropertiesSection.addSwatch}}" stepKey="clickAddSwatch"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,11 @@
<waitForPageLoad stepKey="waitForInvoicePageToLoad"/>
<see selector="{{AdminHeaderSection.pageTitle}}" userInput="New Invoice" stepKey="seeNewInvoiceInPageTitle" after="clickInvoiceButton"/>
<see selector="{{AdminInvoiceTotalSection.total('Subtotal')}}" userInput="$150.00" stepKey="seeCorrectGrandTotal"/>
<click selector="{{AdminInvoiceMainActionsSection.submitInvoice}}" stepKey="clickSubmitInvoice"/>
<actionGroup ref="AdminInvoiceClickSubmitActionGroup" stepKey="clickSubmitInvoice"/>
<see selector="{{AdminOrderDetailsMessagesSection.successMessage}}" userInput="The invoice has been created." stepKey="seeSuccessInvoiceMessage"/>
<!--Create Shipment for the order-->
<comment userInput="Create Shipment for the order" stepKey="createShipmentForOrder"/>
<amOnPage url="{{AdminOrdersPage.url}}" stepKey="onOrdersPage2"/>
<waitForPageLoad time="30" stepKey="waitForOrderListPageLoading"/>
<actionGroup ref="AdminOrdersPageOpenActionGroup" stepKey="onOrdersPage2"/>
<actionGroup ref="AdminOrderGridClickFirstRowActionGroup" stepKey="openOrderPageForShip"/>
<click selector="{{AdminOrderDetailsMainActionsSection.ship}}" stepKey="clickShipAction"/>
<waitForPageLoad stepKey="waitForShipmentPagePage"/>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?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="AssertStorefrontBundleValidationMessageActionGroup">
<annotations>
<description>Check error message in validation message box</description>
</annotations>
<arguments>
<argument name="message" type="string"/>
</arguments>

<waitForPageLoad stepKey="waitForPageLoad"/>
<see selector="{{StorefrontBundledSection.validationMessageBox}}" userInput="{{message}}" stepKey="seeErrorHoldMessage"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?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="AssertStorefrontBundleValidationMessagesCountActionGroup">
<annotations>
<description>Check if there's a validation message box on page and asserts the validation messages number</description>
</annotations>

<waitForPageLoad stepKey="waitForPageLoad"/>
<seeElement selector="{{StorefrontBundledSection.validationMessageBox}}" stepKey="seeErrorBox"/>
<seeNumberOfElements selector="{{StorefrontBundledSection.validationMessageBox}}" userInput="1" stepKey="seeOneErrorBox"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?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="StorefrontAddToTheCartButtonActionGroup">
<annotations>
<description>Clicks 'Add to Cart' on a Storefront Bundled Product page.</description>
</annotations>

<waitForPageLoad stepKey="waitForPageLoad"/>
<waitForElementVisible selector="{{StorefrontBundleProductActionSection.addToCartButton}}" stepKey="waitForAddToCartButton"/>
<click selector="{{StorefrontBundleProductActionSection.addToCartButton}}" stepKey="clickOnAddToCartButton"/>
</actionGroup>
</actionGroups>
Loading

0 comments on commit aea1d8e

Please sign in to comment.