Esempio n. 1
0
 public function testViewPassthrough()
 {
     $this->container['view']->registerEngine('Janeiro\\Mvc\\View\\Passthrough', ['.txt']);
     $this->container['router']->addRoute('/(.*)', ['module' => 'test', 'controller' => 'view', 'action' => 'passthrough']);
     $dispatcher = new Dispatcher($this->container);
     $dispatcher->dispatch(new Request());
     $this->assertEquals('yes sir or madam', $dispatcher->getResponse()->getContent());
 }
Esempio 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());
 }