/** * @param array $params config params * @return null */ public function execute(array $params = null) { /* regardless of the kernel settings unit tests * should have full error reporting and they should be displayed */ error_reporting(E_ALL | E_STRICT); ini_set('error_diplay', 'on'); $params = KernelRegistry::getParams(); $domains = KernelRegistry::getDomainMap(); $state = new KernelState(); TestRegistry::setKernelState($state); TestRegistry::setKernelParams($params); TestRegistry::setKernelDomainMap($domains); $this->setStatus('appfuel unittest: initialized'); }
/** * @return null */ public function setUp() { $this->bkRoutes = KernelRegistry::getRouteMap(); $this->bkParams = KernelRegistry::getParams(); $this->front = $this->createMvcFront(); KernelRegistry::clearRouteMap(); KernelRegistry::clearParams(); $routeMap = array('my-route' => 'TestFuel\\Fake\\Action\\TestFront\\ActionA'); KernelRegistry::setRouteMap($routeMap); $cli = null; if (isset($_SERVER['argv'])) { $cli = $_SERVER['argv']; } $this->bkSuperGlobals = array('get' => $_GET, 'post' => $_POST, 'files' => $_FILES, 'cookie' => $_COOKIE, 'argv' => $cli); }
/** * @return null */ public function setUp() { $this->bkRoutes = KernelRegistry::getRouteMap(); $this->bkParams = KernelRegistry::getParams(); KernelRegistry::clearRouteMap(); KernelRegistry::clearParams(); $routeMap = array('action-a' => 'TestFuel\\Fake\\Action\\TestAction\\ActionA', 'action-b' => 'TestFuel\\Fake\\Action\\TestAction\\ActionB', 'action-c' => 'TestFuel\\Fake\\Action\\TestAction\\ActionC'); KernelRegistry::setRouteMap($routeMap); $cli = null; if (isset($_SERVER['argv'])) { $cli = $_SERVER['argv']; } $this->bkSuperGlobals = array('get' => $_GET, 'post' => $_POST, 'files' => $_FILES, 'cookie' => $_COOKIE, 'argv' => $cli); $this->dispatcher = new MvcActionDispatcher(); $this->action = new MvcAction('action-a', $this->dispatcher); }