Fix tests on PHP 5.4

This commit is contained in:
Romain Neutron
2012-09-27 02:47:59 +02:00
parent c8e0f05494
commit 3f9dc687dc
15 changed files with 36 additions and 52 deletions

View File

@@ -1,33 +0,0 @@
<?php
/*
* This file is part of Phraseanet
*
* (c) 2005-2012 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
use Symfony\Component\HttpFoundation\Response;
/**
* Used as a temporary fix for https://github.com/fabpot/Silex/issues/438
*
* @license http://opensource.org/licenses/gpl-3.0 GPLv3
* @link www.phraseanet.com
*/
class API_V1_Response extends Response
{
private $originalStatusCode;
public function setOriginalStatusCode($code)
{
$this->originalStatusCode = $code;
}
public function getOriginalStatusCode()
{
return $this->originalStatusCode;
}
}

View File

@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
use Symfony\Component\HttpFoundation\Response;
/**
*
*
@@ -358,12 +360,14 @@ class API_V1_result
*/
public function get_response()
{
$response = new \API_V1_Response(
$response = new Response(
$this->format()
, $this->get_http_code()
, array('Content-Type' => $this->get_content_type())
, array(
'Content-Type' => $this->get_content_type(),
'X-Status-Code'=> $this->get_http_code(),
)
);
$response->setOriginalStatusCode($this->get_http_code());
$response->setCharset('UTF-8');
return $response;