ILIAS
release_5-4 Revision v5.4.26-12-gabc799a52e6
◀ ilDoc Overview
ResponseTest.php
Go to the documentation of this file.
1
<?
php
2
3
namespace
Sabre\HTTP
;
4
5
class
ResponseTest
extends
\PHPUnit_Framework_TestCase
{
6
7
function
testConstruct
() {
8
9
$response
=
new
Response
(200, [
'Content-Type'
=>
'text/xml'
]);
10
$this->assertEquals(200,
$response
->getStatus());
11
$this->assertEquals(
'OK'
,
$response
->getStatusText());
12
13
}
14
15
function
testSetStatus
() {
16
17
$response
=
new
Response
();
18
$response
->setStatus(
'402 Where\'s my money?'
);
19
$this->assertEquals(402,
$response
->getStatus());
20
$this->assertEquals(
'Where\'s my money?'
,
$response
->getStatusText());
21
22
}
23
27
function
testInvalidStatus
() {
28
29
$response
=
new
Response
(1000);
30
31
}
32
33
function
testToString
() {
34
35
$response
=
new
Response
(200, [
'Content-Type'
=>
'text/xml'
]);
36
$response
->setBody(
'foo'
);
37
38
$expected = <<<HI
39
HTTP
/1.1 200 OK\r
40
Content-Type: text/xml\r
41
\r
42
foo
43
HI;
44
$this->assertEquals($expected, (
string
)
$response
);
45
46
}
47
48
}
Sabre\HTTP\ResponseTest\testSetStatus
testSetStatus()
Definition:
ResponseTest.php:15
Sabre\HTTP\ResponseTest\testInvalidStatus
testInvalidStatus()
InvalidArgumentException
Definition:
ResponseTest.php:27
Sabre\HTTP
Definition:
ResponseMock.php:3
PHPUnit_Framework_TestCase
Sabre\HTTP\ResponseTest\testToString
testToString()
Definition:
ResponseTest.php:33
Sabre\HTTP\Response
This class represents a single HTTP response.
Definition:
Response.php:12
Sabre\HTTP\ResponseTest\testConstruct
testConstruct()
Definition:
ResponseTest.php:7
Sabre\HTTP\ResponseTest
Definition:
ResponseTest.php:5
php
$response
$response
Definition:
proxy_ylocal.php:39
HTTP
libs
composer
vendor
sabre
http
tests
HTTP
ResponseTest.php
Generated on Thu Jan 16 2025 19:01:52 for ILIAS by
1.8.13 (using
Doxyfile
)