Hello everybody,
I use Zend_Test for unit testing in Zend Framework. I have configured the bootstrap and testing environment properly then I got this error output from test unit
Failed asserting last controller used <"error"> was "index"
This error happens when I call my DbTable class inside action method such as
public function indexAction()
{
$roleDb = new Model_DbTable_Role;
$role = $roleDb->getAll();
$this->_forward('login');
}
If I remove two lines role, unit testing is success. It is my unit testing code
public function testIndexActionShouldRedirectToLoginAction()
{
$this->dispatch('/index');
$this->assertController('index');
$this->assertAction('login');
}
What's the problem with those lines?
How do I know the real error instead of just Failed asserting last controller used <"error">? Thank you