Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F1820680
ResponseTest.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Size
1 KB
Subscribers
None
ResponseTest.php
View Options
<?php
namespace
Sabre\HTTP
;
class
ResponseTest
extends
\PHPUnit_Framework_TestCase
{
function
testConstruct
()
{
$response
=
new
Response
(
200
,
[
'Content-Type'
=>
'text/xml'
]);
$this
->
assertEquals
(
200
,
$response
->
getStatus
());
$this
->
assertEquals
(
'OK'
,
$response
->
getStatusText
());
}
function
testSetStatus
()
{
$response
=
new
Response
();
$response
->
setStatus
(
'402 Where
\'
s my money?'
);
$this
->
assertEquals
(
402
,
$response
->
getStatus
());
$this
->
assertEquals
(
'Where
\'
s my money?'
,
$response
->
getStatusText
());
}
/**
* @expectedException InvalidArgumentException
*/
function
testInvalidStatus
()
{
$response
=
new
Response
(
1000
);
}
function
testToString
()
{
$response
=
new
Response
(
200
,
[
'Content-Type'
=>
'text/xml'
]);
$response
->
setBody
(
'foo'
);
$expected
=
<<<HI
HTTP/1.1 200 OK\r
Content-Type: text/xml\r
\r
foo
HI;
$this
->
assertEquals
(
$expected
,
(
string
)
$response
);
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sun, Dec 22, 9:01 AM (3 d, 21 h ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
915718
Default Alt Text
ResponseTest.php (1 KB)
Attached To
rDAVCAL DokuWiki DAVCal PlugIn
Event Timeline
Log In to Comment