Skip to content

Instantly share code, notes, and snippets.



Created Mar 27, 2015
What would you like to do?
Unit testing sample with CI 3
class CITest extends PHPUnit_Framework_TestCase
private $CI;
public function setUp()
// Load CI instance normally
$this->CI = &get_instance();
public function testGetPost()
$_GET['foo'] = 'bar';
$this->assertEquals('bar', $this->CI->input->get_post('foo'));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment