Esempio n. 1
0
 function testGroup3()
 {
     $router = new \AuraTempleFramework\Router('hello');
     $router->addGroup('guest');
     $router->registerRoute('hello', 'HelloRouteAdmin', 'admin');
     $this->assertEquals(false, $router->getMethod());
 }
Esempio n. 2
0
 function testGetRoutes()
 {
     $router = new \AuraTempleFramework\Router('hello/world');
     $router->registerRoute('hello', 'HelloRoute');
     $router->registerRoute('world', 'WorldRoute');
     $routes = $router->getRoutes();
     $routes_arr = ['hello' => ['route' => 'hello', 'segments' => ['hello'], 'callback' => 'HelloRoute', 'group' => 'default'], 'world' => ['route' => 'world', 'segments' => ['world'], 'callback' => 'WorldRoute', 'group' => 'default']];
     $this->assertEquals($routes_arr, $routes);
     $this->assertEquals(count($routes_arr), count($routes));
 }
Esempio n. 3
0
 function textIncorrectComplexRoute()
 {
     $router = new \AuraTempleFramework\Router('user/world');
     $router->registerRoute('user/[0-9]*', 'ComplexRoute');
     $this->assertNotEquals('ComplexRoute', $router->getMethod());
 }
Esempio n. 4
0
 function testMultipleSegments()
 {
     $router = new \AuraTempleFramework\Router('hello/world');
     $router->registerRoute('hello/world', 'HelloWorldRoute');
     $this->assertEquals('HelloWorldRoute', $router->getMethod());
 }