summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/codeigniter/core/Lang_test.php7
-rw-r--r--tests/mocks/ci_testcase.php13
2 files changed, 15 insertions, 5 deletions
diff --git a/tests/codeigniter/core/Lang_test.php b/tests/codeigniter/core/Lang_test.php
index d3c7ee1e4..87a71c885 100644
--- a/tests/codeigniter/core/Lang_test.php
+++ b/tests/codeigniter/core/Lang_test.php
@@ -29,6 +29,11 @@ class Lang_test extends CI_TestCase {
$this->assertTrue($this->lang->load('date'));
$this->assertEquals('Year', $this->lang->language['date_year']);
+ // A language other than english
+ $this->ci_vfs_clone('system/language/english/email_lang.php', 'system/language/german/');
+ $this->assertTrue($this->lang->load('email', 'german'));
+ $this->assertEquals('german', $this->lang->is_loaded['email_lang.php'] );
+
// Non-alpha idiom (should act the same as unspecified language)
$this->ci_vfs_clone('system/language/english/number_lang.php');
$this->assertTrue($this->lang->load('number'));
@@ -56,4 +61,4 @@ class Lang_test extends CI_TestCase {
$this->assertFalse($this->lang->line(NULL));
}
-} \ No newline at end of file
+}
diff --git a/tests/mocks/ci_testcase.php b/tests/mocks/ci_testcase.php
index ad4fe5ac3..a2c37b92e 100644
--- a/tests/mocks/ci_testcase.php
+++ b/tests/mocks/ci_testcase.php
@@ -274,14 +274,14 @@ class CI_TestCase extends PHPUnit_Framework_TestCase {
* @param string Path from base directory
* @return bool TRUE on success, otherwise FALSE
*/
- public function ci_vfs_clone($path)
+ public function ci_vfs_clone($path, $dest='')
{
// Check for array
if (is_array($path))
{
foreach ($path as $file)
{
- $this->ci_vfs_clone($file);
+ $this->ci_vfs_clone($file, $dest);
}
return;
}
@@ -294,7 +294,12 @@ class CI_TestCase extends PHPUnit_Framework_TestCase {
return FALSE;
}
- $this->ci_vfs_create(basename($path), $content, NULL, dirname($path));
+ if (empty($dest))
+ {
+ $dest = dirname($path);
+ }
+
+ $this->ci_vfs_create(basename($path), $content, NULL, $dest);
return TRUE;
}
@@ -378,4 +383,4 @@ class CI_TestCase extends PHPUnit_Framework_TestCase {
}
}
-} \ No newline at end of file
+}