Skip to content

Commit

Permalink
Merge branch '2.4-develop' into paypalflowpro-graphql
Browse files Browse the repository at this point in the history
  • Loading branch information
Usik2203 authored Jul 14, 2020
2 parents c28747d + fa6d291 commit 6596e65
Show file tree
Hide file tree
Showing 219 changed files with 2,772 additions and 1,281 deletions.
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() . ']';
}
}
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

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<magentoCron stepKey="runCronIndex" groups="index"/>
</before>
<after>
<amOnPage url="{{AdminLogoutPage.url}}" stepKey="amOnLogoutPage"/>
<actionGroup ref="AdminLogoutActionGroup" stepKey="amOnLogoutPage"/>
<deleteData createDataKey="simpleProduct1" stepKey="deleteSimpleProduct1"/>
<deleteData createDataKey="simpleProduct2" stepKey="deleteSimpleProduct2"/>
</after>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
</before>
<after>
<amOnPage url="{{AdminLogoutPage.url}}" stepKey="amOnLogoutPage"/>
<actionGroup ref="AdminLogoutActionGroup" stepKey="amOnLogoutPage"/>
</after>
<!-- Create a new attribute set -->
<amOnPage url="{{AdminProductAttributeSetGridPage.url}}" stepKey="goToAttributeSets"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
</before>
<after>
<amOnPage url="{{AdminLogoutPage.url}}" stepKey="amOnLogoutPage"/>
<actionGroup ref="AdminLogoutActionGroup" stepKey="amOnLogoutPage"/>
</after>
<!--Create attribute set-->
<actionGroup ref="CreateDefaultAttributeSetActionGroup" stepKey="createDefaultAttributeSet">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<magentoCron stepKey="runCronIndex" groups="index"/>
</before>
<after>
<amOnPage url="{{AdminLogoutPage.url}}" stepKey="amOnLogoutPage"/>
<actionGroup ref="AdminLogoutActionGroup" stepKey="amOnLogoutPage"/>
<deleteData createDataKey="simpleProduct1" stepKey="deleteSimpleProduct1"/>
<deleteData createDataKey="simpleProduct2" stepKey="deleteSimpleProduct2"/>
</after>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
<argument name="product" value="BundleProduct"/>
</actionGroup>
<!--Logging out-->
<amOnPage url="{{AdminLogoutPage.url}}" stepKey="amOnLogoutPage"/>
<actionGroup ref="AdminLogoutActionGroup" stepKey="amOnLogoutPage"/>
<deleteData createDataKey="simpleProduct0" stepKey="deleteSimpleProduct0"/>
<deleteData createDataKey="simpleProduct1" stepKey="deleteSimpleProduct1"/>
</after>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<magentoCron stepKey="runCronIndex" groups="index"/>
</before>
<after>
<amOnPage url="{{AdminLogoutPage.url}}" stepKey="amOnLogoutPage"/>
<actionGroup ref="AdminLogoutActionGroup" stepKey="amOnLogoutPage"/>
<deleteData createDataKey="simpleProduct1" stepKey="deleteSimpleProduct1"/>
<deleteData createDataKey="simpleProduct2" stepKey="deleteSimpleProduct2"/>
</after>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<after>
<!--Clear Filters-->
<actionGroup ref="AdminClearFiltersActionGroup" stepKey="ClearFiltersAfter"/>
<amOnPage url="{{AdminLogoutPage.url}}" stepKey="amOnLogoutPage"/>
<actionGroup ref="AdminLogoutActionGroup" stepKey="amOnLogoutPage"/>
<deleteData createDataKey="simpleProduct1" stepKey="deleteSimpleProduct1"/>
<deleteData createDataKey="simpleProduct2" stepKey="deleteSimpleProduct2"/>
<deleteData createDataKey="simpleProduct3" stepKey="deleteSimpleProduct3"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<actionGroup ref="DeleteProductBySkuActionGroup" stepKey="deleteBundleProduct">
<argument name="sku" value="{{BundleProduct.sku}}"/>
</actionGroup>
<amOnPage url="{{AdminLogoutPage.url}}" stepKey="amOnLogoutPage"/>
<actionGroup ref="AdminLogoutActionGroup" stepKey="amOnLogoutPage"/>
<deleteData createDataKey="simpleProduct1" stepKey="deleteSimpleProduct1"/>
<deleteData createDataKey="simpleProduct2" stepKey="deleteSimpleProduct2"/>
</after>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
<actionGroup ref="AdminDeleteCustomerActionGroup" stepKey="deleteCustomer">
<argument name="customerEmail" value="CustomerEntityOne.email"/>
</actionGroup>
<amOnPage url="{{AdminLogoutPage.url}}" stepKey="logout"/>
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
</after>
<amOnPage url="{{AdminProductCreatePage.url(BundleProduct.set, BundleProduct.type)}}" stepKey="goToBundleProductCreationPage"/>
<waitForPageLoad stepKey="waitForBundleProductCreatePageToLoad"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
<click selector="{{CurrencySetupSection.currencyOptions}}" stepKey="closeOptions"/>
<waitForPageLoad stepKey="waitForCloseOptions"/>
<click stepKey="saveUnselectedConfigs" selector="{{AdminConfigSection.saveButton}}"/>
<amOnPage url="{{AdminLogoutPage.url}}" stepKey="logout"/>
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
<deleteData createDataKey="simpleProduct1" stepKey="deleteSimpleProduct1"/>
<deleteData createDataKey="simpleProduct2" stepKey="deleteSimpleProduct2"/>
</after>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<after>
<!--Clear Filters-->
<actionGroup ref="AdminClearFiltersActionGroup" stepKey="ClearFiltersAfter"/>
<amOnPage url="{{AdminLogoutPage.url}}" stepKey="amOnLogoutPage"/>
<actionGroup ref="AdminLogoutActionGroup" stepKey="amOnLogoutPage"/>
<deleteData createDataKey="simpleProduct1" stepKey="deleteSimpleProduct1"/>
<deleteData createDataKey="simpleProduct2" stepKey="deleteSimpleProduct2"/>
<deleteData createDataKey="simpleProduct3" stepKey="deleteSimpleProduct3"/>
Expand Down Expand Up @@ -130,8 +130,7 @@
<dontSeeElement stepKey="LookingForNameOfProductDisabled" selector="{{StorefrontBundledSection.bundleProductName}}"/>

<!--Enabling bundle products-->
<amOnPage url="{{ProductCatalogPage.url}}" stepKey="GoToCatalogPageChangingView"/>
<waitForPageLoad stepKey="WaitForPageToLoadFullyChangingView"/>
<actionGroup ref="AdminProductCatalogPageOpenActionGroup" stepKey="goToCatalogPageChangingView"/>
<click selector="{{AdminProductFiltersSection.allCheckbox}}" stepKey="ClickOnSelectAllCheckBoxChangingView"/>
<click selector="{{AdminProductFiltersSection.actions}}" stepKey="ClickOnActionsChangingView"/>
<click selector="{{AdminProductFiltersSection.changeStatus}}" stepKey="ClickOnChangeStatusChangingView"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
</before>
<after>
<amOnPage url="{{AdminLogoutPage.url}}" stepKey="amOnLogoutPage"/>
<actionGroup ref="AdminLogoutActionGroup" stepKey="amOnLogoutPage"/>
</after>
<amOnPage url="{{AdminCatalogProductPage.url}}" stepKey="GoToCatalogProductPage"/>
<waitForPageLoad stepKey="WaitForPageToLoad"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<magentoCron stepKey="runCronIndex" groups="index"/>
</before>
<after>
<amOnPage url="{{AdminLogoutPage.url}}" stepKey="amOnLogoutPage"/>
<actionGroup ref="AdminLogoutActionGroup" stepKey="amOnLogoutPage"/>
<deleteData createDataKey="simpleProduct1" stepKey="deleteSimpleProduct1"/>
<deleteData createDataKey="simpleProduct2" stepKey="deleteSimpleProduct2"/>
</after>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<createData entity="SimpleProduct2" stepKey="simpleProduct2"/>
</before>
<after>
<amOnPage url="{{AdminLogoutPage.url}}" stepKey="logout"/>
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
<deleteData createDataKey="simpleProduct1" stepKey="deleteSimpleProduct1"/>
<deleteData createDataKey="simpleProduct2" stepKey="deleteSimpleProduct2"/>
</after>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<magentoCron stepKey="runCronIndex" groups="index"/>
</before>
<after>
<amOnPage url="{{AdminLogoutPage.url}}" stepKey="logout"/>
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
<deleteData createDataKey="simpleProduct1" stepKey="deleteSimpleProduct1"/>
<deleteData createDataKey="simpleProduct2" stepKey="deleteSimpleProduct2"/>
</after>
Expand Down
Loading

0 comments on commit 6596e65

Please sign in to comment.