Ejemplo n.º 1
0
 public function testConcurrentRoutes()
 {
     $request = new Request();
     $request->set(['amodule', 'correct', 'foo']);
     $this->router->addRoute('/:module/:controller/:action', ['module' => 1, 'controller' => 2, 'action' => 'foo'])->addRoute('/amodule/:controller/foo', ['module' => 'correct', 'controller' => 1, 'action' => 'correct']);
     $route = $this->router->getRoute($request);
     $routeExpected = ['namespace' => 'Janeiro\\Module', 'module' => 'correct', 'controller' => 'correct', 'action' => 'correct', 'parameters' => [], 'methods' => null];
     $this->assertEquals($routeExpected, $route);
 }
Ejemplo n.º 2
0
 public function testParameterRequest()
 {
     $request = new Request();
     $request->set(['test', 'parameter', 'variable', '123']);
     $this->assertEquals('variable is 123', $this->dispatcher->dispatch($request)->getContent());
 }