Files
yii2/tests/framework/i18n/LocaleTest.php
Alexander Makarov 8a155701c2 Fixed test class name
2018-02-03 18:29:23 +03:00

51 lines
1.1 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?php
/**
* @link http://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license http://www.yiiframework.com/license/
*/
namespace yiiunit\framework\i18n;
use yii\i18n\Locale;
use yiiunit\TestCase;
/**
* @group i18n
*/
class LocaleTest extends TestCase
{
/**
* @var Locale
*/
protected $locale;
protected function setUp()
{
parent::setUp();
$this->mockApplication([
'timeZone' => 'UTC',
'language' => 'ru-RU',
]);
$this->locale = new Locale(['locale' => 'en-US']);
}
protected function tearDown()
{
parent::tearDown();
$this->locale = null;
}
public function testGetCurrencyCode()
{
$this->locale->locale = 'de-DE';
$this->assertSame('€', $this->locale->getCurrencySymbol('EUR'));
$this->assertSame('€', $this->locale->getCurrencySymbol());
$this->locale->locale = 'ru-RU';
$this->assertIsOneOf($this->locale->getCurrencySymbol('RUR'), ['р.', '₽', 'руб.']);
$this->assertIsOneOf($this->locale->getCurrencySymbol(), ['р.', '₽', 'руб.']);
}
}