27 $this->localeCurrencyMock = $this->createMock(\
Magento\Framework\Locale\CurrencyInterface::class);
29 $objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this);
31 \
Magento\Directory\Model\Currency::class,
33 'localeCurrency' => $this->localeCurrencyMock,
35 'currency_code' => $this->currencyCode,
45 $currencyMock = $this->getMockBuilder(\
Magento\Framework\Currency::class)
46 ->disableOriginalConstructor()
48 $currencyMock->expects($this->once())
52 $this->localeCurrencyMock->expects($this->once())
53 ->method(
'getCurrency')
54 ->with($this->currencyCode)
55 ->willReturn($currencyMock);
56 $this->assertEquals(
$currencySymbol, $this->currency->getCurrencySymbol());
67 $currencyMock = $this->getMockBuilder(\
Magento\Framework\Currency::class)
68 ->disableOriginalConstructor()
70 $currencyMock->expects($this->at(0))
71 ->method(
'toCurrency')
72 ->willReturn($withCurrency);
73 $currencyMock->expects($this->at(1))
74 ->method(
'toCurrency')
75 ->willReturn($noCurrency);
76 $this->localeCurrencyMock->expects($this->atLeastOnce())
77 ->method(
'getCurrency')
78 ->with($this->currencyCode)
79 ->willReturn($currencyMock);
80 $this->assertEquals($expected, $this->currency->getOutputFormat());
92 'withCurrency' =>
'$0.00',
93 'noCurrency' =>
'0.00',
97 'withCurrency' => json_decode(
'"\u200E"') .
'$0.00',
98 'noCurrency' => json_decode(
'"\u200E"') .
'0.00',
99 'expected' => json_decode(
'"\u200E"') .
'$%s',
testGetOutputFormat($withCurrency, $noCurrency, $expected)
getOutputFormatDataProvider()