Created
February 24, 2013 22:30
-
-
Save willmendesneto/5026017 to your computer and use it in GitHub Desktop.
Gist do post "Usando PHPUnit no Codeigniter via Hooks"
Link: http://willmendesnetoprojects.wordpress.com/2013/02/24/usando-phpunit-no-codeigniter-via-hooks/
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 PostTest extends PHPUnit_Framework_TestCase | |
{ | |
private $CI; | |
public function setUp() | |
{ | |
$this->CI = &get_instance(); | |
$this->CI->load->database('testing'); | |
} | |
public function testGetsAllPosts() | |
{ | |
$this->CI->load->model('post'); | |
$posts = $this->CI->post->getAll(); | |
$this->assertEquals(0, count($posts)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment