public function testBuildingWithCustomStatusCodeAndHeaders() { $builder = new ResponseBuilder('test'); $builder->statusCode(302); $builder->header('Foo', 'Bar'); $response = $builder->build(); $this->assertEquals('Bar', $response->headers->get('Foo')); $this->assertEquals(302, $response->getStatusCode()); }
/** * Respond with a no content response. * * @return \Dingo\Api\Http\ResponseBuilder */ public function noContent() { $response = new ResponseBuilder(null); $response->setStatusCode(204); return $response; }