From 10ba64f9b76a25a77182d72a0a09413ccba12770 Mon Sep 17 00:00:00 2001 From: Pascal Kriete Date: Thu, 21 Apr 2011 01:00:27 -0400 Subject: Renamed the main test class, fixing test cases. --- tests/codeigniter/core/Config_test.php | 26 ++++++-------------------- tests/codeigniter/core/Lang_test.php | 2 +- tests/codeigniter/core/Loader_test.php | 5 ++--- 3 files changed, 9 insertions(+), 24 deletions(-) (limited to 'tests/codeigniter/core') 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 @@ 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 @@ 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'))); -- cgit v1.2.3-24-g4f1b