Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
CurrencyTest.php
Go to the documentation of this file.
1 <?php
7 
9 
13 class CurrencyTest extends \PHPUnit\Framework\TestCase
14 {
15  public function testConstruct()
16  {
17  $frontendCache = $this->createMock(\Magento\Framework\Cache\FrontendInterface::class);
18  $lowLevelFrontend = $this->createMock(\Zend_Cache_Core::class);
20  $appCache = $this->createMock(\Magento\Framework\App\CacheInterface::class);
21  $frontendCache->expects($this->once())->method('getLowLevelFrontend')->willReturn($lowLevelFrontend);
22  $appCache->expects($this->once())
23  ->method('getFrontend')
24  ->willReturn($frontendCache);
25 
26  // Create new currency object
27  $currency = new Currency($appCache, null, 'en_US');
28  $this->assertEquals($lowLevelFrontend, $currency->getCache());
29  $this->assertEquals('USD', $currency->getShortName());
30  }
31 }