Created
March 27, 2015 05:51
-
-
Save slav123/f4014b4f3a6366de19eb to your computer and use it in GitHub Desktop.
Unit testing sample with CI 3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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