Definition at line 5 of file SapiTest.php.
◆ testConstructFromServerArray()
Sabre\HTTP\SapiTest::testConstructFromServerArray |
( |
| ) |
|
Definition at line 7 of file SapiTest.php.
References $request, and Sabre\HTTP\Sapi\createFromServerArray().
10 'REQUEST_URI' =>
'/foo',
11 'REQUEST_METHOD' =>
'GET',
12 'HTTP_USER_AGENT' =>
'Evert',
13 'CONTENT_TYPE' =>
'text/xml',
14 'CONTENT_LENGTH' =>
'400',
15 'SERVER_PROTOCOL' =>
'HTTP/1.0',
18 $this->assertEquals(
'GET',
$request->getMethod());
19 $this->assertEquals(
'/foo',
$request->getUrl());
21 'User-Agent' => [
'Evert'],
22 'Content-Type' => [
'text/xml'],
23 'Content-Length' => [
'400'],
26 $this->assertEquals(
'1.0',
$request->getHttpVersion());
28 $this->assertEquals(
'400',
$request->getRawServerValue(
'CONTENT_LENGTH'));
29 $this->assertNull(
$request->getRawServerValue(
'FOO'));
foreach($paths as $path) $request
static createFromServerArray(array $serverArray)
This static method will create a new Request object, based on a PHP $_SERVER array.
◆ testConstructPHPAuth()
Sabre\HTTP\SapiTest::testConstructPHPAuth |
( |
| ) |
|
Definition at line 33 of file SapiTest.php.
References $request, and Sabre\HTTP\Sapi\createFromServerArray().
36 'REQUEST_URI' =>
'/foo',
37 'REQUEST_METHOD' =>
'GET',
38 'PHP_AUTH_USER' =>
'user',
39 'PHP_AUTH_PW' =>
'pass',
42 $this->assertEquals(
'GET',
$request->getMethod());
43 $this->assertEquals(
'/foo',
$request->getUrl());
45 'Authorization' => [
'Basic ' . base64_encode(
'user:pass')],
foreach($paths as $path) $request
static createFromServerArray(array $serverArray)
This static method will create a new Request object, based on a PHP $_SERVER array.
◆ testConstructPHPAuthDigest()
Sabre\HTTP\SapiTest::testConstructPHPAuthDigest |
( |
| ) |
|
Definition at line 50 of file SapiTest.php.
References $request, and Sabre\HTTP\Sapi\createFromServerArray().
53 'REQUEST_URI' =>
'/foo',
54 'REQUEST_METHOD' =>
'GET',
55 'PHP_AUTH_DIGEST' =>
'blabla',
58 $this->assertEquals(
'GET',
$request->getMethod());
59 $this->assertEquals(
'/foo',
$request->getUrl());
61 'Authorization' => [
'Digest blabla'],
foreach($paths as $path) $request
static createFromServerArray(array $serverArray)
This static method will create a new Request object, based on a PHP $_SERVER array.
◆ testConstructRedirectAuth()
Sabre\HTTP\SapiTest::testConstructRedirectAuth |
( |
| ) |
|
Definition at line 66 of file SapiTest.php.
References $request, and Sabre\HTTP\Sapi\createFromServerArray().
69 'REQUEST_URI' =>
'/foo',
70 'REQUEST_METHOD' =>
'GET',
71 'REDIRECT_HTTP_AUTHORIZATION' =>
'Basic bla',
74 $this->assertEquals(
'GET',
$request->getMethod());
75 $this->assertEquals(
'/foo',
$request->getUrl());
77 'Authorization' => [
'Basic bla'],
foreach($paths as $path) $request
static createFromServerArray(array $serverArray)
This static method will create a new Request object, based on a PHP $_SERVER array.
◆ testSend()
Sabre\HTTP\SapiTest::testSend |
( |
| ) |
|
Unfortunately we have no way of testing if the HTTP response code got changed.
Definition at line 88 of file SapiTest.php.
References $response, $result, and Sabre\HTTP\Sapi\sendResponse().
90 if (!function_exists(
'xdebug_get_headers')) {
91 $this->markTestSkipped(
'XDebug needs to be installed for this test to run');
94 $response =
new Response(204, [
'Content-Type' =>
'text/xml;charset=UTF-8']);
97 $response->addHeader(
'Content-Type',
'application/xml');
103 $headers = xdebug_get_headers();
110 "Content-Type: text/xml;charset=UTF-8",
111 "Content-Type: application/xml",
116 $this->assertEquals(
'foo',
$result);
static sendResponse(ResponseInterface $response)
Sends the HTTP response back to a HTTP client.
◆ testSendLimitedByContentLengthStream()
Sabre\HTTP\SapiTest::testSendLimitedByContentLengthStream |
( |
| ) |
|
testSend
Definition at line 146 of file SapiTest.php.
References $response, $result, and Sabre\HTTP\Sapi\sendResponse().
148 $response =
new Response(200, [
'Content-Length' => 19]);
150 $body =
fopen(
'php://memory',
'w');
151 fwrite($body,
'Ignore this. Send this sentence. Ignore this too.');
163 $this->assertEquals(
'Send this sentence.',
$result);
static sendResponse(ResponseInterface $response)
Sends the HTTP response back to a HTTP client.
◆ testSendLimitedByContentLengthString()
Sabre\HTTP\SapiTest::testSendLimitedByContentLengthString |
( |
| ) |
|
The documentation for this class was generated from the following file: