summaryrefslogtreecommitdiffstats
path: root/tests/codeigniter/helpers
diff options
context:
space:
mode:
Diffstat (limited to 'tests/codeigniter/helpers')
-rw-r--r--tests/codeigniter/helpers/date_helper_test.php2
-rw-r--r--tests/codeigniter/helpers/form_helper_test.php8
-rw-r--r--tests/codeigniter/helpers/number_helper_test.php17
-rw-r--r--tests/codeigniter/helpers/text_helper_test.php1
4 files changed, 10 insertions, 18 deletions
diff --git a/tests/codeigniter/helpers/date_helper_test.php b/tests/codeigniter/helpers/date_helper_test.php
index 9feade71c..1458acd3e 100644
--- a/tests/codeigniter/helpers/date_helper_test.php
+++ b/tests/codeigniter/helpers/date_helper_test.php
@@ -168,6 +168,8 @@ class Date_helper_test extends CI_TestCase {
public function test_timespan()
{
+ $this->ci_vfs_clone('system/language/english/date_lang.php');
+
$loader_cls = $this->ci_core_class('load');
$this->ci_instance_var('load', new $loader_cls);
diff --git a/tests/codeigniter/helpers/form_helper_test.php b/tests/codeigniter/helpers/form_helper_test.php
index 1a30ed993..48628d2e5 100644
--- a/tests/codeigniter/helpers/form_helper_test.php
+++ b/tests/codeigniter/helpers/form_helper_test.php
@@ -1,10 +1,12 @@
<?php
-require BASEPATH . 'core/Common.php';
-require BASEPATH . 'helpers/form_helper.php';
-
class Form_helper_test extends CI_TestCase
{
+ public function set_up()
+ {
+ $this->helper('form');
+ }
+
public function test_form_hidden()
{
$expected = <<<EOH
diff --git a/tests/codeigniter/helpers/number_helper_test.php b/tests/codeigniter/helpers/number_helper_test.php
index ef6aae138..817db2c7e 100644
--- a/tests/codeigniter/helpers/number_helper_test.php
+++ b/tests/codeigniter/helpers/number_helper_test.php
@@ -11,31 +11,18 @@ class Number_helper_test extends CI_TestCase {
// Mock away load, too much going on in there,
// we'll just check for the expected parameter
-
$lang = $this->getMock($lang_cls, array('load'));
$lang->expects($this->once())
->method('load')
->with($this->equalTo('number'));
// Assign the proper language array
-
- $lang->language = $this->_get_lang('number');
+ $lang->language = $this->lang('number');
// We don't have a controller, so just create
// a cheap class to act as our super object.
// Make sure it has a lang attribute.
-
- $obj = new stdClass;
- $obj->lang = $lang;
- $this->ci_instance($obj);
- }
-
- // Quick helper to actually grab the language
- // file. Consider moving this to ci_testcase?
- public function _get_lang($name)
- {
- require BASEPATH.'language/english/'.$name.'_lang.php';
- return $lang;
+ $this->ci_instance_var('lang', $lang);
}
public function test_byte_format()
diff --git a/tests/codeigniter/helpers/text_helper_test.php b/tests/codeigniter/helpers/text_helper_test.php
index f131469cb..d75d26208 100644
--- a/tests/codeigniter/helpers/text_helper_test.php
+++ b/tests/codeigniter/helpers/text_helper_test.php
@@ -64,6 +64,7 @@ class Text_helper_test extends CI_TestCase {
public function test_convert_accented_characters()
{
+ $this->ci_vfs_clone('application/config/foreign_chars.php');
$this->assertEquals('AAAeEEEIIOOEUUUeY', convert_accented_characters('ÀÂÄÈÊËÎÏÔŒÙÛÜŸ'));
$this->assertEquals('a e i o u n ue', convert_accented_characters('á é í ó ú ñ ü'));
}