I have this part of code in my indexController:
public function init() { $this->_translate = $this->getInvokeArg('bootstrap')->getResource('translate'); } This works all fine and in PRD i don't get any errors
But when i am running my unit tests it generates the following error:
Fatal error: Call to a member function getResource() on a non-object in K:\stage 5\application\controllers\IndexController.php on line 9
This is my testcode:
class IndexControllerTest extends ControllerTestCase { public function testCanDisplayOurHomepage() { //Go to the main page of the webapplication $this->dispatch('/'); //check if we don't end up in an error controller $this->assertNotController('error'); $this->assertNotAction('error'); //Ok no error lets check if we are on the home page $this->assertModule('default'); $this->assertController('index'); $this->assertAction('index'); $this->assertResponseCode(200); } }