Skip to content
Permalink
Browse files

Added test for default locale

  • Loading branch information...
liviascapin committed Sep 19, 2017
1 parent 6e54d27 commit de5020c9ffeb08f91a3f5e7d94213b8eda42eec2
Showing with 14 additions and 1 deletion.
  1. +14 −1 tests/TestCase/I18n/I18nTest.php
@@ -19,6 +19,7 @@
use Cake\Core\Plugin;
use Cake\I18n\I18n;
use Cake\TestSuite\TestCase;
use Locale;
/**
* I18nTest class
@@ -41,7 +42,7 @@ class I18nTest extends TestCase
public function setUp()
{
parent::setUp();
$this->locale = I18n::getLocale();
$this->locale = Locale::getDefault() ?: I18n::DEFAULT_LOCALE;
}
/**
@@ -58,6 +59,18 @@ public function tearDown()
Plugin::unload();
Cache::clear(false, '_cake_core_');
}
/**
* Tests that the default locale is set correctly
*
* @return void
*/
public function testDefaultLocale() {
$newLocale = 'de_DE';
I18n::setLocale($newLocale);
$this->assertEquals($newLocale, I18n::getLocale());
$this->assertEquals($this->locale, I18n::getDefaultLocale());
}
/**
* Tests that a default translator is created and messages are parsed

0 comments on commit de5020c

Please sign in to comment.
You can’t perform that action at this time.