public function testIsValid() { $TestVar = new Base(); $this->assertTrue(Base::isValid($TestVar)); $this->assertTrue(Object::isValid($TestVar)); $TestVar = new RESTProcessorA_underTest_isValid(); $this->assertTrue(RESTProcessorA_underTest_isValid::isValid($TestVar)); $this->assertTrue(RESTProcessorA::isValid($TestVar)); $this->assertTrue(ProcessorA::isValid($TestVar)); $this->assertTrue(Object::isValid($TestVar)); $TestVar = new ProcessorA_underTest_isValid(); $this->assertTrue(ProcessorA_underTest_isValid::isValid($TestVar)); $this->assertTrue(ProcessorA::isValid($TestVar)); $this->assertTrue(Object::isValid($TestVar)); $TestVar = new RESTController(); $this->assertTrue(RESTController::isValid($TestVar)); $this->assertTrue(FrontControllerA::isValid($TestVar)); $this->assertTrue(Object::isValid($TestVar)); $TestVar = new FrontControllerA_underTest_isValid(); $this->assertTrue(FrontControllerA_underTest_isValid::isValid($TestVar)); $this->assertTrue(FrontControllerA::isValid($TestVar)); $this->assertTrue(Object::isValid($TestVar)); $TestVar = new ModelA_underTest_isValid(); $this->assertTrue(ModelA_underTest_isValid::isValid($TestVar)); $this->assertTrue(ModelA::isValid($TestVar)); }
/** * @throws \vsc\application\sitemaps\ExceptionSitemap * @throws \vsc\presentation\responses\ExceptionResponseError * @returns FrontControllerA */ public function getFrontController() { if (!FrontControllerA::isValid($this->oController)) { $oControllerMapping = $this->getCurrentControllerMap(); if (ControllerMap::isValid($oControllerMapping)) { $sPath = $oControllerMapping->getPath(); if ($this->getSiteMap()->isValidObjectPath($sPath)) { include $sPath; $sControllerName = SiteMapA::getClassName($sPath); } } if (ClassMap::isValid($oControllerMapping)) { $sControllerName = $oControllerMapping->getPath(); } if (empty($sControllerName)) { throw new ExceptionResponseError('Could not find the correct front controller', HttpResponseType::NOT_FOUND); } /* @var $this->oController FrontControllerA */ $this->oController = new $sControllerName(); if (FrontControllerA::isValid($this->oController)) { // adding the map to the controller, allows it to add resources (styles,scripts) from inside it $this->oController->setMap($oControllerMapping); } } // d ($oControllerMapping); return $this->oController; }