Exemplo n.º 1
0
 /**
  * @expectedException \RuntimeException
  */
 public function testDebugResponse()
 {
     $app = new Application();
     $app['debug'] = true;
     $app->handlers([new ResponseMiddleware($app), function () {
         throw new \RuntimeException();
     }]);
     $response = $app->handle(new Request());
 }
Exemplo n.º 2
0
 public function testIntegerParam()
 {
     $app = new Application();
     $app->handlers([new RouterMiddleware($app)]);
     $app->route('/blog/{id:[0-9]+}', function () {
         $this->response($this->params('id'));
     });
     $response = $app->handle(Request::create('/blog/12345'));
     $this->assertSame('12345', $response->getContent());
     $this->assertSame(200, $response->getStatusCode());
 }