Commits

Pascal Kriete committed 20ebf9a

Renamed the main test class, fixing test cases.

  • Participants
  • Parent commits 8d5fb22
  • Branches unit_tests

Comments (0)

Files changed (3)

File tests/codeigniter/core/Config_test.php

 <?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;	
 	}
 	
 	// --------------------------------------------------------------------

File tests/codeigniter/core/Lang_test.php

 <?php
 
-class Lang_test extends CodeIgniterTestCase {
+class Lang_test extends CI_TestCase {
 	
 	protected $lang;
 	

File tests/codeigniter/core/Loader_test.php

 <?php
 
-class Loader_test extends CodeIgniterTestCase {
+class Loader_test extends CI_TestCase {
 	
 	private $ci_obj;
 	
 		$this->ci_obj = new StdClass;
 		
 		// Fix get_instance()
-		CodeIgniterTestCase::$test_instance =& $this;
 		$this->ci_instance($this->ci_obj);
 	}
 
 			   ->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')));