Ejemplo n.º 1
0
 public function testContentNegotiation()
 {
     $this->app->get("/", function () {
         return new Response("hello from controller");
     });
     $req = Request::create("/");
     $req->headers->add(['Accept' => 'application/json']);
     $app = $this->app->builder->resolve($this->app);
     $app->handle($req);
     $header = $req->attributes->get("_accept");
     $this->assertInstanceOf('Negotiation\\AcceptHeader', $header);
     $this->assertEquals('application/json', $header->getValue());
 }