public function testGetControllerInitCall() { $helperBrokerMock = $this->getMock('Vmvc_HelperBroker'); $helperBrokerMock->expects($this->once())->method('callAlias')->with($this->equalTo('test')); $this->object->setHelperBroker($helperBrokerMock); $this->object->getController('TestControllerWithHelperCallAtInit'); }
protected function getController($controllerType) { // if no controller defined if ($this->controller === null) { return $this->controllerFactory->getController($controllerType); } // if active controllerName ne new controllerName $controllerName = $this->controllerFactory->getControllerName($controllerType); if ($controllerName != get_class($this->controller)) { return $this->controllerFactory->getController($controllerType); } return $this->controller; }