Example #1
0
 /**
  * Check headers to see if we should localize the content, if so, create a new response and get it to do the
  * localization.
  *
  * @return ApiResponse
  */
 public function getResponse()
 {
     $apiResponse = new ApiResponse();
     if ($region = RequestFacade::header('Accept-Region')) {
         $apiResponse->setLocalizationRegion($region);
     }
     return $apiResponse;
 }
Example #2
0
 public function testCreatedWithRedirect()
 {
     $url = 'http:://foo.bar';
     $response = new ApiResponse();
     $response->created($url);
     $this->assertEquals(201, $response->getStatusCode());
     $this->assertEquals($url, $response->headers->get('location'));
 }