How to test controllers with CodeIgniter PART 2?

Posted by Jeff on Stack Overflow See other posts from Stack Overflow or by Jeff
Published on 2009-07-18T15:21:56Z Indexed on 2010/03/08 12:21 UTC
Read the original article Hit count: 781

Filed under:
|
|

I am having difficulties testing Controllers in Codeigniter: I use Toast but when I invoke my Home Controller class I get an exception that "db" is not defined. Has anybody an idea how to test this 1-1?

Thanks

class Home_tests extends Toast {


function  __construct() {
    parent::__construct(__FILE__);
// Load any models, libraries etc. you need here
}


function test_select_user() {
    $controller = new Home();
    $controller->getDbUser('[email protected]','password');
    assert($query->num_rows() == 0 );
}
 }

© Stack Overflow or respective owner

Related posts about codeigniter

Related posts about controller