Skip to content
Snippets Groups Projects
Commit 6e060e8e authored by neeta-wagento's avatar neeta-wagento
Browse files

resolve test issues

parent daf95b87
No related merge requests found
...@@ -37,8 +37,8 @@ class ValidationMessage ...@@ -37,8 +37,8 @@ class ValidationMessage
public function __construct( public function __construct(
\Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig,
\Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\Store\Model\StoreManagerInterface $storeManager,
\Magento\Framework\Locale\CurrencyInterface $currency = null, \Magento\Framework\Locale\CurrencyInterface $currency,
\Magento\Framework\Pricing\Helper\Data $priceHelper \Magento\Framework\Pricing\Helper\Data $priceHelper = null
) { ) {
$this->scopeConfig = $scopeConfig; $this->scopeConfig = $scopeConfig;
$this->storeManager = $storeManager; $this->storeManager = $storeManager;
......
...@@ -21,7 +21,6 @@ class ValidationMessageTest extends \PHPUnit\Framework\TestCase ...@@ -21,7 +21,6 @@ class ValidationMessageTest extends \PHPUnit\Framework\TestCase
/** /**
* @var \PHPUnit_Framework_MockObject_MockObject * @var \PHPUnit_Framework_MockObject_MockObject
* @deprecated since 101.0.0
*/ */
private $storeManagerMock; private $storeManagerMock;
...@@ -55,29 +54,17 @@ class ValidationMessageTest extends \PHPUnit\Framework\TestCase ...@@ -55,29 +54,17 @@ class ValidationMessageTest extends \PHPUnit\Framework\TestCase
{ {
$minimumAmount = 20; $minimumAmount = 20;
$minimumAmountCurrency = '$20'; $minimumAmountCurrency = '$20';
$currencyCode = 'currency_code'; $this->scopeConfigMock->expects($this->at(0))->method('getValue')->with('sales/minimum_order/description', \Magento\Store\Model\ScopeInterface::SCOPE_STORE)->willReturn(null);
$this->scopeConfigMock->expects($this->at(0)) $this->scopeConfigMock->expects($this->at(1))->method('getValue')->with('sales/minimum_order/amount', \Magento\Store\Model\ScopeInterface::SCOPE_STORE)->willReturn($minimumAmount);
->method('getValue')
->with('sales/minimum_order/description', \Magento\Store\Model\ScopeInterface::SCOPE_STORE)
->willReturn(null);
$this->scopeConfigMock->expects($this->at(1))
->method('getValue')
->with('sales/minimum_order/amount', \Magento\Store\Model\ScopeInterface::SCOPE_STORE)
->willReturn($minimumAmount);
$this->priceHelperMock->expects($this->once()) $this->priceHelperMock->expects($this->once())
->method('currency') ->method('currency')
->with($minimumAmount, true, false) ->with($minimumAmount, true, false)
->will($this->returnValue($minimumAmountCurrency)); ->will($this->returnValue($minimumAmountCurrency));
$this->assertEquals( $this->assertEquals(__('Minimum order amount is %1', $minimumAmountCurrency), $this->model->getMessage());
__('Minimum order amount is %1', $minimumAmountCurrency),
$this->model->getMessage()
);
} }
public function testGetConfigMessage() public function testGetConfigMessage()
{ {
$configMessage = 'config_message'; $configMessage = 'config_message';
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment