diff options
Diffstat (limited to 'tests/codeigniter/core')
-rw-r--r-- | tests/codeigniter/core/Config_test.php | 26 | ||||
-rw-r--r-- | tests/codeigniter/core/Lang_test.php | 2 | ||||
-rw-r--r-- | tests/codeigniter/core/Loader_test.php | 5 |
3 files changed, 9 insertions, 24 deletions
diff --git a/tests/codeigniter/core/Config_test.php b/tests/codeigniter/core/Config_test.php index 628fc630b..b04dd67fa 100644 --- a/tests/codeigniter/core/Config_test.php +++ b/tests/codeigniter/core/Config_test.php @@ -1,33 +1,19 @@ <?php -class Config_test extends CodeIgniterTestCase { +class Config_test extends CI_TestCase { public function setUp() { $cls =& $this->ci_core_class('cfg'); - - $stub = $this->getMock($cls, NULL, array(), '', FALSE); - - //I would prefer this, but it currently - // does not work as when you try to pass - // null to setMethods it fails on an internal - // function call that expects an array =( - /* - $stub = $this->getMockBuilder($cls) - ->disableOriginalConstructor() - ->setMethods(null) - ->getMock(); - */ - - + // set predictable config values - $stub->config = array( + $this->ci_set_config(array( 'index_page' => 'index.php', 'base_url' => 'http://example.com/', 'subclass_prefix' => 'MY_' - ); - - $this->config = $stub; + )); + + $this->config = new $cls; } // -------------------------------------------------------------------- diff --git a/tests/codeigniter/core/Lang_test.php b/tests/codeigniter/core/Lang_test.php index 82e279a52..f65b335b0 100644 --- a/tests/codeigniter/core/Lang_test.php +++ b/tests/codeigniter/core/Lang_test.php @@ -1,6 +1,6 @@ <?php -class Lang_test extends CodeIgniterTestCase { +class Lang_test extends CI_TestCase { protected $lang; diff --git a/tests/codeigniter/core/Loader_test.php b/tests/codeigniter/core/Loader_test.php index fd9c63216..c7085c439 100644 --- a/tests/codeigniter/core/Loader_test.php +++ b/tests/codeigniter/core/Loader_test.php @@ -1,6 +1,6 @@ <?php -class Loader_test extends CodeIgniterTestCase { +class Loader_test extends CI_TestCase { private $ci_obj; @@ -14,7 +14,6 @@ class Loader_test extends CodeIgniterTestCase { $this->ci_obj = new StdClass; // Fix get_instance() - CodeIgniterTestCase::$test_instance =& $this; $this->ci_instance($this->ci_obj); } @@ -30,7 +29,7 @@ class Loader_test extends CodeIgniterTestCase { ->will($this->returnValue(TRUE)); // Add the mock to our stdClass - $this->ci_set_instance_var('config', $config); + $this->ci_instance_var('config', $config); // Test loading as an array. $this->assertEquals(NULL, $this->_loader->library(array('table'))); |