10 'User-Agent' =>
'Evert',
12 $this->assertEquals(
'GET',
$request->getMethod());
13 $this->assertEquals(
'/foo',
$request->getUrl());
15 'User-Agent' => [
'Evert'],
34 $this->assertEquals([],
$request->getQueryParameters());
46 $this->assertEquals(
'PUT',
$request->getMethod());
53 'HTTP_HOST' =>
'sabredav.org',
54 'REQUEST_URI' =>
'/foo' 59 $this->assertEquals(
'http://sabredav.org/foo',
$r->getAbsoluteUrl());
62 'HTTP_HOST' =>
'sabredav.org',
63 'REQUEST_URI' =>
'/foo',
69 $this->assertEquals(
'https://sabredav.org/foo',
$r->getAbsoluteUrl());
80 $this->assertEquals(
$post,
$r->getPostData());
90 $this->assertEquals(
'bar',
$request->getPath());
100 $this->assertEquals(
'bar',
$request->getPath());
110 $this->assertEquals(
'',
$request->getPath());
129 $request =
new Request(
'PUT',
'/foo/bar', [
'Content-Type' =>
'text/xml']);
133 PUT /foo/bar
HTTP/1.1\r
134 Content-Type: text/xml\r
138 $this->assertEquals($expected, (
string)
$request);
144 $request =
new Request(
'PUT',
'/foo/bar', [
'Content-Type' =>
'text/xml',
'Authorization' =>
'Basic foobar']);
148 PUT /foo/bar
HTTP/1.1\r
149 Content-Type: text/xml\r
150 Authorization: Basic REDACTED\r
154 $this->assertEquals($expected, (
string)
$request);
testGetPathMissingSlash()
if((!isset($_SERVER['DOCUMENT_ROOT'])) OR(empty($_SERVER['DOCUMENT_ROOT']))) $_SERVER['DOCUMENT_ROOT']
testConstructorWithArray()
foreach($paths as $path) $request
The Request class represents a single HTTP request.
static getRequest()
This static method will create a new Request object, based on the current PHP request.
testCreateFromPHPRequest()
testGetQueryParametersNoData()
testGetPathOutsideBaseUrl()
testToStringAuthorization()
static createFromServerArray(array $serverArray)
This static method will create a new Request object, based on a PHP $_SERVER array.
testGetPathStrippedQuery()