Skip to content

Commit

Permalink
Merge branch '2.4-develop' into patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
pmzandbergen committed Aug 15, 2020
2 parents 9db1f83 + 2dc2a50 commit d61e030
Show file tree
Hide file tree
Showing 191 changed files with 7,982 additions and 1,875 deletions.
36 changes: 24 additions & 12 deletions app/autoload.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,36 +5,48 @@
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
declare(strict_types=1);

use Magento\Framework\Autoload\AutoloaderRegistry;
use Magento\Framework\Autoload\ClassLoaderWrapper;

/**
* Shortcut constant for the root directory
*/
define('BP', dirname(__DIR__));
\define('BP', \dirname(__DIR__));

define('VENDOR_PATH', BP . '/app/etc/vendor_path.php');
\define('VENDOR_PATH', BP . '/app/etc/vendor_path.php');

if (!file_exists(VENDOR_PATH)) {
if (!\is_readable(VENDOR_PATH)) {
throw new \Exception(
'We can\'t read some files that are required to run the Magento application. '
. 'This usually means file permissions are set incorrectly.'
);
}

$vendorDir = require VENDOR_PATH;
$vendorAutoload = BP . "/{$vendorDir}/autoload.php";
$vendorAutoload = (
static function (): ?string {
$vendorDir = require VENDOR_PATH;

$vendorAutoload = BP . "/{$vendorDir}/autoload.php";
if (\is_readable($vendorAutoload)) {
return $vendorAutoload;
}

$vendorAutoload = "{$vendorDir}/autoload.php";
if (\is_readable($vendorAutoload)) {
return $vendorAutoload;
}

return null;
}
)();

/* 'composer install' validation */
if (file_exists($vendorAutoload)) {
$composerAutoloader = include $vendorAutoload;
} else if (file_exists("{$vendorDir}/autoload.php")) {
$vendorAutoload = "{$vendorDir}/autoload.php";
$composerAutoloader = include $vendorAutoload;
} else {
if ($vendorAutoload === null) {
throw new \Exception(
'Vendor autoload is not found. Please run \'composer install\' under application root directory.'
);
}

$composerAutoloader = include $vendorAutoload;
AutoloaderRegistry::registerAutoloader(new ClassLoaderWrapper($composerAutoloader));
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ protected function _getCurrencyList()
/**
* Retrieve filter value
*
* @param null $index
* @param string|null $index
* @return array|null
*/
public function getValue($index = null)
Expand Down Expand Up @@ -194,11 +194,11 @@ public function getCondition()
$rate = $this->_getRate($displayCurrency, $this->_getColumnCurrencyCode());

if (isset($value['from'])) {
$value['from'] *= $rate;
$value['from'] = (float) $value['from'] * $rate;
}

if (isset($value['to'])) {
$value['to'] *= $rate;
$value['to'] = (float) $value['to'] * $rate;
}

$this->prepareRates($displayCurrency);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,7 @@
<waitForLoadingMaskToDisappear stepKey="waitForLoadingCheckoutPageWithShippingMethod"/>
<click selector="{{CheckoutShippingMethodsSection.firstShippingMethod}}" stepKey="selectFirstShippingMethod"/>
<waitForLoadingMaskToDisappear stepKey="waitForLoadingMask1"/>
<waitForElement selector="{{CheckoutShippingMethodsSection.next}}" time="30" stepKey="waitForNextButton"/>
<click selector="{{CheckoutShippingMethodsSection.next}}" stepKey="clickNext"/>
<actionGroup ref="StorefrontCheckoutClickNextButtonActionGroup" stepKey="clickNext"/>
<!-- Checkout select Check/Money Order payment -->
<comment userInput="Select Check/Money payment" stepKey="checkoutSelectCheckMoneyPayment"/>
<actionGroup ref="CheckoutSelectCheckMoneyOrderPaymentActionGroup" stepKey="selectCheckMoneyPayment"/>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
declare(strict_types=1);

namespace Magento\Backend\Test\Unit\Block\Widget\Grid\Column\Filter;

use Magento\Backend\Block\Context;
use Magento\Backend\Block\Widget\Grid\Column;
use Magento\Backend\Block\Widget\Grid\Column\Filter\Price;
use Magento\Framework\App\RequestInterface;
use Magento\Framework\DB\Helper;
use Magento\Directory\Model\Currency;
use Magento\Directory\Model\Currency\DefaultLocator;
use Magento\Framework\TestFramework\Unit\Helper\ObjectManager;
use PHPUnit\Framework\MockObject\MockObject;
use PHPUnit\Framework\TestCase;

class PriceTest extends TestCase
{
/** @var RequestInterface|MockObject */
private $requestMock;

/** @var Context|MockObject */
private $context;

/** @var Helper|MockObject */
private $helper;

/** @var Currency|MockObject */
private $currency;

/** @var DefaultLocator|MockObject */
private $currencyLocator;

/** @var Column|MockObject */
private $columnMock;

/** @var Price */
private $blockPrice;

protected function setUp(): void
{
$this->requestMock = $this->getMockForAbstractClass(RequestInterface::class);

$this->context = $this->createMock(Context::class);
$this->context->expects($this->any())->method('getRequest')->willReturn($this->requestMock);

$this->helper = $this->createMock(Helper::class);

$this->currency = $this->getMockBuilder(Currency::class)
->disableOriginalConstructor()
->setMethods(['getAnyRate'])
->getMock();

$this->currencyLocator = $this->createMock(DefaultLocator::class);

$this->columnMock = $this->getMockBuilder(Column::class)
->disableOriginalConstructor()
->setMethods(['getCurrencyCode'])
->getMock();

$helper = new ObjectManager($this);

$this->blockPrice = $helper->getObject(Price::class, [
'context' => $this->context,
'resourceHelper' => $this->helper,
'currencyModel' => $this->currency,
'currencyLocator' => $this->currencyLocator
]);
$this->blockPrice->setColumn($this->columnMock);
}

public function testGetCondition()
{
$this->currencyLocator->expects(
$this->any()
)->method(
'getDefaultCurrency'
)->with(
$this->requestMock
)->willReturn(
'defaultCurrency'
);

$this->currency->expects($this->at(0))
->method('getAnyRate')
->with('defaultCurrency')
->willReturn(1.0);

$testValue = [
'value' => [
'from' => '1234a',
]
];

$this->blockPrice->addData($testValue);
$this->assertEquals(['from' => 1234], $this->blockPrice->getCondition());
}
}
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="AdminClickAddProductToOptionActionGroup">
<annotations>
<description>Click AddProductToOption button for bundle product.</description>
</annotations>

<waitForElementVisible selector="{{AdminProductFormBundleSection.addProductsToOption}}" stepKey="waitForAddProductsToBundle"/>
<click selector="{{AdminProductFormBundleSection.addProductsToOption}}" stepKey="clickAddProductsToOption"/>
<waitForPageLoad stepKey="waitForPageLoadAfterBundleProducts"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,7 @@
<waitForElementVisible selector="{{AdminProductFormBundleSection.bundleOptionXTitle('0')}}" stepKey="waitForBundleOptions"/>
<fillField selector="{{AdminProductFormBundleSection.bundleOptionXTitle('0')}}" userInput="{{BundleProduct.optionTitle1}}" stepKey="fillOptionTitle"/>
<selectOption selector="{{AdminProductFormBundleSection.bundleOptionXInputType('0')}}" userInput="{{BundleProduct.optionInputType1}}" stepKey="selectInputType"/>
<waitForElementVisible selector="{{AdminProductFormBundleSection.addProductsToOption}}" stepKey="waitForAddProductsToBundle"/>
<click selector="{{AdminProductFormBundleSection.addProductsToOption}}" stepKey="clickAddProductsToOption"/>
<waitForPageLoad stepKey="waitForPageLoadAfterBundleProducts"/>
<actionGroup ref="AdminClickAddProductToOptionActionGroup" stepKey="clickAddProductsToOption"/>
<actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterBundleProductOptions">
<argument name="product" value="$$simpleProduct0$$"/>
</actionGroup>
Expand Down Expand Up @@ -101,9 +99,7 @@
<waitForElementVisible selector="{{AdminProductFormBundleSection.bundleOptionXTitle('1')}}" stepKey="waitForBundleOptionsToAppear"/>
<fillField selector="{{AdminProductFormBundleSection.bundleOptionXTitle('1')}}" userInput="{{BundleProduct.optionTitle1}}" stepKey="fillNewestOptionTitle"/>
<selectOption selector="{{AdminProductFormBundleSection.bundleOptionXInputType('1')}}" userInput="{{BundleProduct.optionInputType1}}" stepKey="selectNewInputType"/>
<waitForElementVisible selector="{{AdminProductFormBundleSection.addProductsToOption}}" stepKey="waitForAddProductsToNewBundle"/>
<click selector="{{AdminProductFormBundleSection.addProductsToOption}}" stepKey="clickAddProductsToNewOption"/>
<waitForPageLoad stepKey="waitForPageLoadAfterNewBundleProducts"/>
<actionGroup ref="AdminClickAddProductToOptionActionGroup" stepKey="clickAddProductsToNewOption"/>
<actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterNewBundleProductOptions">
<argument name="product" value="$$simpleProduct2$$"/>
</actionGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,7 @@
<waitForElementVisible selector="{{AdminProductFormBundleSection.bundleOptionXTitle('0')}}" stepKey="waitForBundleOptions"/>
<fillField selector="{{AdminProductFormBundleSection.bundleOptionXTitle('0')}}" userInput="{{BundleProduct.optionTitle1}}" stepKey="fillOptionTitle"/>
<selectOption selector="{{AdminProductFormBundleSection.bundleOptionXInputType('0')}}" userInput="{{BundleProduct.optionInputType1}}" stepKey="selectInputType"/>
<waitForElementVisible selector="{{AdminProductFormBundleSection.addProductsToOption}}" stepKey="waitForAddProductsToBundle"/>
<click selector="{{AdminProductFormBundleSection.addProductsToOption}}" stepKey="clickAddProductsToOption"/>
<waitForPageLoad stepKey="waitForPageLoadAfterBundleProducts"/>
<actionGroup ref="AdminClickAddProductToOptionActionGroup" stepKey="clickAddProductsToOption"/>
<actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterBundleProductOptions">
<argument name="product" value="$$simpleProduct1$$"/>
</actionGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,7 @@
<waitForElementVisible selector="{{AdminProductFormBundleSection.bundleOptionXTitle('0')}}" stepKey="waitForBundleOptions"/>
<fillField selector="{{AdminProductFormBundleSection.bundleOptionXTitle('0')}}" userInput="{{BundleProduct.optionTitle1}}" stepKey="fillOptionTitle"/>
<selectOption selector="{{AdminProductFormBundleSection.bundleOptionXInputType('0')}}" userInput="{{BundleProduct.optionInputType1}}" stepKey="selectInputType"/>
<waitForElementVisible selector="{{AdminProductFormBundleSection.addProductsToOption}}" stepKey="waitForAddProductsToBundle"/>
<click selector="{{AdminProductFormBundleSection.addProductsToOption}}" stepKey="clickAddProductsToOption"/>
<waitForPageLoad stepKey="waitForPageLoadAfterBundleProducts"/>
<actionGroup ref="AdminClickAddProductToOptionActionGroup" stepKey="clickAddProductsToOption"/>
<actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterBundleProductOptions">
<argument name="product" value="$$simpleProduct1$$"/>
</actionGroup>
Expand Down Expand Up @@ -68,14 +66,9 @@
<actionGroup ref="FilterProductGridByNameActionGroup" stepKey="filterBundleProductOptionsDownToName">
<argument name="product" value="BundleProduct"/>
</actionGroup>
<click selector="{{AdminProductFiltersSection.allCheckbox}}" stepKey="SelectAllOnly1"/>
<waitForPageLoad stepKey="loading2"/>

<!--Delete-->
<click selector="{{AdminProductFiltersSection.actions}}" stepKey="ClickOnActionsChangingView"/>
<click selector="{{AdminProductFiltersSection.delete}}" stepKey="ClickDelete"/>
<click selector="//button[@class='action-primary action-accept']" stepKey="ConfirmDelete"/>
<waitForPageLoad stepKey="loading3"/>
<actionGroup ref="AdminDeleteAllProductsFromGridActionGroup" stepKey="selectAndDeleteProducts"/>

<!--Locating delete message-->
<seeElement selector="{{AdminCategoryMessagesSection.SuccessMessage}}" stepKey="deleteMessage"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,7 @@
<waitForElementVisible selector="{{AdminProductFormBundleSection.bundleOptionXTitle('0')}}" stepKey="waitForBundleOptions"/>
<fillField selector="{{AdminProductFormBundleSection.bundleOptionXTitle('0')}}" userInput="{{BundleProduct.optionTitle1}}" stepKey="fillOptionTitle"/>
<selectOption selector="{{AdminProductFormBundleSection.bundleOptionXInputType('0')}}" userInput="{{BundleProduct.optionInputType1}}" stepKey="selectInputType"/>
<waitForElementVisible selector="{{AdminProductFormBundleSection.addProductsToOption}}" stepKey="waitForAddProductsToBundle"/>
<click selector="{{AdminProductFormBundleSection.addProductsToOption}}" stepKey="clickAddProductsToOption"/>
<waitForPageLoad stepKey="waitForPageLoadAfterBundleProducts"/>
<actionGroup ref="AdminClickAddProductToOptionActionGroup" stepKey="clickAddProductsToOption"/>
<actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterBundleProductOptions">
<argument name="product" value="$$simpleProduct1$$"/>
</actionGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,7 @@
<waitForElementVisible selector="{{AdminProductFormBundleSection.bundleOptionXTitle('0')}}" stepKey="waitForBundleOptions"/>
<fillField selector="{{AdminProductFormBundleSection.bundleOptionXTitle('0')}}" userInput="{{BundleProduct.optionTitle1}}" stepKey="fillOptionTitle"/>
<selectOption selector="{{AdminProductFormBundleSection.bundleOptionXInputType('0')}}" userInput="{{BundleProduct.optionInputType1}}" stepKey="selectInputType"/>
<waitForElementVisible selector="{{AdminProductFormBundleSection.addProductsToOption}}" stepKey="waitForAddProductsToBundle"/>
<click selector="{{AdminProductFormBundleSection.addProductsToOption}}" stepKey="clickAddProductsToOption"/>
<waitForPageLoad stepKey="waitForPageLoadAfterBundleProducts"/>
<actionGroup ref="AdminClickAddProductToOptionActionGroup" stepKey="clickAddProductsToOption"/>
<actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterBundleProductOptions">
<argument name="product" value="$$simpleProduct1$$"/>
</actionGroup>
Expand Down Expand Up @@ -81,9 +79,7 @@
<waitForElementVisible selector="{{AdminProductFormBundleSection.bundleOptionXTitle('0')}}" stepKey="waitForBundleOptions2"/>
<fillField selector="{{AdminProductFormBundleSection.bundleOptionXTitle('0')}}" userInput="{{BundleProduct.optionTitle1}}" stepKey="fillOptionTitle2"/>
<selectOption selector="{{AdminProductFormBundleSection.bundleOptionXInputType('0')}}" userInput="{{BundleProduct.optionInputType1}}" stepKey="selectInputType2"/>
<waitForElementVisible selector="{{AdminProductFormBundleSection.addProductsToOption}}" stepKey="waitForAddProductsToBundle2"/>
<click selector="{{AdminProductFormBundleSection.addProductsToOption}}" stepKey="clickAddProductsToOption2"/>
<waitForPageLoad stepKey="waitForPageLoadAfterBundleProducts2"/>
<actionGroup ref="AdminClickAddProductToOptionActionGroup" stepKey="clickAddProductsToOption2"/>
<actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterBundleProductOptionsx2">
<argument name="product" value="$$simpleProduct3$$"/>
</actionGroup>
Expand Down Expand Up @@ -118,12 +114,7 @@
<actionGroup ref="BundleProductFilter" stepKey="FilterForOnlyBundleProducts"/>

<!--Delete-->
<click selector="{{AdminProductFiltersSection.allCheckbox}}" stepKey="SelectAllOnly1"/>
<waitForPageLoad stepKey="loading"/>
<click selector="{{AdminProductFiltersSection.actions}}" stepKey="ClickOnActionsChangingView"/>
<click selector="{{AdminProductFiltersSection.delete}}" stepKey="ClickDelete"/>
<click selector="//button[@class='action-primary action-accept']" stepKey="ConfirmDelete"/>
<waitForPageLoad stepKey="loading3"/>
<actionGroup ref="AdminDeleteAllProductsFromGridActionGroup" stepKey="selectAndDeleteProducts"/>

<!--Locating delete message-->
<seeElement selector="{{AdminCategoryMessagesSection.SuccessMessage}}" stepKey="deleteMessage"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,7 @@
<waitForElementVisible selector="{{AdminProductFormBundleSection.bundleOptionXTitle('0')}}" stepKey="waitForBundleOptions"/>
<fillField selector="{{AdminProductFormBundleSection.bundleOptionXTitle('0')}}" userInput="{{BundleProduct.optionTitle1}}" stepKey="fillOptionTitle"/>
<selectOption selector="{{AdminProductFormBundleSection.bundleOptionXInputType('0')}}" userInput="{{BundleProduct.optionInputType1}}" stepKey="selectInputType"/>
<waitForElementVisible selector="{{AdminProductFormBundleSection.addProductsToOption}}" stepKey="waitForAddProductsToBundle"/>
<click selector="{{AdminProductFormBundleSection.addProductsToOption}}" stepKey="clickAddProductsToOption"/>
<waitForPageLoad stepKey="waitForPageLoadAfterBundleProducts"/>
<actionGroup ref="AdminClickAddProductToOptionActionGroup" stepKey="clickAddProductsToOption"/>
<actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterBundleProductOptions">
<argument name="product" value="$$simpleProduct1$$"/>
</actionGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,7 @@
<waitForElementVisible selector="{{AdminProductFormBundleSection.bundleOptionXTitle('0')}}" stepKey="waitForBundleOptions"/>
<fillField selector="{{AdminProductFormBundleSection.bundleOptionXTitle('0')}}" userInput="{{BundleProduct.optionTitle1}}" stepKey="fillOptionTitle"/>
<selectOption selector="{{AdminProductFormBundleSection.bundleOptionXInputType('0')}}" userInput="{{BundleProduct.optionInputType1}}" stepKey="selectInputType"/>
<waitForElementVisible selector="{{AdminProductFormBundleSection.addProductsToOption}}" stepKey="waitForAddProductsToBundle"/>
<click selector="{{AdminProductFormBundleSection.addProductsToOption}}" stepKey="clickAddProductsToOption"/>
<waitForPageLoad stepKey="waitForPageLoadAfterBundleProducts"/>
<actionGroup ref="AdminClickAddProductToOptionActionGroup" stepKey="clickAddProductsToOption"/>
<actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterBundleProductOptions">
<argument name="product" value="$$simpleProduct1$$"/>
</actionGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,7 @@
<waitForElementVisible selector="{{AdminProductFormBundleSection.bundleOptionXTitle('0')}}" stepKey="waitForBundleOptions"/>
<fillField selector="{{AdminProductFormBundleSection.bundleOptionXTitle('0')}}" userInput="{{BundleProduct.optionTitle1}}" stepKey="fillOptionTitle"/>
<selectOption selector="{{AdminProductFormBundleSection.bundleOptionXInputType('0')}}" userInput="{{BundleProduct.optionInputType1}}" stepKey="selectInputType"/>
<waitForElementVisible selector="{{AdminProductFormBundleSection.addProductsToOption}}" stepKey="waitForAddProductsToBundle"/>
<click selector="{{AdminProductFormBundleSection.addProductsToOption}}" stepKey="clickAddProductsToOption"/>
<waitForPageLoad stepKey="waitForPageLoadAfterBundleProducts"/>
<actionGroup ref="AdminClickAddProductToOptionActionGroup" stepKey="clickAddProductsToOption"/>
<actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterBundleProductOptions">
<argument name="product" value="$$simpleProduct1$$"/>
</actionGroup>
Expand Down
Loading

0 comments on commit d61e030

Please sign in to comment.