CurrencyTest.php 728 B

12345678910111213141516171819202122232425262728
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Framework\Validator\Test\Unit;
  7. class CurrencyTest extends \PHPUnit\Framework\TestCase
  8. {
  9. /**
  10. * @var array
  11. */
  12. protected $expectedCurrencies = [
  13. 'USD',
  14. 'EUR',
  15. 'UAH',
  16. 'GBP',
  17. ];
  18. public function testIsValid()
  19. {
  20. $lists = $this->createMock(\Magento\Framework\Setup\Lists::class);
  21. $lists->expects($this->any())->method('getCurrencyList')->will($this->returnValue($this->expectedCurrencies));
  22. $currency = new \Magento\Framework\Validator\Currency($lists);
  23. $this->assertEquals(true, $currency->isValid('EUR'));
  24. }
  25. }