summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tests/codeigniter/core/Lang_test.php24
-rw-r--r--user_guide_src/source/changelog.rst1
2 files changed, 21 insertions, 4 deletions
diff --git a/tests/codeigniter/core/Lang_test.php b/tests/codeigniter/core/Lang_test.php
index d2dd7598a..f8c12d884 100644
--- a/tests/codeigniter/core/Lang_test.php
+++ b/tests/codeigniter/core/Lang_test.php
@@ -41,14 +41,30 @@ class Lang_test extends CI_TestCase {
// Non-existent file
$this->setExpectedException(
- 'RuntimeException',
- 'CI Error: Unable to load the requested language file: language/english/nonexistent_lang.php'
+ 'RuntimeException', 'CI Error: Unable to load the requested language file: language/english/nonexistent_lang.php'
);
$this->lang->load('nonexistent');
}
// --------------------------------------------------------------------
+ public function test_non_alpha_idiom()
+ {
+ // Non-alpha idiom (should act the same as unspecified language)
+ // test with existing file
+ $this->ci_vfs_clone('system/language/english/number_lang.php');
+ $this->ci_vfs_clone('system/language/english/number_lang.php', 'system/language/123funny/');
+ $this->assertTrue($this->lang->load('number', '123funny'));
+ $this->assertEquals('Bytes', $this->lang->language['bytes']);
+
+ // test without existing file
+ $this->ci_vfs_clone('system/language/english/email_lang.php');
+ $this->assertTrue($this->lang->load('email', '456funny'));
+ $this->assertEquals('Bytes', $this->lang->language['bytes']);
+ }
+
+ // --------------------------------------------------------------------
+
public function test_multiple_file_load()
{
// Multiple files
@@ -58,8 +74,7 @@ class Lang_test extends CI_TestCase {
1 => 'nonexistent'
);
$this->setExpectedException(
- 'RuntimeException',
- 'CI Error: Unable to load the requested language file: language/english/nonexistent_lang.php'
+ 'RuntimeException', 'CI Error: Unable to load the requested language file: language/english/nonexistent_lang.php'
);
$this->lang->load($files, 'english');
}
@@ -86,4 +101,5 @@ class Lang_test extends CI_TestCase {
$this->assertFalse($this->lang->line('nonexistent_string'));
$this->assertFalse($this->lang->line(NULL));
}
+
}
diff --git a/user_guide_src/source/changelog.rst b/user_guide_src/source/changelog.rst
index 64120df8e..aaa2f7c73 100644
--- a/user_guide_src/source/changelog.rst
+++ b/user_guide_src/source/changelog.rst
@@ -22,6 +22,7 @@ Bug fixes for 3.0.2
- Fixed a bug (#2284) - :doc:`Database <database/index>` method ``protect_identifiers()`` breaks when :doc:`Query Builder <database/query_builder>` isn't enabled.
- Fixed a bug (#4052) - :doc:`Routing <general/routing>` with anonymous functions didn't work for routes that don't use regular expressions.
+- Fixed a bug - the Lang unit testing claimed to be testing for non-alpha idioms, but wasn't.
Version 3.0.1
=============