public function testDisableRegisteringRouterContent() { SimpleRouter::disableRegistration(); SimpleRouter::register("basket", new SimpleRoute("BasketModel", "BasketView", "BasketController")); $this->assertTrue($this->router->isRoute("user")); $this->assertTrue($this->router->isRoute("photo")); $this->assertTrue($this->router->isRoute("target")); $this->assertFalse($this->router->isRoute("basket")); $this->assertInstanceOf("Phoenix\\Routers\\SimpleRoute", $this->router->getRoute("user")); $this->assertInstanceOf("Phoenix\\Routers\\SimpleRoute", $this->router->getRoute("photo")); $this->assertInstanceOf("Phoenix\\Routers\\SimpleRoute", $this->router->getRoute("target")); $this->assertInstanceOf("Phoenix\\Routers\\SimpleRoute", $this->router->getRoute("basket")); $all = $this->router->getAllRoutes(); unset($all["index"]); $this->assertSame(self::$route_table, $all); }
/** * Register Routes into Router object. * * @todo * * @return void */ protected final function registerRoutes() { SimpleRouter::register("index", new SimpleRoute("App\\Models\\IndexModel", "App\\Views\\IndexView", "App\\Controllers\\IndexController")); }