diff options
author | Taufan Aditya <toopay@taufanaditya.com> | 2012-03-28 11:49:49 +0200 |
---|---|---|
committer | Taufan Aditya <toopay@taufanaditya.com> | 2012-03-28 11:49:49 +0200 |
commit | e1dc9ea4fcfd4983fa076b70fe631166a95d0b68 (patch) | |
tree | fb58707f0e13595a35635dceed6cd671a564f512 /tests/codeigniter | |
parent | 30b34d099e4e9bcdc79ec496fdb89904444eaa4f (diff) |
Remove include or require declaration from all helpers test
Diffstat (limited to 'tests/codeigniter')
-rw-r--r-- | tests/codeigniter/helpers/array_helper_test.php | 10 | ||||
-rw-r--r-- | tests/codeigniter/helpers/date_helper_test.php | 10 | ||||
-rw-r--r-- | tests/codeigniter/helpers/directory_helper_test.php | 9 | ||||
-rw-r--r-- | tests/codeigniter/helpers/email_helper_test.php | 10 | ||||
-rw-r--r-- | tests/codeigniter/helpers/file_helper_test.php | 7 | ||||
-rw-r--r-- | tests/codeigniter/helpers/html_helper_test.php | 8 | ||||
-rw-r--r-- | tests/codeigniter/helpers/inflector_helper_test.php | 6 | ||||
-rw-r--r-- | tests/codeigniter/helpers/number_helper_test.php | 7 | ||||
-rw-r--r-- | tests/codeigniter/helpers/path_helper_test.php | 9 | ||||
-rw-r--r-- | tests/codeigniter/helpers/string_helper_test.php | 9 | ||||
-rw-r--r-- | tests/codeigniter/helpers/text_helper_test.php | 6 | ||||
-rw-r--r-- | tests/codeigniter/helpers/url_helper_test.php | 9 | ||||
-rw-r--r-- | tests/codeigniter/helpers/xml_helper_test.php | 8 |
13 files changed, 62 insertions, 46 deletions
diff --git a/tests/codeigniter/helpers/array_helper_test.php b/tests/codeigniter/helpers/array_helper_test.php index 62559de83..9cd15960f 100644 --- a/tests/codeigniter/helpers/array_helper_test.php +++ b/tests/codeigniter/helpers/array_helper_test.php @@ -1,13 +1,11 @@ <?php -// OLD TEST FORMAT: DO NOT COPY - -require_once(BASEPATH.'helpers/array_helper.php'); - -class Array_helper_test extends CI_TestCase -{ +class Array_helper_test extends CI_TestCase { + public function set_up() { + $this->helper('array'); + $this->my_array = array( 'foo' => 'bar', 'sally' => 'jim', diff --git a/tests/codeigniter/helpers/date_helper_test.php b/tests/codeigniter/helpers/date_helper_test.php index 662d16485..17d1ef21e 100644 --- a/tests/codeigniter/helpers/date_helper_test.php +++ b/tests/codeigniter/helpers/date_helper_test.php @@ -1,8 +1,12 @@ <?php -require_once BASEPATH.'helpers/date_helper.php'; -class Date_helper_test extends CI_TestCase -{ +class Date_helper_test extends CI_TestCase { + + public function set_up() + { + $this->helper('date'); + } + // ------------------------------------------------------------------------ public function test_now_local() diff --git a/tests/codeigniter/helpers/directory_helper_test.php b/tests/codeigniter/helpers/directory_helper_test.php index 3fae81b82..3937d2913 100644 --- a/tests/codeigniter/helpers/directory_helper_test.php +++ b/tests/codeigniter/helpers/directory_helper_test.php @@ -1,12 +1,11 @@ <?php -require_once 'vfsStream/vfsStream.php'; -require BASEPATH.'helpers/directory_helper.php'; - -class Directory_helper_test extends CI_TestCase -{ +class Directory_helper_test extends CI_TestCase { + public function set_up() { + $this->helper('directory'); + vfsStreamWrapper::register(); vfsStreamWrapper::setRoot(new vfsStreamDirectory('testDir')); diff --git a/tests/codeigniter/helpers/email_helper_test.php b/tests/codeigniter/helpers/email_helper_test.php index 7324e8109..a01f3d5af 100644 --- a/tests/codeigniter/helpers/email_helper_test.php +++ b/tests/codeigniter/helpers/email_helper_test.php @@ -1,10 +1,12 @@ <?php -require_once(BASEPATH.'helpers/email_helper.php'); +class Email_helper_test extends CI_TestCase { + + public function set_up() + { + $this->helper('email'); + } -class Email_helper_test extends CI_TestCase -{ - public function test_valid_email() { $this->assertEquals(FALSE, valid_email('test')); diff --git a/tests/codeigniter/helpers/file_helper_test.php b/tests/codeigniter/helpers/file_helper_test.php index a596a0375..4b9c29485 100644 --- a/tests/codeigniter/helpers/file_helper_test.php +++ b/tests/codeigniter/helpers/file_helper_test.php @@ -1,12 +1,11 @@ <?php -require_once 'vfsStream/vfsStream.php'; -require BASEPATH.'helpers/file_helper.php'; +class File_helper_Test extends CI_TestCase { -class File_helper_Test extends CI_TestCase -{ public function set_up() { + $this->helper('file'); + vfsStreamWrapper::register(); vfsStreamWrapper::setRoot(new vfsStreamDirectory('testDir')); diff --git a/tests/codeigniter/helpers/html_helper_test.php b/tests/codeigniter/helpers/html_helper_test.php index 553fc2bb1..28974b0f8 100644 --- a/tests/codeigniter/helpers/html_helper_test.php +++ b/tests/codeigniter/helpers/html_helper_test.php @@ -1,9 +1,11 @@ <?php -require_once(BASEPATH.'helpers/html_helper.php'); +class Html_helper_test extends CI_TestCase { -class Html_helper_test extends CI_TestCase -{ + public function set_up() + { + $this->helper('html'); + } // ------------------------------------------------------------------------ diff --git a/tests/codeigniter/helpers/inflector_helper_test.php b/tests/codeigniter/helpers/inflector_helper_test.php index 472e28adb..9e9478711 100644 --- a/tests/codeigniter/helpers/inflector_helper_test.php +++ b/tests/codeigniter/helpers/inflector_helper_test.php @@ -1,9 +1,11 @@ <?php -require_once(BASEPATH.'helpers/inflector_helper.php'); - class Inflector_helper_test extends CI_TestCase { + public function set_up() + { + $this->helper('inflector'); + } public function test_singular() { diff --git a/tests/codeigniter/helpers/number_helper_test.php b/tests/codeigniter/helpers/number_helper_test.php index 3322b2475..4bb9a918a 100644 --- a/tests/codeigniter/helpers/number_helper_test.php +++ b/tests/codeigniter/helpers/number_helper_test.php @@ -1,12 +1,11 @@ <?php -require_once BASEPATH.'helpers/number_helper.php'; - -class Number_helper_test extends CI_TestCase -{ +class Number_helper_test extends CI_TestCase { public function set_up() { + $this->helper('number'); + // Grab the core lang class $lang_cls = $this->ci_core_class('lang'); diff --git a/tests/codeigniter/helpers/path_helper_test.php b/tests/codeigniter/helpers/path_helper_test.php index 2e6cc6391..632f57501 100644 --- a/tests/codeigniter/helpers/path_helper_test.php +++ b/tests/codeigniter/helpers/path_helper_test.php @@ -1,9 +1,12 @@ <?php -require BASEPATH . 'helpers/path_helper.php'; +class Path_helper_test extends CI_TestCase { + + public function set_up() + { + $this->helper('path'); + } -class Path_helper_test extends CI_TestCase -{ public function test_set_realpath() { $expected = getcwd() . DIRECTORY_SEPARATOR; diff --git a/tests/codeigniter/helpers/string_helper_test.php b/tests/codeigniter/helpers/string_helper_test.php index a884d6284..29c3d6594 100644 --- a/tests/codeigniter/helpers/string_helper_test.php +++ b/tests/codeigniter/helpers/string_helper_test.php @@ -1,9 +1,12 @@ <?php -require_once(BASEPATH.'helpers/string_helper.php'); +class String_helper_test extends CI_TestCase { + + public function set_up() + { + $this->helper('string'); + } -class String_helper_test extends CI_TestCase -{ public function test_strip_slashes() { $expected = array( diff --git a/tests/codeigniter/helpers/text_helper_test.php b/tests/codeigniter/helpers/text_helper_test.php index a0866e638..584066b0c 100644 --- a/tests/codeigniter/helpers/text_helper_test.php +++ b/tests/codeigniter/helpers/text_helper_test.php @@ -1,13 +1,13 @@ <?php -require_once(BASEPATH.'helpers/text_helper.php'); +class Text_helper_test extends CI_TestCase { -class Text_helper_test extends CI_TestCase -{ private $_long_string; public function set_up() { + $this->helper('text'); + $this->_long_string = 'Once upon a time, a framework had no tests. It sad. So some nice people began to write tests. The more time that went on, the happier it became. Everyone was happy.'; } diff --git a/tests/codeigniter/helpers/url_helper_test.php b/tests/codeigniter/helpers/url_helper_test.php index 51a8cc7c0..c561809ce 100644 --- a/tests/codeigniter/helpers/url_helper_test.php +++ b/tests/codeigniter/helpers/url_helper_test.php @@ -1,9 +1,12 @@ <?php -require_once(BASEPATH.'helpers/url_helper.php'); +class Url_helper_test extends CI_TestCase { + + public function set_up() + { + $this->helper('url'); + } -class Url_helper_test extends CI_TestCase -{ public function test_url_title() { $words = array( diff --git a/tests/codeigniter/helpers/xml_helper_test.php b/tests/codeigniter/helpers/xml_helper_test.php index 49f49e166..a83fef91e 100644 --- a/tests/codeigniter/helpers/xml_helper_test.php +++ b/tests/codeigniter/helpers/xml_helper_test.php @@ -1,9 +1,11 @@ <?php -require_once(BASEPATH.'helpers/xml_helper.php'); +class Xml_helper_test extends CI_TestCase { -class Xml_helper_test extends CI_TestCase -{ + public function set_up() + { + $this->helper('xml'); + } public function test_xml_convert() { |