-
Notifications
You must be signed in to change notification settings - Fork 9.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch '2.4-develop' of https://github.com/magento/magento2 int…
…o ASI-1449
- Loading branch information
Showing
193 changed files
with
8,073 additions
and
1,987 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
102 changes: 102 additions & 0 deletions
102
app/code/Magento/Backend/Test/Unit/Block/Widget/Grid/Column/Filter/PriceTest.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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()); | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
app/code/Magento/Bundle/Test/Mftf/ActionGroup/AdminClickAddProductToOptionActionGroup.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.