From e1dc9ea4fcfd4983fa076b70fe631166a95d0b68 Mon Sep 17 00:00:00 2001 From: Taufan Aditya Date: Wed, 28 Mar 2012 16:49:49 +0700 Subject: Remove include or require declaration from all helpers test --- tests/mocks/autoloader.php | 3 +-- tests/mocks/ci_testcase.php | 27 +++++++++++++++++---------- 2 files changed, 18 insertions(+), 12 deletions(-) (limited to 'tests/mocks') diff --git a/tests/mocks/autoloader.php b/tests/mocks/autoloader.php index 88070e508..bf3fbc508 100644 --- a/tests/mocks/autoloader.php +++ b/tests/mocks/autoloader.php @@ -6,8 +6,7 @@ // // Prototype : // -// include_once('Mock_Core_Common') // Will load ./mocks/core/common.php -// $mock_loader = new Mock_Core_Loader(); // Will load ./mocks/core/loader.php +// include_once('Mock_Core_Loader') // Will load ./mocks/core/loader.php // $mock_table = new Mock_Libraries_Table(); // Will load ./mocks/libraries/table.php // $mock_database_driver = new Mock_Database_Driver(); // Will load ./mocks/database/driver.php // and so on... diff --git a/tests/mocks/ci_testcase.php b/tests/mocks/ci_testcase.php index 5c83974b3..f327e6b07 100644 --- a/tests/mocks/ci_testcase.php +++ b/tests/mocks/ci_testcase.php @@ -48,6 +48,13 @@ class CI_TestCase extends PHPUnit_Framework_TestCase { $this->tear_down(); } } + + // -------------------------------------------------------------------- + + public static function instance() + { + return self::$ci_test_instance; + } // -------------------------------------------------------------------- @@ -62,6 +69,13 @@ class CI_TestCase extends PHPUnit_Framework_TestCase { $this->ci_config[$key] = $val; } } + + // -------------------------------------------------------------------- + + function ci_get_config() + { + return $this->ci_config; + } // -------------------------------------------------------------------- @@ -153,19 +167,12 @@ class CI_TestCase extends PHPUnit_Framework_TestCase { self::$ci_test_instance = $this; parent::runBare(); } - - // -------------------------------------------------------------------- - - public static function instance() - { - return self::$ci_test_instance; - } - + // -------------------------------------------------------------------- - function ci_get_config() + function helper($name) { - return $this->ci_config; + require_once(BASEPATH.'helpers/'.$name.'_helper.php'); } // -------------------------------------------------------------------- -- cgit v1.2.3-24-g4f1b