test(phpunit): Improve locale-related tests
This commit is contained in:
parent
0283ef6928
commit
f4654c7229
2 changed files with 14 additions and 5 deletions
|
@ -26,19 +26,18 @@ class LocaleManagerTest extends TestCase
|
|||
*/
|
||||
protected function setUp()
|
||||
{
|
||||
$this->localeManager = new LocaleManager();
|
||||
$_SESSION[LocaleManager::class]['locale'] = 'foo_BAR';
|
||||
$this->localeManager = new LocaleManager();
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the getSupportedLocales function.
|
||||
* Unset locale after each test.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function testConstructorWithCookies()
|
||||
protected function tearDown()
|
||||
{
|
||||
$localeManager = new LocaleManager([]);
|
||||
$this->assertEquals('foo_BAR', (string) $localeManager->getLocale());
|
||||
$this->localeManager->unsetLocale();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -77,4 +77,14 @@ class LocaleTest extends TestCase
|
|||
{
|
||||
$this->assertEquals('fr', $this->localeObject->getIso3166());
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the getCountry function.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function testGetCountry()
|
||||
{
|
||||
$this->assertEquals(country('fr'), $this->localeObject->getCountry());
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue