Example #1
0
 public function testSupportsHeadWithHandler()
 {
     $app = new Bullet\App();
     $app->path('test', function ($request) use($app) {
         $app->head(function ($request) use($app) {
             return $app->response()->header('X-Special', 'Stuff');
         });
         $app->get(function ($request) {
             return 'I am hidden with a HEAD request!';
         });
     });
     $request = new \Bullet\Request('HEAD', '/test');
     $response = $app->run($request);
     $this->assertEquals('HEAD', $request->method());
     $this->assertEquals('Stuff', $response->header('X-Special'));
     $this->assertEquals('', $response->content());
 }