Skip to content

Instantly share code, notes, and snippets.

@slav123 slav123/CITest.php
Created Mar 27, 2015

Embed
What would you like to do?
Unit testing sample with CI 3
<?php
class CITest extends PHPUnit_Framework_TestCase
{
private $CI;
public function setUp()
{
// Load CI instance normally
$this->CI = &get_instance();
}
public function testGetPost()
{
$_SERVER['REQUEST_METHOD'] = 'GET';
$_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
You can’t perform that action at this time.