Skip to content

Commit

Permalink
Removed deprecated constant DEFAULT_LANGUAGE.
Browse files Browse the repository at this point in the history
  • Loading branch information
ADmad committed Nov 15, 2013
1 parent 66bb78b commit 2c9503d
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 31 deletions.
3 changes: 0 additions & 3 deletions Cake/I18n/L10n.php
Expand Up @@ -340,9 +340,6 @@ class L10n {
public function __construct(Request $request) {
$this->_request = $request;

if (defined('DEFAULT_LANGUAGE')) {
$this->default = DEFAULT_LANGUAGE;
}
$default = Configure::read('Config.language');
if ($default) {
$this->default = $default;
Expand Down
28 changes: 0 additions & 28 deletions Cake/Test/TestCase/I18n/L10nTest.php
Expand Up @@ -121,34 +121,6 @@ public function testGetAutoLanguage() {
$this->assertEquals('eng', $localize->locale);
}

/**
* testGet method with deprecated constant DEFAULT_LANGUAGE
*
* @return void
*/
public function testGetWithDeprecatedConstant() {
$this->skipIf(defined('DEFAULT_LANGUAGE'), 'Cannot re-define already defined constant.');

define('DEFAULT_LANGUAGE', 'en-us');
$localize = new L10n($this->request);

$lang = $localize->get('use_default');

$this->assertEquals('en-us', $lang);
$this->assertEquals('English (United States)', $localize->language);
$this->assertEquals(array('en_us', 'eng'), $localize->languagePath);
$this->assertEquals('en_us', $localize->locale);

$localize = new L10n($this->request);

$lang = $localize->get();

$this->assertEquals('en-us', $lang);
$this->assertEquals('English (United States)', $localize->language);
$this->assertEquals(array('en_us', 'eng'), $localize->languagePath);
$this->assertEquals('en_us', $localize->locale);
}

/**
* testMap method
*
Expand Down

0 comments on commit 2c9503d

Please sign in to comment.