summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMaster Yoda <jim_parry@bcit.ca>2015-09-21 07:16:06 +0200
committerMaster Yoda <jim_parry@bcit.ca>2015-09-21 07:16:06 +0200
commitb183fb897a30b95520aeb0613d933e85db441d3a (patch)
tree722579fe2d247af6e081476b1c7af9bd64cd1c5f
parent882ab12a32c1c2ccef3e833c319b54eab7ee92ec (diff)
parentb6b401bcb134f7e99a9ea18e300c0af44d0685bf (diff)
Merge branch 'fix/lang_test' of https://github.com/jim-parry/CodeIgniter into fix/lang_test
-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
=============