2016-08-19 00:51:35 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace SilverStripe\Dev;
|
|
|
|
|
2016-09-09 08:43:05 +02:00
|
|
|
use SilverStripe\Control\HTTPResponse;
|
2016-08-19 00:51:35 +02:00
|
|
|
|
|
|
|
/**
|
2016-09-09 08:43:05 +02:00
|
|
|
* Wrapper around HTTPResponse to make it look like a SimpleHTTPResposne
|
2016-08-19 00:51:35 +02:00
|
|
|
*/
|
|
|
|
class TestSession_STResponseWrapper
|
|
|
|
{
|
|
|
|
|
|
|
|
/**
|
2016-09-09 08:43:05 +02:00
|
|
|
* @var HTTPResponse
|
2016-08-19 00:51:35 +02:00
|
|
|
*/
|
|
|
|
private $response;
|
|
|
|
|
2016-09-09 08:43:05 +02:00
|
|
|
public function __construct(HTTPResponse $response)
|
2016-08-19 00:51:35 +02:00
|
|
|
{
|
|
|
|
$this->response = $response;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return string
|
|
|
|
*/
|
|
|
|
public function getContent()
|
|
|
|
{
|
|
|
|
return $this->response->getBody();
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return string
|
|
|
|
*/
|
|
|
|
public function getError()
|
|
|
|
{
|
|
|
|
return "";
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return null
|
|
|
|
*/
|
|
|
|
public function getSent()
|
|
|
|
{
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return string
|
|
|
|
*/
|
|
|
|
public function getHeaders()
|
|
|
|
{
|
|
|
|
return "";
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return string 'GET'
|
|
|
|
*/
|
|
|
|
public function getMethod()
|
|
|
|
{
|
|
|
|
return "GET";
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return string
|
|
|
|
*/
|
|
|
|
public function getUrl()
|
|
|
|
{
|
|
|
|
return "";
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return null
|
|
|
|
*/
|
|
|
|
public function getRequestData()
|
|
|
|
{
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
}
|