[Pkg-owncloud-commits] [php-sabredav] 34/66: Making sabre/dav work with the latest sabre/http
David Prévot
taffit at moszumanska.debian.org
Sat Jan 18 20:08:20 UTC 2014
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to branch master
in repository php-sabredav.
commit 7d01be25bc19bdb4caefb8d9e1182c3e79359adf
Author: Evert Pot <evert at rooftopsolutions.nl>
Date: Thu Jan 2 12:12:56 2014 +0100
Making sabre/dav work with the latest sabre/http
---
composer.json | 2 +-
.../CalDAV/ExpandEventsDTSTARTandDTENDTest.php | 2 +-
.../ExpandEventsDTSTARTandDTENDbyDayTest.php | 2 +-
.../Sabre/CalDAV/ExpandEventsDoubleEventsTest.php | 2 +-
tests/Sabre/CalDAV/FreeBusyReportTest.php | 6 +-
tests/Sabre/CalDAV/FreeBusyRequestTest.php | 26 +-
tests/Sabre/CalDAV/GetEventsByTimerangeTest.php | 2 +-
tests/Sabre/CalDAV/ICSExportPluginTest.php | 48 +-
tests/Sabre/CalDAV/Issue203Test.php | 2 +-
tests/Sabre/CalDAV/Issue205Test.php | 2 +-
tests/Sabre/CalDAV/Issue211Test.php | 2 +-
tests/Sabre/CalDAV/Issue220Test.php | 4 +-
tests/Sabre/CalDAV/Issue228Test.php | 2 +-
tests/Sabre/CalDAV/OutboxPostTest.php | 50 +-
tests/Sabre/CalDAV/PluginTest.php | 74 +-
tests/Sabre/CalDAV/SharingPluginTest.php | 52 +-
tests/Sabre/CalDAV/ValidateICalTest.php | 52 +-
tests/Sabre/CardDAV/AddressBookQueryTest.php | 16 +-
tests/Sabre/CardDAV/MultiGetTest.php | 4 +-
tests/Sabre/CardDAV/SogoStripContentTypeTest.php | 2 +-
tests/Sabre/CardDAV/VCFExportTest.php | 4 +-
tests/Sabre/CardDAV/ValidateVCardTest.php | 24 +-
tests/Sabre/DAV/Auth/Backend/AbstractBasicTest.php | 4 +-
.../Sabre/DAV/Auth/Backend/AbstractDigestTest.php | 10 +-
tests/Sabre/DAV/Auth/Backend/ApacheTest.php | 2 +-
tests/Sabre/DAV/Auth/Backend/BasicCallBackTest.php | 4 +-
tests/Sabre/DAV/Auth/PluginTest.php | 4 +-
tests/Sabre/DAV/Browser/MapGetToPropFindTest.php | 4 +-
tests/Sabre/DAV/Browser/PluginTest.php | 20 +-
tests/Sabre/DAV/ClientTest.php | 947 ---------------------
tests/Sabre/DAV/FSExt/ServerTest.php | 36 +-
tests/Sabre/DAV/GetIfConditionsTest.php | 20 +-
tests/Sabre/DAV/HTTPPreferParsingTest.php | 20 +-
tests/Sabre/DAV/Issue33Test.php | 4 +-
tests/Sabre/DAV/Locks/MSWordTest.php | 12 +-
tests/Sabre/DAV/Locks/PluginTest.php | 148 ++--
tests/Sabre/DAV/Mount/PluginTest.php | 8 +-
tests/Sabre/DAV/PartialUpdate/PluginTest.php | 20 +-
.../Sabre/DAV/Property/SupportedReportSetTest.php | 6 +-
tests/Sabre/DAV/ServerCopyMoveTest.php | 40 +-
tests/Sabre/DAV/ServerEventsTest.php | 4 +-
tests/Sabre/DAV/ServerFinderBlockTest.php | 8 +-
tests/Sabre/DAV/ServerMKCOLTest.php | 52 +-
tests/Sabre/DAV/ServerPluginTest.php | 4 +-
tests/Sabre/DAV/ServerPreconditionTest.php | 44 +-
tests/Sabre/DAV/ServerPropsTest.php | 8 +-
tests/Sabre/DAV/ServerRangeTest.php | 36 +-
tests/Sabre/DAV/ServerSimpleTest.php | 100 +--
tests/Sabre/DAV/Sync/PluginTest.php | 52 +-
tests/Sabre/DAV/TemporaryFileFilterTest.php | 42 +-
tests/Sabre/DAVACL/ExpandPropertiesTest.php | 16 +-
tests/Sabre/DAVACL/PluginAdminTest.php | 8 +-
tests/Sabre/DAVACL/PrincipalPropertySearchTest.php | 16 +-
.../DAVACL/PrincipalSearchPropertySetTest.php | 12 +-
54 files changed, 572 insertions(+), 1519 deletions(-)
diff --git a/composer.json b/composer.json
index 060f07c..6600edd 100644
--- a/composer.json
+++ b/composer.json
@@ -17,7 +17,7 @@
"php": ">=5.4.1",
"sabre/vobject" : "~3.1.0",
"sabre/event" : "~1.0.0",
- "sabre/http" : "~2.0.0-alpha5",
+ "sabre/http" : "dev-master",
"ext-dom": "*",
"ext-pcre": "*",
"ext-spl": "*",
diff --git a/tests/Sabre/CalDAV/ExpandEventsDTSTARTandDTENDTest.php b/tests/Sabre/CalDAV/ExpandEventsDTSTARTandDTENDTest.php
index 33356cf..628b017 100644
--- a/tests/Sabre/CalDAV/ExpandEventsDTSTARTandDTENDTest.php
+++ b/tests/Sabre/CalDAV/ExpandEventsDTSTARTandDTENDTest.php
@@ -53,7 +53,7 @@ END:VCALENDAR
function testExpand() {
- $request = HTTP\Request::createFromServerArray([
+ $request = HTTP\Sapi::createFromServerArray([
'REQUEST_METHOD' => 'REPORT',
'HTTP_CONTENT_TYPE' => 'application/xml',
'REQUEST_URI' => '/calendars/user1/calendar1',
diff --git a/tests/Sabre/CalDAV/ExpandEventsDTSTARTandDTENDbyDayTest.php b/tests/Sabre/CalDAV/ExpandEventsDTSTARTandDTENDbyDayTest.php
index ae7557a..a0e5923 100644
--- a/tests/Sabre/CalDAV/ExpandEventsDTSTARTandDTENDbyDayTest.php
+++ b/tests/Sabre/CalDAV/ExpandEventsDTSTARTandDTENDbyDayTest.php
@@ -45,7 +45,7 @@ END:VCALENDAR
function testExpandRecurringByDayEvent() {
- $request = HTTP\Request::createFromServerArray(array(
+ $request = HTTP\Sapi::createFromServerArray(array(
'REQUEST_METHOD' => 'REPORT',
'HTTP_CONTENT_TYPE' => 'application/xml',
'REQUEST_URI' => '/calendars/user1/calendar1',
diff --git a/tests/Sabre/CalDAV/ExpandEventsDoubleEventsTest.php b/tests/Sabre/CalDAV/ExpandEventsDoubleEventsTest.php
index 28b05dc..f3c98ed 100644
--- a/tests/Sabre/CalDAV/ExpandEventsDoubleEventsTest.php
+++ b/tests/Sabre/CalDAV/ExpandEventsDoubleEventsTest.php
@@ -56,7 +56,7 @@ END:VCALENDAR
function testExpand() {
- $request = HTTP\Request::createFromServerArray([
+ $request = HTTP\Sapi::createFromServerArray([
'REQUEST_METHOD' => 'REPORT',
'HTTP_CONTENT_TYPE' => 'application/xml',
'REQUEST_URI' => '/calendars/user1/calendar1',
diff --git a/tests/Sabre/CalDAV/FreeBusyReportTest.php b/tests/Sabre/CalDAV/FreeBusyReportTest.php
index 111ed30..346f7fa 100644
--- a/tests/Sabre/CalDAV/FreeBusyReportTest.php
+++ b/tests/Sabre/CalDAV/FreeBusyReportTest.php
@@ -68,7 +68,7 @@ ics
$this->server = new DAV\Server([$calendar]);
- $request = HTTP\Request::createFromServerArray([
+ $request = HTTP\Sapi::createFromServerArray([
'REQUEST_URI' => '/calendar',
]);
$this->server->httpRequest = $request;
@@ -92,7 +92,7 @@ XML;
$dom = DAV\XMLUtil::loadDOMDocument($reportXML);
$this->plugin->report('{urn:ietf:params:xml:ns:caldav}free-busy-query', $dom);
- $this->assertEquals('200 OK', $this->server->httpResponse->status);
+ $this->assertEquals(200, $this->server->httpResponse->status);
$this->assertEquals('text/calendar', $this->server->httpResponse->headers['Content-Type']);
$this->assertTrue(strpos($this->server->httpResponse->body,'BEGIN:VFREEBUSY')!==false);
@@ -119,7 +119,7 @@ XML;
*/
function testFreeBusyReportWrongNode() {
- $request = HTTP\Request::createFromServerArray(array(
+ $request = HTTP\Sapi::createFromServerArray(array(
'REQUEST_URI' => '/',
));
$this->server->httpRequest = $request;
diff --git a/tests/Sabre/CalDAV/FreeBusyRequestTest.php b/tests/Sabre/CalDAV/FreeBusyRequestTest.php
index 327bc76..4df95d1 100644
--- a/tests/Sabre/CalDAV/FreeBusyRequestTest.php
+++ b/tests/Sabre/CalDAV/FreeBusyRequestTest.php
@@ -47,7 +47,7 @@ END:VCALENDAR',
new CalendarRootNode($principalBackend, $caldavBackend),
);
- $this->request = HTTP\Request::createFromServerArray([
+ $this->request = HTTP\Sapi::createFromServerArray([
'CONTENT_TYPE' => 'text/calendar',
]);
$this->response = new HTTP\ResponseMock();
@@ -71,7 +71,7 @@ END:VCALENDAR',
function testWrongContentType() {
- $this->server->httpRequest = HTTP\Request::createFromServerArray(array(
+ $this->server->httpRequest = HTTP\Sapi::createFromServerArray(array(
'CONTENT_TYPE' => 'text/plain',
'REQUEST_METHOD' => 'POST',
'REQUEST_URI' => '/calendars/user1/outbox',
@@ -85,7 +85,7 @@ END:VCALENDAR',
function testNotFound() {
- $this->server->httpRequest = HTTP\Request::createFromServerArray(array(
+ $this->server->httpRequest = HTTP\Sapi::createFromServerArray(array(
'CONTENT_TYPE' => 'text/calendar',
'REQUEST_METHOD' => 'POST',
'REQUEST_URI' => '/calendars/user1/blabla',
@@ -99,7 +99,7 @@ END:VCALENDAR',
function testNotOutbox() {
- $this->server->httpRequest = HTTP\Request::createFromServerArray(array(
+ $this->server->httpRequest = HTTP\Sapi::createFromServerArray(array(
'CONTENT_TYPE' => 'text/calendar',
'REQUEST_METHOD' => 'POST',
'REQUEST_URI' => '/calendars/user1/inbox',
@@ -116,7 +116,7 @@ END:VCALENDAR',
*/
function testNoItipMethod() {
- $this->server->httpRequest = HTTP\Request::createFromServerArray(array(
+ $this->server->httpRequest = HTTP\Sapi::createFromServerArray(array(
'CONTENT_TYPE' => 'text/calendar',
'REQUEST_METHOD' => 'POST',
'REQUEST_URI' => '/calendars/user1/outbox',
@@ -139,7 +139,7 @@ ICS;
*/
function testNoVFreeBusy() {
- $this->server->httpRequest = HTTP\Request::createFromServerArray(array(
+ $this->server->httpRequest = HTTP\Sapi::createFromServerArray(array(
'CONTENT_TYPE' => 'text/calendar',
'REQUEST_METHOD' => 'POST',
'REQUEST_URI' => '/calendars/user1/outbox',
@@ -163,7 +163,7 @@ ICS;
*/
function testIncorrectOrganizer() {
- $this->server->httpRequest = HTTP\Request::createFromServerArray(array(
+ $this->server->httpRequest = HTTP\Sapi::createFromServerArray(array(
'CONTENT_TYPE' => 'text/calendar',
'REQUEST_METHOD' => 'POST',
'REQUEST_URI' => '/calendars/user1/outbox',
@@ -188,7 +188,7 @@ ICS;
*/
function testNoAttendees() {
- $this->server->httpRequest = HTTP\Request::createFromServerArray(array(
+ $this->server->httpRequest = HTTP\Sapi::createFromServerArray(array(
'CONTENT_TYPE' => 'text/calendar',
'REQUEST_METHOD' => 'POST',
'REQUEST_URI' => '/calendars/user1/outbox',
@@ -213,7 +213,7 @@ ICS;
*/
function testNoDTStart() {
- $this->server->httpRequest = HTTP\Request::createFromServerArray(array(
+ $this->server->httpRequest = HTTP\Sapi::createFromServerArray(array(
'CONTENT_TYPE' => 'text/calendar',
'REQUEST_METHOD' => 'POST',
'REQUEST_URI' => '/calendars/user1/outbox',
@@ -236,7 +236,7 @@ ICS;
function testSucceed() {
- $this->server->httpRequest = HTTP\Request::createFromServerArray(array(
+ $this->server->httpRequest = HTTP\Sapi::createFromServerArray(array(
'CONTENT_TYPE' => 'text/calendar',
'REQUEST_METHOD' => 'POST',
'REQUEST_URI' => '/calendars/user1/outbox',
@@ -264,7 +264,7 @@ ICS;
$this->plugin->httpPost($this->server->httpRequest, $this->response)
);
- $this->assertEquals('200 OK' , $this->response->status);
+ $this->assertEquals(200, $this->response->status);
$this->assertEquals(array(
'Content-Type' => 'application/xml',
), $this->response->headers);
@@ -289,7 +289,7 @@ ICS;
function testNoPrivilege() {
- $this->server->httpRequest = HTTP\Request::createFromServerArray(array(
+ $this->server->httpRequest = HTTP\Sapi::createFromServerArray(array(
'CONTENT_TYPE' => 'text/calendar',
'REQUEST_METHOD' => 'POST',
'REQUEST_URI' => '/calendars/user1/outbox',
@@ -313,7 +313,7 @@ ICS;
$this->plugin->httpPost($this->server->httpRequest, $this->response)
);
- $this->assertEquals('200 OK' , $this->response->status);
+ $this->assertEquals(200, $this->response->status);
$this->assertEquals([
'Content-Type' => 'application/xml',
], $this->response->headers);
diff --git a/tests/Sabre/CalDAV/GetEventsByTimerangeTest.php b/tests/Sabre/CalDAV/GetEventsByTimerangeTest.php
index 199752d..f51343d 100644
--- a/tests/Sabre/CalDAV/GetEventsByTimerangeTest.php
+++ b/tests/Sabre/CalDAV/GetEventsByTimerangeTest.php
@@ -48,7 +48,7 @@ END:VCALENDAR
function testQueryTimerange() {
- $request = HTTP\Request::createFromServerArray([
+ $request = HTTP\Sapi::createFromServerArray([
'REQUEST_METHOD' => 'REPORT',
'HTTP_CONTENT_TYPE' => 'application/xml',
'REQUEST_URI' => '/calendars/user1/calendar1',
diff --git a/tests/Sabre/CalDAV/ICSExportPluginTest.php b/tests/Sabre/CalDAV/ICSExportPluginTest.php
index 42bc457..9a7d015 100644
--- a/tests/Sabre/CalDAV/ICSExportPluginTest.php
+++ b/tests/Sabre/CalDAV/ICSExportPluginTest.php
@@ -46,7 +46,7 @@ class ICSExportPluginTest extends \PHPUnit_Framework_TestCase {
$s->addPlugin($p);
$s->addPlugin(new Plugin());
- $h = HTTP\Request::createFromServerArray([
+ $h = HTTP\Sapi::createFromServerArray([
'REQUEST_URI' => '/UUID-123467?export',
'REQUEST_METHOD' => 'GET',
]);
@@ -56,7 +56,7 @@ class ICSExportPluginTest extends \PHPUnit_Framework_TestCase {
$this->assertFalse($p->httpGet($h, $s->httpResponse));
- $this->assertEquals('200 OK',$s->httpResponse->status);
+ $this->assertEquals(200, $s->httpResponse->status);
$this->assertEquals([
'Content-Type' => 'text/calendar',
], $s->httpResponse->headers);
@@ -93,7 +93,7 @@ class ICSExportPluginTest extends \PHPUnit_Framework_TestCase {
$s->addPlugin($p);
$s->addPlugin(new Plugin());
- $h = HTTP\Request::createFromServerArray([
+ $h = HTTP\Sapi::createFromServerArray([
'REQUEST_URI' => '/UUID-123467?export',
'REQUEST_METHOD' => 'GET',
]);
@@ -105,7 +105,7 @@ class ICSExportPluginTest extends \PHPUnit_Framework_TestCase {
$this->assertFalse($p->httpGet($h, $s->httpResponse));
DAV\Server::$exposeVersion = true;
- $this->assertEquals('200 OK',$s->httpResponse->status);
+ $this->assertEquals(200, $s->httpResponse->status);
$this->assertEquals([
'Content-Type' => 'text/calendar',
], $s->httpResponse->headers);
@@ -129,7 +129,7 @@ class ICSExportPluginTest extends \PHPUnit_Framework_TestCase {
$s = new DAV\Server();
$s->addPlugin($p);
- $h = HTTP\Request::createFromServerArray([
+ $h = HTTP\Sapi::createFromServerArray([
'REQUEST_URI' => '/UUID-123467',
'REQUEST_METHOD' => 'GET',
]);
@@ -157,7 +157,7 @@ class ICSExportPluginTest extends \PHPUnit_Framework_TestCase {
$s->addPlugin(new Plugin());
$s->addPlugin(new DAVACL\Plugin());
- $h = HTTP\Request::createFromServerArray([
+ $h = HTTP\Sapi::createFromServerArray([
'REQUEST_URI' => '/UUID-123467?export',
]);
@@ -200,7 +200,7 @@ class ICSExportPluginTest extends \PHPUnit_Framework_TestCase {
$s->getPlugin('acl')->adminPrincipals = array('principals/admin');
- $h = HTTP\Request::createFromServerArray([
+ $h = HTTP\Sapi::createFromServerArray([
'REQUEST_URI' => '/UUID-123467?export',
'REQUEST_METHOD' => 'GET',
]);
@@ -210,7 +210,7 @@ class ICSExportPluginTest extends \PHPUnit_Framework_TestCase {
$s->exec();
- $this->assertEquals('200 OK',$s->httpResponse->status,'Invalid status received. Response body: '. $s->httpResponse->body);
+ $this->assertEquals(200, $s->httpResponse->status,'Invalid status received. Response body: '. $s->httpResponse->body);
$this->assertEquals(array(
'Content-Type' => 'text/calendar',
), $s->httpResponse->headers);
@@ -247,7 +247,7 @@ class ICSExportPluginTest extends \PHPUnit_Framework_TestCase {
$s->addPlugin($p);
$s->addPlugin(new Plugin());
- $h = HTTP\Request::createFromServerArray([
+ $h = HTTP\Sapi::createFromServerArray([
'REQUEST_URI' => '/UUID-123467?export&start=foo',
'REQUEST_METHOD' => 'GET',
]);
@@ -257,7 +257,7 @@ class ICSExportPluginTest extends \PHPUnit_Framework_TestCase {
$s->exec();
- $this->assertEquals('400 Bad request',$s->httpResponse->status,'Invalid status received. Response body: '. $s->httpResponse->body);
+ $this->assertEquals(400, $s->httpResponse->status,'Invalid status received. Response body: '. $s->httpResponse->body);
}
@@ -282,7 +282,7 @@ class ICSExportPluginTest extends \PHPUnit_Framework_TestCase {
$s->addPlugin($p);
$s->addPlugin(new Plugin());
- $h = HTTP\Request::createFromServerArray([
+ $h = HTTP\Sapi::createFromServerArray([
'REQUEST_URI' => '/UUID-123467?export&end=foo',
'REQUEST_METHOD' => 'GET',
]);
@@ -292,7 +292,7 @@ class ICSExportPluginTest extends \PHPUnit_Framework_TestCase {
$s->exec();
- $this->assertEquals('400 Bad request',$s->httpResponse->status,'Invalid status received. Response body: '. $s->httpResponse->body);
+ $this->assertEquals(400, $s->httpResponse->status,'Invalid status received. Response body: '. $s->httpResponse->body);
}
@@ -317,7 +317,7 @@ class ICSExportPluginTest extends \PHPUnit_Framework_TestCase {
$s->addPlugin($p);
$s->addPlugin(new Plugin());
- $h = HTTP\Request::createFromServerArray([
+ $h = HTTP\Sapi::createFromServerArray([
'REQUEST_URI' => '/UUID-123467?export&start=1&end=2',
'REQUEST_METHOD' => 'GET',
]);
@@ -327,7 +327,7 @@ class ICSExportPluginTest extends \PHPUnit_Framework_TestCase {
$s->exec();
- $this->assertEquals('200 OK',$s->httpResponse->status,'Invalid status received. Response body: '. $s->httpResponse->body);
+ $this->assertEquals(200, $s->httpResponse->status,'Invalid status received. Response body: '. $s->httpResponse->body);
$obj = VObject\Reader::read($s->httpResponse->body);
$this->assertEquals(0,count($obj->VTIMEZONE));
@@ -356,7 +356,7 @@ class ICSExportPluginTest extends \PHPUnit_Framework_TestCase {
$s->addPlugin($p);
$s->addPlugin(new Plugin());
- $h = HTTP\Request::createFromServerArray([
+ $h = HTTP\Sapi::createFromServerArray([
'REQUEST_URI' => '/UUID-123467?export&expand=1&end=1',
'REQUEST_METHOD' => 'GET',
]);
@@ -366,7 +366,7 @@ class ICSExportPluginTest extends \PHPUnit_Framework_TestCase {
$s->exec();
- $this->assertEquals('400 Bad request',$s->httpResponse->status,'Invalid status received. Response body: '. $s->httpResponse->body);
+ $this->assertEquals(400, $s->httpResponse->status,'Invalid status received. Response body: '. $s->httpResponse->body);
}
@@ -391,7 +391,7 @@ class ICSExportPluginTest extends \PHPUnit_Framework_TestCase {
$s->addPlugin($p);
$s->addPlugin(new Plugin());
- $h = HTTP\Request::createFromServerArray([
+ $h = HTTP\Sapi::createFromServerArray([
'REQUEST_URI' => '/UUID-123467?export&start=1&end=2000000000&expand=1',
'REQUEST_METHOD' => 'GET',
]);
@@ -401,7 +401,7 @@ class ICSExportPluginTest extends \PHPUnit_Framework_TestCase {
$s->exec();
- $this->assertEquals('200 OK',$s->httpResponse->status,'Invalid status received. Response body: '. $s->httpResponse->body);
+ $this->assertEquals(200, $s->httpResponse->status,'Invalid status received. Response body: '. $s->httpResponse->body);
$obj = VObject\Reader::read($s->httpResponse->body);
$this->assertEquals(0,count($obj->VTIMEZONE));
@@ -430,7 +430,7 @@ class ICSExportPluginTest extends \PHPUnit_Framework_TestCase {
$s->addPlugin($p);
$s->addPlugin(new Plugin());
- $h = HTTP\Request::createFromServerArray([
+ $h = HTTP\Sapi::createFromServerArray([
'REQUEST_URI' => '/UUID-123467?export',
'REQUEST_METHOD' => 'GET',
'HTTP_ACCEPT' => 'application/calendar+json',
@@ -441,7 +441,7 @@ class ICSExportPluginTest extends \PHPUnit_Framework_TestCase {
$s->exec();
- $this->assertEquals('200 OK',$s->httpResponse->status,'Invalid status received. Response body: '. $s->httpResponse->body);
+ $this->assertEquals(200, $s->httpResponse->status,'Invalid status received. Response body: '. $s->httpResponse->body);
$this->assertEquals('application/calendar+json', $s->httpResponse->getHeader('Content-Type'));
}
@@ -467,7 +467,7 @@ class ICSExportPluginTest extends \PHPUnit_Framework_TestCase {
$s->addPlugin($p);
$s->addPlugin(new Plugin());
- $h = HTTP\Request::createFromServerArray([
+ $h = HTTP\Sapi::createFromServerArray([
'REQUEST_URI' => '/UUID-123467?export&accept=jcal',
'REQUEST_METHOD' => 'GET',
]);
@@ -477,7 +477,7 @@ class ICSExportPluginTest extends \PHPUnit_Framework_TestCase {
$s->exec();
- $this->assertEquals('200 OK',$s->httpResponse->status,'Invalid status received. Response body: '. $s->httpResponse->body);
+ $this->assertEquals(200, $s->httpResponse->status,'Invalid status received. Response body: '. $s->httpResponse->body);
$this->assertEquals('application/calendar+json', $s->httpResponse->getHeader('Content-Type'));
}
@@ -503,7 +503,7 @@ class ICSExportPluginTest extends \PHPUnit_Framework_TestCase {
$s->addPlugin($p);
$s->addPlugin(new Plugin());
- $h = HTTP\Request::createFromServerArray([
+ $h = HTTP\Sapi::createFromServerArray([
'REQUEST_URI' => '/UUID-123467?export',
'REQUEST_METHOD' => 'GET',
'HTTP_ACCEPT' => 'text/plain',
@@ -514,7 +514,7 @@ class ICSExportPluginTest extends \PHPUnit_Framework_TestCase {
$s->exec();
- $this->assertEquals('200 OK',$s->httpResponse->status,'Invalid status received. Response body: '. $s->httpResponse->body);
+ $this->assertEquals(200, $s->httpResponse->status,'Invalid status received. Response body: '. $s->httpResponse->body);
$this->assertEquals('text/calendar', $s->httpResponse->getHeader('Content-Type'));
}
diff --git a/tests/Sabre/CalDAV/Issue203Test.php b/tests/Sabre/CalDAV/Issue203Test.php
index a928276..8f0b97c 100644
--- a/tests/Sabre/CalDAV/Issue203Test.php
+++ b/tests/Sabre/CalDAV/Issue203Test.php
@@ -58,7 +58,7 @@ END:VCALENDAR
function testIssue203() {
- $request = HTTP\Request::createFromServerArray(array(
+ $request = HTTP\Sapi::createFromServerArray(array(
'REQUEST_METHOD' => 'REPORT',
'HTTP_CONTENT_TYPE' => 'application/xml',
'REQUEST_URI' => '/calendars/user1/calendar1',
diff --git a/tests/Sabre/CalDAV/Issue205Test.php b/tests/Sabre/CalDAV/Issue205Test.php
index a10f776..2136cb8 100644
--- a/tests/Sabre/CalDAV/Issue205Test.php
+++ b/tests/Sabre/CalDAV/Issue205Test.php
@@ -51,7 +51,7 @@ END:VCALENDAR
function testIssue205() {
- $request = HTTP\Request::createFromServerArray(array(
+ $request = HTTP\Sapi::createFromServerArray(array(
'REQUEST_METHOD' => 'REPORT',
'HTTP_CONTENT_TYPE' => 'application/xml',
'REQUEST_URI' => '/calendars/user1/calendar1',
diff --git a/tests/Sabre/CalDAV/Issue211Test.php b/tests/Sabre/CalDAV/Issue211Test.php
index 61ab090..bb97a37 100644
--- a/tests/Sabre/CalDAV/Issue211Test.php
+++ b/tests/Sabre/CalDAV/Issue211Test.php
@@ -56,7 +56,7 @@ END:VCALENDAR
function testIssue211() {
- $request = HTTP\Request::createFromServerArray(array(
+ $request = HTTP\Sapi::createFromServerArray(array(
'REQUEST_METHOD' => 'REPORT',
'HTTP_CONTENT_TYPE' => 'application/xml',
'REQUEST_URI' => '/calendars/user1/calendar1',
diff --git a/tests/Sabre/CalDAV/Issue220Test.php b/tests/Sabre/CalDAV/Issue220Test.php
index 7dd6e2d..28ba110 100644
--- a/tests/Sabre/CalDAV/Issue220Test.php
+++ b/tests/Sabre/CalDAV/Issue220Test.php
@@ -66,7 +66,7 @@ END:VCALENDAR
function testIssue220() {
- $request = HTTP\Request::createFromServerArray(array(
+ $request = HTTP\Sapi::createFromServerArray(array(
'REQUEST_METHOD' => 'REPORT',
'HTTP_CONTENT_TYPE' => 'application/xml',
'REQUEST_URI' => '/calendars/user1/calendar1',
@@ -95,6 +95,6 @@ END:VCALENDAR
$this->assertFalse(strpos($response->body, '<s:exception>PHPUnit_Framework_Error_Warning</s:exception>'), 'Error Warning occurred: ' . $response->body);
$this->assertFalse(strpos($response->body, 'Invalid argument supplied for foreach()'), 'Invalid argument supplied for foreach(): ' . $response->body);
- $this->assertEquals('207 Multi-Status', $response->status);
+ $this->assertEquals(207, $response->status);
}
}
diff --git a/tests/Sabre/CalDAV/Issue228Test.php b/tests/Sabre/CalDAV/Issue228Test.php
index 6a4a848..2b1ed76 100644
--- a/tests/Sabre/CalDAV/Issue228Test.php
+++ b/tests/Sabre/CalDAV/Issue228Test.php
@@ -44,7 +44,7 @@ END:VCALENDAR
function testIssue228() {
- $request = HTTP\Request::createFromServerArray(array(
+ $request = HTTP\Sapi::createFromServerArray(array(
'REQUEST_METHOD' => 'REPORT',
'HTTP_CONTENT_TYPE' => 'application/xml',
'REQUEST_URI' => '/calendars/user1/calendar1',
diff --git a/tests/Sabre/CalDAV/OutboxPostTest.php b/tests/Sabre/CalDAV/OutboxPostTest.php
index 91661e1..0669d23 100644
--- a/tests/Sabre/CalDAV/OutboxPostTest.php
+++ b/tests/Sabre/CalDAV/OutboxPostTest.php
@@ -16,7 +16,7 @@ class OutboxPostTest extends \Sabre\DAVServerTest {
function testPostPassThruNotFound() {
- $req = HTTP\Request::createFromServerArray(array(
+ $req = HTTP\Sapi::createFromServerArray(array(
'REQUEST_METHOD' => 'POST',
'REQUEST_URI' => '/notfound',
'HTTP_CONTENT_TYPE' => 'text/calendar',
@@ -28,7 +28,7 @@ class OutboxPostTest extends \Sabre\DAVServerTest {
function testPostPassThruNotTextCalendar() {
- $req = HTTP\Request::createFromServerArray(array(
+ $req = HTTP\Sapi::createFromServerArray(array(
'REQUEST_METHOD' => 'POST',
'REQUEST_URI' => '/calendars/user1/outbox',
));
@@ -39,7 +39,7 @@ class OutboxPostTest extends \Sabre\DAVServerTest {
function testPostPassThruNoOutBox() {
- $req = HTTP\Request::createFromServerArray(array(
+ $req = HTTP\Sapi::createFromServerArray(array(
'REQUEST_METHOD' => 'POST',
'REQUEST_URI' => '/calendars',
'HTTP_CONTENT_TYPE' => 'text/calendar',
@@ -51,7 +51,7 @@ class OutboxPostTest extends \Sabre\DAVServerTest {
function testNoOriginator() {
- $req = HTTP\Request::createFromServerArray(array(
+ $req = HTTP\Sapi::createFromServerArray(array(
'REQUEST_METHOD' => 'POST',
'REQUEST_URI' => '/calendars/user1/outbox',
'HTTP_CONTENT_TYPE' => 'text/calendar',
@@ -71,7 +71,7 @@ class OutboxPostTest extends \Sabre\DAVServerTest {
function testNoRecipient() {
- $req = HTTP\Request::createFromServerArray(array(
+ $req = HTTP\Sapi::createFromServerArray(array(
'REQUEST_METHOD' => 'POST',
'REQUEST_URI' => '/calendars/user1/outbox',
'HTTP_ORIGINATOR' => 'mailto:user1 at example.org',
@@ -92,7 +92,7 @@ class OutboxPostTest extends \Sabre\DAVServerTest {
function testBadOriginator() {
- $req = HTTP\Request::createFromServerArray(array(
+ $req = HTTP\Sapi::createFromServerArray(array(
'REQUEST_METHOD' => 'POST',
'REQUEST_URI' => '/calendars/admin/outbox',
'HTTP_ORIGINATOR' => 'nomailto:orig at example.org',
@@ -114,7 +114,7 @@ class OutboxPostTest extends \Sabre\DAVServerTest {
function testBadOriginator2() {
- $req = HTTP\Request::createFromServerArray(array(
+ $req = HTTP\Sapi::createFromServerArray(array(
'REQUEST_METHOD' => 'POST',
'REQUEST_URI' => '/calendars/user1/outbox',
'HTTP_ORIGINATOR' => 'mailto:orig at example.org',
@@ -136,7 +136,7 @@ class OutboxPostTest extends \Sabre\DAVServerTest {
function testBadRecipient() {
- $req = HTTP\Request::createFromServerArray(array(
+ $req = HTTP\Sapi::createFromServerArray(array(
'REQUEST_METHOD' => 'POST',
'REQUEST_URI' => '/calendars/user1/outbox',
'HTTP_ORIGINATOR' => 'mailto:user1 at example.org',
@@ -158,7 +158,7 @@ class OutboxPostTest extends \Sabre\DAVServerTest {
function testIncorrectOriginator() {
- $req = HTTP\Request::createFromServerArray(array(
+ $req = HTTP\Sapi::createFromServerArray(array(
'REQUEST_METHOD' => 'POST',
'REQUEST_URI' => '/calendars/admin/outbox',
'HTTP_ORIGINATOR' => 'mailto:orig at example.org',
@@ -180,7 +180,7 @@ class OutboxPostTest extends \Sabre\DAVServerTest {
function testInvalidIcalBody() {
- $req = HTTP\Request::createFromServerArray(array(
+ $req = HTTP\Sapi::createFromServerArray(array(
'REQUEST_METHOD' => 'POST',
'REQUEST_URI' => '/calendars/user1/outbox',
'HTTP_ORIGINATOR' => 'mailto:user1.sabredav at sabredav.org',
@@ -195,7 +195,7 @@ class OutboxPostTest extends \Sabre\DAVServerTest {
function testNoVEVENT() {
- $req = HTTP\Request::createFromServerArray(array(
+ $req = HTTP\Sapi::createFromServerArray(array(
'REQUEST_METHOD' => 'POST',
'REQUEST_URI' => '/calendars/user1/outbox',
'HTTP_ORIGINATOR' => 'mailto:user1.sabredav at sabredav.org',
@@ -218,7 +218,7 @@ class OutboxPostTest extends \Sabre\DAVServerTest {
function testNoMETHOD() {
- $req = HTTP\Request::createFromServerArray(array(
+ $req = HTTP\Sapi::createFromServerArray(array(
'REQUEST_METHOD' => 'POST',
'REQUEST_URI' => '/calendars/user1/outbox',
'HTTP_ORIGINATOR' => 'mailto:user1.sabredav at sabredav.org',
@@ -241,7 +241,7 @@ class OutboxPostTest extends \Sabre\DAVServerTest {
function testUnsupportedMethod() {
- $req = HTTP\Request::createFromServerArray(array(
+ $req = HTTP\Sapi::createFromServerArray(array(
'REQUEST_METHOD' => 'POST',
'REQUEST_URI' => '/calendars/user1/outbox',
'HTTP_ORIGINATOR' => 'mailto:user1.sabredav at sabredav.org',
@@ -265,7 +265,7 @@ class OutboxPostTest extends \Sabre\DAVServerTest {
function testNoIMIPHandler() {
- $req = HTTP\Request::createFromServerArray(array(
+ $req = HTTP\Sapi::createFromServerArray(array(
'REQUEST_METHOD' => 'POST',
'REQUEST_URI' => '/calendars/user1/outbox',
'HTTP_ORIGINATOR' => 'mailto:user1.sabredav at sabredav.org',
@@ -285,7 +285,7 @@ class OutboxPostTest extends \Sabre\DAVServerTest {
$response = $this->request($req);
- $this->assertEquals('200 OK', $response->status);
+ $this->assertEquals(200, $response->status);
$this->assertEquals(array(
'Content-Type' => 'application/xml',
), $response->headers);
@@ -299,7 +299,7 @@ class OutboxPostTest extends \Sabre\DAVServerTest {
function testSuccessRequest() {
- $req = HTTP\Request::createFromServerArray(array(
+ $req = HTTP\Sapi::createFromServerArray(array(
'REQUEST_METHOD' => 'POST',
'REQUEST_URI' => '/calendars/user1/outbox',
'HTTP_ORIGINATOR' => 'mailto:user1.sabredav at sabredav.org',
@@ -323,7 +323,7 @@ class OutboxPostTest extends \Sabre\DAVServerTest {
$this->caldavPlugin->setIMIPhandler($handler);
$response = $this->request($req);
- $this->assertEquals('200 OK', $response->status);
+ $this->assertEquals(200, $response->status);
$this->assertEquals(array(
'Content-Type' => 'application/xml',
), $response->headers);
@@ -350,7 +350,7 @@ class OutboxPostTest extends \Sabre\DAVServerTest {
function testSuccessRequestUseRelativePrincipal() {
- $req = HTTP\Request::createFromServerArray(array(
+ $req = HTTP\Sapi::createFromServerArray(array(
'REQUEST_METHOD' => 'POST',
'REQUEST_URI' => '/calendars/user1/outbox',
'HTTP_ORIGINATOR' => '/principals/user1/',
@@ -375,7 +375,7 @@ class OutboxPostTest extends \Sabre\DAVServerTest {
$this->caldavPlugin->setIMIPhandler($handler);
$response = $this->request($req);
- $this->assertEquals('200 OK', $response->status, 'Full body: ' . $response->body);
+ $this->assertEquals(200, $response->status, 'Full body: ' . $response->body);
$this->assertEquals(array(
'Content-Type' => 'application/xml',
), $response->headers);
@@ -402,7 +402,7 @@ class OutboxPostTest extends \Sabre\DAVServerTest {
function testSuccessRequestUpperCased() {
- $req = HTTP\Request::createFromServerArray(array(
+ $req = HTTP\Sapi::createFromServerArray(array(
'REQUEST_METHOD' => 'POST',
'REQUEST_URI' => '/calendars/user1/outbox',
'HTTP_ORIGINATOR' => 'MAILTO:user1.sabredav at sabredav.org',
@@ -426,7 +426,7 @@ class OutboxPostTest extends \Sabre\DAVServerTest {
$this->caldavPlugin->setIMIPhandler($handler);
$response = $this->request($req);
- $this->assertEquals('200 OK', $response->status);
+ $this->assertEquals(200, $response->status);
$this->assertEquals(array(
'Content-Type' => 'application/xml',
), $response->headers);
@@ -453,7 +453,7 @@ class OutboxPostTest extends \Sabre\DAVServerTest {
function testSuccessReply() {
- $req = HTTP\Request::createFromServerArray(array(
+ $req = HTTP\Sapi::createFromServerArray(array(
'REQUEST_METHOD' => 'POST',
'REQUEST_URI' => '/calendars/user1/outbox',
'HTTP_ORIGINATOR' => 'mailto:user1.sabredav at sabredav.org',
@@ -495,7 +495,7 @@ class OutboxPostTest extends \Sabre\DAVServerTest {
function testSuccessCancel() {
- $req = HTTP\Request::createFromServerArray(array(
+ $req = HTTP\Sapi::createFromServerArray(array(
'REQUEST_METHOD' => 'POST',
'REQUEST_URI' => '/calendars/user1/outbox',
'HTTP_ORIGINATOR' => 'mailto:user1.sabredav at sabredav.org',
@@ -538,7 +538,7 @@ class OutboxPostTest extends \Sabre\DAVServerTest {
function testUseRelativePrincipalNoFallback() {
- $req = HTTP\Request::createFromServerArray(array(
+ $req = HTTP\Sapi::createFromServerArray(array(
'REQUEST_METHOD' => 'POST',
'REQUEST_URI' => '/calendars/user1/outbox',
'HTTP_ORIGINATOR' => '/principals/user1/',
@@ -563,7 +563,7 @@ class OutboxPostTest extends \Sabre\DAVServerTest {
$this->caldavPlugin->setIMIPhandler($handler);
$response = $this->request($req);
- $this->assertEquals('403 Forbidden', $response->status, 'Full body: ' . $response->body);
+ $this->assertEquals(403, $response->status, 'Full body: ' . $response->body);
}
}
diff --git a/tests/Sabre/CalDAV/PluginTest.php b/tests/Sabre/CalDAV/PluginTest.php
index 454bb66..50696f3 100644
--- a/tests/Sabre/CalDAV/PluginTest.php
+++ b/tests/Sabre/CalDAV/PluginTest.php
@@ -105,7 +105,7 @@ class PluginTest extends \PHPUnit_Framework_TestCase {
function testUnknownMethodPassThrough() {
- $request = HTTP\Request::createFromServerArray(array(
+ $request = HTTP\Sapi::createFromServerArray(array(
'REQUEST_METHOD' => 'MKBREAKFAST',
'REQUEST_URI' => '/',
));
@@ -113,13 +113,13 @@ class PluginTest extends \PHPUnit_Framework_TestCase {
$this->server->httpRequest = $request;
$this->server->exec();
- $this->assertEquals('501 Not Implemented', $this->response->status,'Incorrect status returned. Full response body:' . $this->response->body);
+ $this->assertEquals(501, $this->response->status,'Incorrect status returned. Full response body:' . $this->response->body);
}
function testReportPassThrough() {
- $request = HTTP\Request::createFromServerArray(array(
+ $request = HTTP\Sapi::createFromServerArray(array(
'REQUEST_METHOD' => 'REPORT',
'HTTP_CONTENT_TYPE' => 'application/xml',
'REQUEST_URI' => '/',
@@ -129,13 +129,13 @@ class PluginTest extends \PHPUnit_Framework_TestCase {
$this->server->httpRequest = $request;
$this->server->exec();
- $this->assertEquals('403 Forbidden', $this->response->status);
+ $this->assertEquals(403, $this->response->status);
}
function testMkCalendarBadLocation() {
- $request = HTTP\Request::createFromServerArray(array(
+ $request = HTTP\Sapi::createFromServerArray(array(
'REQUEST_METHOD' => 'MKCALENDAR',
'REQUEST_URI' => '/blabla',
));
@@ -182,13 +182,13 @@ class PluginTest extends \PHPUnit_Framework_TestCase {
$this->server->httpRequest = $request;
$this->server->exec();
- $this->assertEquals('403 Forbidden', $this->response->status);
+ $this->assertEquals(403, $this->response->status);
}
function testMkCalendarNoParentNode() {
- $request = HTTP\Request::createFromServerArray(array(
+ $request = HTTP\Sapi::createFromServerArray(array(
'REQUEST_METHOD' => 'MKCALENDAR',
'REQUEST_URI' => '/doesntexist/calendar',
));
@@ -235,13 +235,13 @@ class PluginTest extends \PHPUnit_Framework_TestCase {
$this->server->httpRequest = $request;
$this->server->exec();
- $this->assertEquals('409 Conflict', $this->response->status);
+ $this->assertEquals(409, $this->response->status);
}
function testMkCalendarExistingCalendar() {
- $request = HTTP\Request::createFromServerArray(array(
+ $request = HTTP\Sapi::createFromServerArray(array(
'REQUEST_METHOD' => 'MKCALENDAR',
'REQUEST_URI' => '/calendars/user1/UUID-123467',
));
@@ -288,13 +288,13 @@ class PluginTest extends \PHPUnit_Framework_TestCase {
$this->server->httpRequest = $request;
$this->server->exec();
- $this->assertEquals('405 Method Not Allowed', $this->response->status);
+ $this->assertEquals(405, $this->response->status);
}
function testMkCalendarSucceed() {
- $request = HTTP\Request::createFromServerArray(array(
+ $request = HTTP\Sapi::createFromServerArray(array(
'REQUEST_METHOD' => 'MKCALENDAR',
'REQUEST_URI' => '/calendars/user1/NEWCALENDAR',
));
@@ -342,7 +342,7 @@ END:VCALENDAR';
$this->server->httpRequest = $request;
$this->server->exec();
- $this->assertEquals('201 Created', $this->response->status,'Invalid response code received. Full response body: ' .$this->response->body);
+ $this->assertEquals(201, $this->response->status,'Invalid response code received. Full response body: ' .$this->response->body);
$calendars = $this->caldavBackend->getCalendarsForUser('principals/user1');
$this->assertEquals(3, count($calendars));
@@ -382,7 +382,7 @@ END:VCALENDAR';
function testMkCalendarEmptyBodySucceed() {
- $request = HTTP\Request::createFromServerArray(array(
+ $request = HTTP\Sapi::createFromServerArray(array(
'REQUEST_METHOD' => 'MKCALENDAR',
'REQUEST_URI' => '/calendars/user1/NEWCALENDAR',
));
@@ -391,7 +391,7 @@ END:VCALENDAR';
$this->server->httpRequest = $request;
$this->server->exec();
- $this->assertEquals('201 Created', $this->response->status,'Invalid response code received. Full response body: ' .$this->response->body);
+ $this->assertEquals(201, $this->response->status,'Invalid response code received. Full response body: ' .$this->response->body);
$calendars = $this->caldavBackend->getCalendarsForUser('principals/user1');
$this->assertEquals(3, count($calendars));
@@ -428,7 +428,7 @@ END:VCALENDAR';
function testPrincipalProperties() {
- $httpRequest = HTTP\Request::createFromServerArray(array(
+ $httpRequest = HTTP\Sapi::createFromServerArray(array(
'HTTP_HOST' => 'sabredav.org',
));
$this->server->httpRequest = $httpRequest;
@@ -570,7 +570,7 @@ END:VCALENDAR';
'<d:href>/calendars/user1/UUID-123467/UUID-2345</d:href>' .
'</c:calendar-multiget>';
- $request = HTTP\Request::createFromServerArray(array(
+ $request = HTTP\Sapi::createFromServerArray(array(
'REQUEST_METHOD' => 'REPORT',
'REQUEST_URI' => '/calendars/user1',
'HTTP_DEPTH' => '1',
@@ -580,7 +580,7 @@ END:VCALENDAR';
$this->server->httpRequest = $request;
$this->server->exec();
- $this->assertEquals('207 Multi-Status',$this->response->status,'Invalid HTTP status received. Full response body: ' . $this->response->body);
+ $this->assertEquals(207, $this->response->status,'Invalid HTTP status received. Full response body: ' . $this->response->body);
$xml = simplexml_load_string(DAV\XMLUtil::convertDAVNamespace($this->response->body));
@@ -632,7 +632,7 @@ END:VCALENDAR';
'<d:href>/calendars/user1/UUID-123467/UUID-2345</d:href>' .
'</c:calendar-multiget>';
- $request = HTTP\Request::createFromServerArray(array(
+ $request = HTTP\Sapi::createFromServerArray(array(
'REQUEST_METHOD' => 'REPORT',
'REQUEST_URI' => '/calendars/user1',
'HTTP_DEPTH' => '1',
@@ -642,7 +642,7 @@ END:VCALENDAR';
$this->server->httpRequest = $request;
$this->server->exec();
- $this->assertEquals('207 Multi-Status',$this->response->status,'Invalid HTTP status received. Full response body: ' . $this->response->body);
+ $this->assertEquals(207, $this->response->status,'Invalid HTTP status received. Full response body: ' . $this->response->body);
$xml = simplexml_load_string(DAV\XMLUtil::convertDAVNamespace($this->response->body));
@@ -697,7 +697,7 @@ END:VCALENDAR';
'</c:filter>' .
'</c:calendar-query>';
- $request = HTTP\Request::createFromServerArray(array(
+ $request = HTTP\Sapi::createFromServerArray(array(
'REQUEST_METHOD' => 'REPORT',
'REQUEST_URI' => '/calendars/user1/UUID-123467',
'HTTP_DEPTH' => '1',
@@ -707,7 +707,7 @@ END:VCALENDAR';
$this->server->httpRequest = $request;
$this->server->exec();
- $this->assertEquals('207 Multi-Status',$this->response->status,'Received an unexpected status. Full response body: ' . $this->response->body);
+ $this->assertEquals(207, $this->response->status,'Received an unexpected status. Full response body: ' . $this->response->body);
$xml = simplexml_load_string(DAV\XMLUtil::convertDAVNamespace($this->response->body));
@@ -756,7 +756,7 @@ END:VCALENDAR';
'</c:filter>' .
'</c:calendar-query>';
- $request = HTTP\Request::createFromServerArray(array(
+ $request = HTTP\Sapi::createFromServerArray(array(
'REQUEST_METHOD' => 'REPORT',
'REQUEST_URI' => '/calendars/user1//UUID-123467',
'HTTP_DEPTH' => '1',
@@ -766,7 +766,7 @@ END:VCALENDAR';
$this->server->httpRequest = $request;
$this->server->exec();
- $this->assertEquals('207 Multi-Status',$this->response->status,'Received an unexpected status. Full response body: ' . $this->response->body);
+ $this->assertEquals(207, $this->response->status,'Received an unexpected status. Full response body: ' . $this->response->body);
$xml = simplexml_load_string(DAV\XMLUtil::convertDAVNamespace($this->response->body));
@@ -810,7 +810,7 @@ END:VCALENDAR';
'</d:prop>' .
'</c:calendar-query>';
- $request = HTTP\Request::createFromServerArray(array(
+ $request = HTTP\Sapi::createFromServerArray(array(
'REQUEST_METHOD' => 'REPORT',
'REQUEST_URI' => '/calendars/user1//UUID-123467',
));
@@ -819,7 +819,7 @@ END:VCALENDAR';
$this->server->httpRequest = $request;
$this->server->exec();
- $this->assertEquals('400 Bad request',$this->response->status,'Received an unexpected status. Full response body: ' . $this->response->body);
+ $this->assertEquals(400, $this->response->status,'Received an unexpected status. Full response body: ' . $this->response->body);
}
@@ -845,7 +845,7 @@ END:VCALENDAR';
'</c:filter>' .
'</c:calendar-query>';
- $request = HTTP\Request::createFromServerArray(array(
+ $request = HTTP\Sapi::createFromServerArray(array(
'REQUEST_METHOD' => 'REPORT',
'REQUEST_URI' => '/calendars/user1/UUID-123467/UUID-2345',
'HTTP_DEPTH' => '0',
@@ -855,7 +855,7 @@ END:VCALENDAR';
$this->server->httpRequest = $request;
$this->server->exec();
- $this->assertEquals('207 Multi-Status',$this->response->status,'Received an unexpected status. Full response body: ' . $this->response->body);
+ $this->assertEquals(207, $this->response->status,'Received an unexpected status. Full response body: ' . $this->response->body);
$xml = simplexml_load_string(DAV\XMLUtil::convertDAVNamespace($this->response->body));
@@ -905,7 +905,7 @@ END:VCALENDAR';
'</c:filter>' .
'</c:calendar-query>';
- $request = HTTP\Request::createFromServerArray(array(
+ $request = HTTP\Sapi::createFromServerArray(array(
'REQUEST_METHOD' => 'REPORT',
'REQUEST_URI' => '/calendars/user1/UUID-123467/UUID-2345',
'HTTP_DEPTH' => '0',
@@ -915,7 +915,7 @@ END:VCALENDAR';
$this->server->httpRequest = $request;
$this->server->exec();
- $this->assertEquals('207 Multi-Status',$this->response->status,'Received an unexpected status. Full response body: ' . $this->response->body);
+ $this->assertEquals(207, $this->response->status,'Received an unexpected status. Full response body: ' . $this->response->body);
$xml = simplexml_load_string(DAV\XMLUtil::convertDAVNamespace($this->response->body));
@@ -996,7 +996,7 @@ END:VCALENDAR';
'<d:href>/calendars/user1/UUID-123467/UUID-2345</d:href>' .
'</c:calendar-multiget>';
- $request = HTTP\Request::createFromServerArray(array(
+ $request = HTTP\Sapi::createFromServerArray(array(
'REQUEST_METHOD' => 'REPORT',
'REQUEST_URI' => '/calendars/user1',
'HTTP_DEPTH' => '1',
@@ -1006,7 +1006,7 @@ END:VCALENDAR';
$this->server->httpRequest = $request;
$this->server->exec();
- $this->assertEquals('400 Bad request',$this->response->status,'Invalid HTTP status received. Full response body: ' . $this->response->body);
+ $this->assertEquals(400, $this->response->status,'Invalid HTTP status received. Full response body: ' . $this->response->body);
}
@@ -1027,7 +1027,7 @@ END:VCALENDAR';
'<d:href>/calendars/user1/UUID-123467/UUID-2345</d:href>' .
'</c:calendar-multiget>';
- $request = HTTP\Request::createFromServerArray(array(
+ $request = HTTP\Sapi::createFromServerArray(array(
'REQUEST_METHOD' => 'REPORT',
'REQUEST_URI' => '/calendars/user1',
'HTTP_DEPTH' => '1',
@@ -1037,7 +1037,7 @@ END:VCALENDAR';
$this->server->httpRequest = $request;
$this->server->exec();
- $this->assertEquals('400 Bad request',$this->response->status,'Invalid HTTP status received. Full response body: ' . $this->response->body);
+ $this->assertEquals(400, $this->response->status,'Invalid HTTP status received. Full response body: ' . $this->response->body);
}
@@ -1058,7 +1058,7 @@ END:VCALENDAR';
'<d:href>/calendars/user1/UUID-123467/UUID-2345</d:href>' .
'</c:calendar-multiget>';
- $request = HTTP\Request::createFromServerArray(array(
+ $request = HTTP\Sapi::createFromServerArray(array(
'REQUEST_METHOD' => 'REPORT',
'REQUEST_URI' => '/calendars/user1',
'HTTP_DEPTH' => '1',
@@ -1068,7 +1068,7 @@ END:VCALENDAR';
$this->server->httpRequest = $request;
$this->server->exec();
- $this->assertEquals('400 Bad request',$this->response->status,'Invalid HTTP status received. Full response body: ' . $this->response->body);
+ $this->assertEquals(400, $this->response->status,'Invalid HTTP status received. Full response body: ' . $this->response->body);
}
@@ -1105,7 +1105,7 @@ END:VCALENDAR';
$server = new DAV\Server(array($notification));
$caldav = new Plugin();
- $server->httpRequest = HTTP\Request::createFromServerArray(array(
+ $server->httpRequest = HTTP\Sapi::createFromServerArray(array(
'REQUEST_URI' => '/foo.xml',
));
$httpResponse = new HTTP\ResponseMock();
@@ -1115,7 +1115,7 @@ END:VCALENDAR';
$caldav->httpGet($server->httpRequest, $server->httpResponse);
- $this->assertEquals('200 OK', $httpResponse->status);
+ $this->assertEquals(200, $httpResponse->status);
$this->assertEquals(array(
'Content-Type' => 'application/xml',
'ETag' => '"1"',
diff --git a/tests/Sabre/CalDAV/SharingPluginTest.php b/tests/Sabre/CalDAV/SharingPluginTest.php
index 6a5456a..5d59759 100644
--- a/tests/Sabre/CalDAV/SharingPluginTest.php
+++ b/tests/Sabre/CalDAV/SharingPluginTest.php
@@ -123,20 +123,20 @@ class SharingPluginTest extends \Sabre\DAVServerTest {
function testUnknownMethodNoPOST() {
- $request = HTTP\Request::createFromServerArray(array(
+ $request = HTTP\Sapi::createFromServerArray(array(
'REQUEST_METHOD' => 'PATCH',
'REQUEST_URI' => '/',
));
$response = $this->request($request);
- $this->assertEquals('501 Not Implemented', $response->status, $response->body);
+ $this->assertEquals(501, $response->status, $response->body);
}
function testUnknownMethodNoXML() {
- $request = HTTP\Request::createFromServerArray(array(
+ $request = HTTP\Sapi::createFromServerArray(array(
'REQUEST_METHOD' => 'POST',
'REQUEST_URI' => '/',
'CONTENT_TYPE' => 'text/plain',
@@ -144,13 +144,13 @@ class SharingPluginTest extends \Sabre\DAVServerTest {
$response = $this->request($request);
- $this->assertEquals('501 Not Implemented', $response->status, $response->body);
+ $this->assertEquals(501, $response->status, $response->body);
}
function testUnknownMethodNoNode() {
- $request = HTTP\Request::createFromServerArray(array(
+ $request = HTTP\Sapi::createFromServerArray(array(
'REQUEST_METHOD' => 'POST',
'REQUEST_URI' => '/foo',
'CONTENT_TYPE' => 'text/xml',
@@ -158,13 +158,13 @@ class SharingPluginTest extends \Sabre\DAVServerTest {
$response = $this->request($request);
- $this->assertEquals('501 Not Implemented', $response->status, $response->body);
+ $this->assertEquals(501, $response->status, $response->body);
}
function testShareRequest() {
- $request = HTTP\Request::createFromServerArray(array(
+ $request = HTTP\Sapi::createFromServerArray(array(
'REQUEST_METHOD' => 'POST',
'REQUEST_URI' => '/calendars/user1/cal1',
'CONTENT_TYPE' => 'text/xml',
@@ -187,7 +187,7 @@ RRR;
$request->setBody($xml);
$response = $this->request($request);
- $this->assertEquals('200 OK', $response->status, $response->body);
+ $this->assertEquals(200, $response->status, $response->body);
$this->assertEquals(array(array(
'href' => 'mailto:joe at example.org',
@@ -207,7 +207,7 @@ RRR;
function testShareRequestNoShareableCalendar() {
- $request = HTTP\Request::createFromServerArray(array(
+ $request = HTTP\Sapi::createFromServerArray(array(
'REQUEST_METHOD' => 'POST',
'REQUEST_URI' => '/calendars/user1/cal2',
'CONTENT_TYPE' => 'text/xml',
@@ -229,13 +229,13 @@ RRR;
$request->setBody($xml);
$response = $this->request($request);
- $this->assertEquals('501 Not Implemented', $response->status, $response->body);
+ $this->assertEquals(501, $response->status, $response->body);
}
function testInviteReply() {
- $request = HTTP\Request::createFromServerArray(array(
+ $request = HTTP\Sapi::createFromServerArray(array(
'REQUEST_METHOD' => 'POST',
'REQUEST_URI' => '/calendars/user1',
'CONTENT_TYPE' => 'text/xml',
@@ -250,13 +250,13 @@ RRR;
$request->setBody($xml);
$response = $this->request($request);
- $this->assertEquals('200 OK', $response->status, $response->body);
+ $this->assertEquals(200, $response->status, $response->body);
}
function testInviteBadXML() {
- $request = HTTP\Request::createFromServerArray(array(
+ $request = HTTP\Sapi::createFromServerArray(array(
'REQUEST_METHOD' => 'POST',
'REQUEST_URI' => '/calendars/user1',
'CONTENT_TYPE' => 'text/xml',
@@ -268,13 +268,13 @@ RRR;
';
$request->setBody($xml);
$response = $this->request($request);
- $this->assertEquals('400 Bad request', $response->status, $response->body);
+ $this->assertEquals(400, $response->status, $response->body);
}
function testInviteWrongUrl() {
- $request = HTTP\Request::createFromServerArray(array(
+ $request = HTTP\Sapi::createFromServerArray(array(
'REQUEST_METHOD' => 'POST',
'REQUEST_URI' => '/calendars/user1/cal1',
'CONTENT_TYPE' => 'text/xml',
@@ -287,7 +287,7 @@ RRR;
';
$request->setBody($xml);
$response = $this->request($request);
- $this->assertEquals('501 Not Implemented', $response->status, $response->body);
+ $this->assertEquals(501, $response->status, $response->body);
// If the plugin did not handle this request, it must ensure that the
// body is still accessible by other plugins.
@@ -297,7 +297,7 @@ RRR;
function testPublish() {
- $request = HTTP\Request::createFromServerArray(array(
+ $request = HTTP\Sapi::createFromServerArray(array(
'REQUEST_METHOD' => 'POST',
'REQUEST_URI' => '/calendars/user1/cal1',
'CONTENT_TYPE' => 'text/xml',
@@ -310,13 +310,13 @@ RRR;
$request->setBody($xml);
$response = $this->request($request);
- $this->assertEquals('202 Accepted', $response->status, $response->body);
+ $this->assertEquals(202, $response->status, $response->body);
}
function testUnpublish() {
- $request = HTTP\Request::createFromServerArray(array(
+ $request = HTTP\Sapi::createFromServerArray(array(
'REQUEST_METHOD' => 'POST',
'REQUEST_URI' => '/calendars/user1/cal1',
'CONTENT_TYPE' => 'text/xml',
@@ -329,13 +329,13 @@ RRR;
$request->setBody($xml);
$response = $this->request($request);
- $this->assertEquals('200 OK', $response->status, $response->body);
+ $this->assertEquals(200, $response->status, $response->body);
}
function testPublishWrongUrl() {
- $request = HTTP\Request::createFromServerArray(array(
+ $request = HTTP\Sapi::createFromServerArray(array(
'REQUEST_METHOD' => 'POST',
'REQUEST_URI' => '/calendars/user1/cal2',
'CONTENT_TYPE' => 'text/xml',
@@ -348,13 +348,13 @@ RRR;
$request->setBody($xml);
$response = $this->request($request);
- $this->assertEquals('501 Not Implemented', $response->status, $response->body);
+ $this->assertEquals(501, $response->status, $response->body);
}
function testUnpublishWrongUrl() {
- $request = HTTP\Request::createFromServerArray(array(
+ $request = HTTP\Sapi::createFromServerArray(array(
'REQUEST_METHOD' => 'POST',
'REQUEST_URI' => '/calendars/user1/cal2',
'CONTENT_TYPE' => 'text/xml',
@@ -367,13 +367,13 @@ RRR;
$request->setBody($xml);
$response = $this->request($request);
- $this->assertEquals('501 Not Implemented', $response->status, $response->body);
+ $this->assertEquals(501, $response->status, $response->body);
}
function testUnknownXmlDoc() {
- $request = HTTP\Request::createFromServerArray(array(
+ $request = HTTP\Sapi::createFromServerArray(array(
'REQUEST_METHOD' => 'POST',
'REQUEST_URI' => '/calendars/user1/cal2',
'CONTENT_TYPE' => 'text/xml',
@@ -385,7 +385,7 @@ RRR;
$request->setBody($xml);
$response = $this->request($request);
- $this->assertEquals('501 Not Implemented', $response->status, $response->body);
+ $this->assertEquals(501, $response->status, $response->body);
}
}
diff --git a/tests/Sabre/CalDAV/ValidateICalTest.php b/tests/Sabre/CalDAV/ValidateICalTest.php
index 4181e3e..bd77aaa 100644
--- a/tests/Sabre/CalDAV/ValidateICalTest.php
+++ b/tests/Sabre/CalDAV/ValidateICalTest.php
@@ -65,20 +65,20 @@ class ValidateICalTest extends \PHPUnit_Framework_TestCase {
function testCreateFile() {
- $request = HTTP\Request::createFromServerArray(array(
+ $request = HTTP\Sapi::createFromServerArray(array(
'REQUEST_METHOD' => 'PUT',
'REQUEST_URI' => '/calendars/admin/calendar1/blabla.ics',
));
$response = $this->request($request);
- $this->assertEquals('415 Unsupported Media Type', $response->status);
+ $this->assertEquals(415, $response->status);
}
function testCreateFileValid() {
- $request = HTTP\Request::createFromServerArray(array(
+ $request = HTTP\Sapi::createFromServerArray(array(
'REQUEST_METHOD' => 'PUT',
'REQUEST_URI' => '/calendars/admin/calendar1/blabla.ics',
));
@@ -86,7 +86,7 @@ class ValidateICalTest extends \PHPUnit_Framework_TestCase {
$response = $this->request($request);
- $this->assertEquals('201 Created', $response->status, 'Incorrect status returned! Full response body: ' . $response->body);
+ $this->assertEquals(201, $response->status, 'Incorrect status returned! Full response body: ' . $response->body);
$this->assertEquals(array(
'Content-Length' => '0',
'ETag' => '"' . md5("BEGIN:VCALENDAR\r\nBEGIN:VEVENT\r\nUID:foo\r\nEND:VEVENT\r\nEND:VCALENDAR\r\n") . '"',
@@ -103,7 +103,7 @@ class ValidateICalTest extends \PHPUnit_Framework_TestCase {
function testCreateFileNoComponents() {
- $request = HTTP\Request::createFromServerArray(array(
+ $request = HTTP\Sapi::createFromServerArray(array(
'REQUEST_METHOD' => 'PUT',
'REQUEST_URI' => '/calendars/admin/calendar1/blabla.ics',
));
@@ -111,13 +111,13 @@ class ValidateICalTest extends \PHPUnit_Framework_TestCase {
$response = $this->request($request);
- $this->assertEquals('400 Bad request', $response->status, 'Incorrect status returned! Full response body: ' . $response->body);
+ $this->assertEquals(400, $response->status, 'Incorrect status returned! Full response body: ' . $response->body);
}
function testCreateFileNoUID() {
- $request = HTTP\Request::createFromServerArray(array(
+ $request = HTTP\Sapi::createFromServerArray(array(
'REQUEST_METHOD' => 'PUT',
'REQUEST_URI' => '/calendars/admin/calendar1/blabla.ics',
));
@@ -125,13 +125,13 @@ class ValidateICalTest extends \PHPUnit_Framework_TestCase {
$response = $this->request($request);
- $this->assertEquals('400 Bad request', $response->status, 'Incorrect status returned! Full response body: ' . $response->body);
+ $this->assertEquals(400, $response->status, 'Incorrect status returned! Full response body: ' . $response->body);
}
function testCreateFileVCard() {
- $request = HTTP\Request::createFromServerArray(array(
+ $request = HTTP\Sapi::createFromServerArray(array(
'REQUEST_METHOD' => 'PUT',
'REQUEST_URI' => '/calendars/admin/calendar1/blabla.ics',
));
@@ -139,13 +139,13 @@ class ValidateICalTest extends \PHPUnit_Framework_TestCase {
$response = $this->request($request);
- $this->assertEquals('415 Unsupported Media Type', $response->status, 'Incorrect status returned! Full response body: ' . $response->body);
+ $this->assertEquals(415, $response->status, 'Incorrect status returned! Full response body: ' . $response->body);
}
function testCreateFile2Components() {
- $request = HTTP\Request::createFromServerArray(array(
+ $request = HTTP\Sapi::createFromServerArray(array(
'REQUEST_METHOD' => 'PUT',
'REQUEST_URI' => '/calendars/admin/calendar1/blabla.ics',
));
@@ -153,13 +153,13 @@ class ValidateICalTest extends \PHPUnit_Framework_TestCase {
$response = $this->request($request);
- $this->assertEquals('400 Bad request', $response->status, 'Incorrect status returned! Full response body: ' . $response->body);
+ $this->assertEquals(400, $response->status, 'Incorrect status returned! Full response body: ' . $response->body);
}
function testCreateFile2UIDS() {
- $request = HTTP\Request::createFromServerArray(array(
+ $request = HTTP\Sapi::createFromServerArray(array(
'REQUEST_METHOD' => 'PUT',
'REQUEST_URI' => '/calendars/admin/calendar1/blabla.ics',
));
@@ -167,13 +167,13 @@ class ValidateICalTest extends \PHPUnit_Framework_TestCase {
$response = $this->request($request);
- $this->assertEquals('400 Bad request', $response->status, 'Incorrect status returned! Full response body: ' . $response->body);
+ $this->assertEquals(400, $response->status, 'Incorrect status returned! Full response body: ' . $response->body);
}
function testCreateFileWrongComponent() {
- $request = HTTP\Request::createFromServerArray(array(
+ $request = HTTP\Sapi::createFromServerArray(array(
'REQUEST_METHOD' => 'PUT',
'REQUEST_URI' => '/calendars/admin/calendar1/blabla.ics',
));
@@ -181,28 +181,28 @@ class ValidateICalTest extends \PHPUnit_Framework_TestCase {
$response = $this->request($request);
- $this->assertEquals('400 Bad request', $response->status, 'Incorrect status returned! Full response body: ' . $response->body);
+ $this->assertEquals(400, $response->status, 'Incorrect status returned! Full response body: ' . $response->body);
}
function testUpdateFile() {
$this->calBackend->createCalendarObject('calendar1','blabla.ics','foo');
- $request = HTTP\Request::createFromServerArray(array(
+ $request = HTTP\Sapi::createFromServerArray(array(
'REQUEST_METHOD' => 'PUT',
'REQUEST_URI' => '/calendars/admin/calendar1/blabla.ics',
));
$response = $this->request($request);
- $this->assertEquals('415 Unsupported Media Type', $response->status);
+ $this->assertEquals(415, $response->status);
}
function testUpdateFileParsableBody() {
$this->calBackend->createCalendarObject('calendar1','blabla.ics','foo');
- $request = HTTP\Request::createFromServerArray(array(
+ $request = HTTP\Sapi::createFromServerArray(array(
'REQUEST_METHOD' => 'PUT',
'REQUEST_URI' => '/calendars/admin/calendar1/blabla.ics',
));
@@ -211,7 +211,7 @@ class ValidateICalTest extends \PHPUnit_Framework_TestCase {
$response = $this->request($request);
- $this->assertEquals('204 No Content', $response->status);
+ $this->assertEquals(204, $response->status);
$expected = array(
'uri' => 'blabla.ics',
@@ -225,7 +225,7 @@ class ValidateICalTest extends \PHPUnit_Framework_TestCase {
function testCreateFileInvalidComponent() {
- $request = HTTP\Request::createFromServerArray(array(
+ $request = HTTP\Sapi::createFromServerArray(array(
'REQUEST_METHOD' => 'PUT',
'REQUEST_URI' => '/calendars/admin/calendar2/blabla.ics',
));
@@ -233,14 +233,14 @@ class ValidateICalTest extends \PHPUnit_Framework_TestCase {
$response = $this->request($request);
- $this->assertEquals('403 Forbidden', $response->status, 'Incorrect status returned! Full response body: ' . $response->body);
+ $this->assertEquals(403, $response->status, 'Incorrect status returned! Full response body: ' . $response->body);
}
function testUpdateFileInvalidComponent() {
$this->calBackend->createCalendarObject('calendar2','blabla.ics','foo');
- $request = HTTP\Request::createFromServerArray(array(
+ $request = HTTP\Sapi::createFromServerArray(array(
'REQUEST_METHOD' => 'PUT',
'REQUEST_URI' => '/calendars/admin/calendar2/blabla.ics',
));
@@ -248,7 +248,7 @@ class ValidateICalTest extends \PHPUnit_Framework_TestCase {
$response = $this->request($request);
- $this->assertEquals('403 Forbidden', $response->status, 'Incorrect status returned! Full response body: ' . $response->body);
+ $this->assertEquals(403, $response->status, 'Incorrect status returned! Full response body: ' . $response->body);
}
@@ -261,7 +261,7 @@ class ValidateICalTest extends \PHPUnit_Framework_TestCase {
*/
function testCreateFileModified() {
- $request = HTTP\Request::createFromServerArray(array(
+ $request = HTTP\Sapi::createFromServerArray(array(
'REQUEST_METHOD' => 'PUT',
'REQUEST_URI' => '/calendars/admin/calendar1/blabla.ics',
));
@@ -269,7 +269,7 @@ class ValidateICalTest extends \PHPUnit_Framework_TestCase {
$response = $this->request($request);
- $this->assertEquals('201 Created', $response->status, 'Incorrect status returned! Full response body: ' . $response->body);
+ $this->assertEquals(201, $response->status, 'Incorrect status returned! Full response body: ' . $response->body);
$this->assertFalse(isset($response->headers['ETag']));
}
diff --git a/tests/Sabre/CardDAV/AddressBookQueryTest.php b/tests/Sabre/CardDAV/AddressBookQueryTest.php
index 81d1892..d3c6a0c 100644
--- a/tests/Sabre/CardDAV/AddressBookQueryTest.php
+++ b/tests/Sabre/CardDAV/AddressBookQueryTest.php
@@ -12,7 +12,7 @@ class AddressBookQueryTest extends AbstractPluginTest {
function testQuery() {
- $request = HTTP\Request::createFromServerArray(array(
+ $request = HTTP\Sapi::createFromServerArray(array(
'REQUEST_METHOD' => 'REPORT',
'REQUEST_URI' => '/addressbooks/user1/book1',
'HTTP_DEPTH' => '1',
@@ -37,7 +37,7 @@ class AddressBookQueryTest extends AbstractPluginTest {
$this->server->exec();
- $this->assertEquals('207 Multi-Status', $response->status, 'Incorrect status code. Full response body:' . $response->body);
+ $this->assertEquals(207, $response->status, 'Incorrect status code. Full response body:' . $response->body);
// using the client for parsing
$client = new DAV\Client(array('baseUri'=>'/'));
@@ -62,7 +62,7 @@ class AddressBookQueryTest extends AbstractPluginTest {
function testQueryDepth0() {
- $request = HTTP\Request::createFromServerArray(array(
+ $request = HTTP\Sapi::createFromServerArray(array(
'REQUEST_METHOD' => 'REPORT',
'REQUEST_URI' => '/addressbooks/user1/book1/card1',
'HTTP_DEPTH' => '0',
@@ -87,7 +87,7 @@ class AddressBookQueryTest extends AbstractPluginTest {
$this->server->exec();
- $this->assertEquals('207 Multi-Status', $response->status, 'Incorrect status code. Full response body:' . $response->body);
+ $this->assertEquals(207, $response->status, 'Incorrect status code. Full response body:' . $response->body);
// using the client for parsing
$client = new DAV\Client(array('baseUri'=>'/'));
@@ -107,7 +107,7 @@ class AddressBookQueryTest extends AbstractPluginTest {
function testQueryNoMatch() {
- $request = HTTP\Request::createFromServerArray(array(
+ $request = HTTP\Sapi::createFromServerArray(array(
'REQUEST_METHOD' => 'REPORT',
'REQUEST_URI' => '/addressbooks/user1/book1',
'HTTP_DEPTH' => '1',
@@ -132,7 +132,7 @@ class AddressBookQueryTest extends AbstractPluginTest {
$this->server->exec();
- $this->assertEquals('207 Multi-Status', $response->status, 'Incorrect status code. Full response body:' . $response->body);
+ $this->assertEquals(207, $response->status, 'Incorrect status code. Full response body:' . $response->body);
// using the client for parsing
$client = new DAV\Client(array('baseUri'=>'/'));
@@ -145,7 +145,7 @@ class AddressBookQueryTest extends AbstractPluginTest {
function testQueryLimit() {
- $request = HTTP\Request::createFromServerArray(array(
+ $request = HTTP\Sapi::createFromServerArray(array(
'REQUEST_METHOD' => 'REPORT',
'REQUEST_URI' => '/addressbooks/user1/book1',
'HTTP_DEPTH' => '1',
@@ -171,7 +171,7 @@ class AddressBookQueryTest extends AbstractPluginTest {
$this->server->exec();
- $this->assertEquals('207 Multi-Status', $response->status, 'Incorrect status code. Full response body:' . $response->body);
+ $this->assertEquals(207, $response->status, 'Incorrect status code. Full response body:' . $response->body);
// using the client for parsing
$client = new DAV\Client(array('baseUri'=>'/'));
diff --git a/tests/Sabre/CardDAV/MultiGetTest.php b/tests/Sabre/CardDAV/MultiGetTest.php
index 4f73ddb..549ce98 100644
--- a/tests/Sabre/CardDAV/MultiGetTest.php
+++ b/tests/Sabre/CardDAV/MultiGetTest.php
@@ -11,7 +11,7 @@ class MultiGetTest extends AbstractPluginTest {
function testMultiGet() {
- $request = HTTP\Request::createFromServerArray(array(
+ $request = HTTP\Sapi::createFromServerArray(array(
'REQUEST_METHOD' => 'REPORT',
'REQUEST_URI' => '/addressbooks/user1/book1',
));
@@ -34,7 +34,7 @@ class MultiGetTest extends AbstractPluginTest {
$this->server->exec();
- $this->assertEquals('207 Multi-Status', $response->status, 'Incorrect status code. Full response body:' . $response->body);
+ $this->assertEquals(207, $response->status, 'Incorrect status code. Full response body:' . $response->body);
// using the client for parsing
$client = new DAV\Client(array('baseUri'=>'/'));
diff --git a/tests/Sabre/CardDAV/SogoStripContentTypeTest.php b/tests/Sabre/CardDAV/SogoStripContentTypeTest.php
index 6189730..66f7dad 100644
--- a/tests/Sabre/CardDAV/SogoStripContentTypeTest.php
+++ b/tests/Sabre/CardDAV/SogoStripContentTypeTest.php
@@ -30,7 +30,7 @@ class SogoStripContentType extends \Sabre\DAVServerTest {
}
function testStrip() {
- $this->server->httpRequest = HTTP\Request::createFromServerArray(array(
+ $this->server->httpRequest = HTTP\Sapi::createFromServerArray(array(
'HTTP_USER_AGENT' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:10.0.2) Gecko/20120216 Thunderbird/10.0.2 Lightning/1.2.1',
));
$result = $this->server->getProperties('addressbooks/user1/book1/card1.vcf',array('{DAV:}getcontenttype'));
diff --git a/tests/Sabre/CardDAV/VCFExportTest.php b/tests/Sabre/CardDAV/VCFExportTest.php
index 72f4d25..28cb7cb 100644
--- a/tests/Sabre/CardDAV/VCFExportTest.php
+++ b/tests/Sabre/CardDAV/VCFExportTest.php
@@ -43,14 +43,14 @@ class VCFExportTest extends \Sabre\DAVServerTest {
function testExport() {
- $request = HTTP\Request::createFromServerArray(array(
+ $request = HTTP\Sapi::createFromServerArray(array(
'REQUEST_URI' => '/addressbooks/user1/book1?export',
'QUERY_STRING' => 'export',
'REQUEST_METHOD' => 'GET',
));
$response = $this->request($request);
- $this->assertEquals('200 OK', $response->status, $response->body);
+ $this->assertEquals(200, $response->status, $response->body);
$expected = "BEGIN:VCARD
FN:Person1
diff --git a/tests/Sabre/CardDAV/ValidateVCardTest.php b/tests/Sabre/CardDAV/ValidateVCardTest.php
index 1acd4f3..fa91644 100644
--- a/tests/Sabre/CardDAV/ValidateVCardTest.php
+++ b/tests/Sabre/CardDAV/ValidateVCardTest.php
@@ -52,20 +52,20 @@ class ValidateVCardTest extends \PHPUnit_Framework_TestCase {
function testCreateFile() {
- $request = HTTP\Request::createFromServerArray(array(
+ $request = HTTP\Sapi::createFromServerArray(array(
'REQUEST_METHOD' => 'PUT',
'REQUEST_URI' => '/addressbooks/admin/addressbook1/blabla.vcf',
));
$response = $this->request($request);
- $this->assertEquals('415 Unsupported Media Type', $response->status);
+ $this->assertEquals(415, $response->status);
}
function testCreateFileValid() {
- $request = HTTP\Request::createFromServerArray(array(
+ $request = HTTP\Sapi::createFromServerArray(array(
'REQUEST_METHOD' => 'PUT',
'REQUEST_URI' => '/addressbooks/admin/addressbook1/blabla.vcf',
));
@@ -73,7 +73,7 @@ class ValidateVCardTest extends \PHPUnit_Framework_TestCase {
$response = $this->request($request);
- $this->assertEquals('201 Created', $response->status, 'Incorrect status returned! Full response body: ' . $response->body);
+ $this->assertEquals(201, $response->status, 'Incorrect status returned! Full response body: ' . $response->body);
$expected = array(
'uri' => 'blabla.vcf',
'carddata' => "BEGIN:VCARD\r\nUID:foo\r\nEND:VCARD\r\n",
@@ -85,7 +85,7 @@ class ValidateVCardTest extends \PHPUnit_Framework_TestCase {
function testCreateFileNoUID() {
- $request = HTTP\Request::createFromServerArray(array(
+ $request = HTTP\Sapi::createFromServerArray(array(
'REQUEST_METHOD' => 'PUT',
'REQUEST_URI' => '/addressbooks/admin/addressbook1/blabla.vcf',
));
@@ -93,7 +93,7 @@ class ValidateVCardTest extends \PHPUnit_Framework_TestCase {
$response = $this->request($request);
- $this->assertEquals('201 Created', $response->status, 'Incorrect status returned! Full response body: ' . $response->body);
+ $this->assertEquals(201, $response->status, 'Incorrect status returned! Full response body: ' . $response->body);
$foo = $this->cardBackend->getCard('addressbook1','blabla.vcf');
$this->assertTrue(strpos($foo['carddata'],'UID')!==false);
@@ -102,7 +102,7 @@ class ValidateVCardTest extends \PHPUnit_Framework_TestCase {
function testCreateFileVCalendar() {
- $request = HTTP\Request::createFromServerArray(array(
+ $request = HTTP\Sapi::createFromServerArray(array(
'REQUEST_METHOD' => 'PUT',
'REQUEST_URI' => '/addressbooks/admin/addressbook1/blabla.vcf',
));
@@ -110,28 +110,28 @@ class ValidateVCardTest extends \PHPUnit_Framework_TestCase {
$response = $this->request($request);
- $this->assertEquals('415 Unsupported Media Type', $response->status, 'Incorrect status returned! Full response body: ' . $response->body);
+ $this->assertEquals(415, $response->status, 'Incorrect status returned! Full response body: ' . $response->body);
}
function testUpdateFile() {
$this->cardBackend->createCard('addressbook1','blabla.vcf','foo');
- $request = HTTP\Request::createFromServerArray(array(
+ $request = HTTP\Sapi::createFromServerArray(array(
'REQUEST_METHOD' => 'PUT',
'REQUEST_URI' => '/addressbooks/admin/addressbook1/blabla.vcf',
));
$response = $this->request($request);
- $this->assertEquals('415 Unsupported Media Type', $response->status);
+ $this->assertEquals(415, $response->status);
}
function testUpdateFileParsableBody() {
$this->cardBackend->createCard('addressbook1','blabla.vcf','foo');
- $request = HTTP\Request::createFromServerArray(array(
+ $request = HTTP\Sapi::createFromServerArray(array(
'REQUEST_METHOD' => 'PUT',
'REQUEST_URI' => '/addressbooks/admin/addressbook1/blabla.vcf',
));
@@ -140,7 +140,7 @@ class ValidateVCardTest extends \PHPUnit_Framework_TestCase {
$response = $this->request($request);
- $this->assertEquals('204 No Content', $response->status);
+ $this->assertEquals(204, $response->status);
$expected = array(
'uri' => 'blabla.vcf',
diff --git a/tests/Sabre/DAV/Auth/Backend/AbstractBasicTest.php b/tests/Sabre/DAV/Auth/Backend/AbstractBasicTest.php
index e5553ac..f960fac 100644
--- a/tests/Sabre/DAV/Auth/Backend/AbstractBasicTest.php
+++ b/tests/Sabre/DAV/Auth/Backend/AbstractBasicTest.php
@@ -33,7 +33,7 @@ class AbstractBasicTest extends \PHPUnit_Framework_TestCase {
$server = new DAV\Server($tree);
$server->httpResponse = $response;
- $request = HTTP\Request::createFromServerArray(array(
+ $request = HTTP\Sapi::createFromServerArray(array(
'PHP_AUTH_USER' => 'username',
'PHP_AUTH_PW' => 'wrongpassword',
));
@@ -51,7 +51,7 @@ class AbstractBasicTest extends \PHPUnit_Framework_TestCase {
$server = new DAV\Server($tree);
$server->httpResponse = $response;
- $request = HTTP\Request::createFromServerArray(array(
+ $request = HTTP\Sapi::createFromServerArray(array(
'PHP_AUTH_USER' => 'username',
'PHP_AUTH_PW' => 'password',
));
diff --git a/tests/Sabre/DAV/Auth/Backend/AbstractDigestTest.php b/tests/Sabre/DAV/Auth/Backend/AbstractDigestTest.php
index 0675bf7..9b6727c 100644
--- a/tests/Sabre/DAV/Auth/Backend/AbstractDigestTest.php
+++ b/tests/Sabre/DAV/Auth/Backend/AbstractDigestTest.php
@@ -33,7 +33,7 @@ class AbstractDigestTest extends \PHPUnit_Framework_TestCase {
$server->httpResponse = $response;
$header = 'username=null, realm=myRealm, nonce=12345, uri=/, response=HASH, opaque=1, qop=auth, nc=1, cnonce=1';
- $request = HTTP\Request::createFromServerArray(array(
+ $request = HTTP\Sapi::createFromServerArray(array(
'PHP_AUTH_DIGEST' => $header,
));
$server->httpRequest = $request;
@@ -53,7 +53,7 @@ class AbstractDigestTest extends \PHPUnit_Framework_TestCase {
$server->httpResponse = $response;
$header = 'username=array, realm=myRealm, nonce=12345, uri=/, response=HASH, opaque=1, qop=auth, nc=1, cnonce=1';
- $request = HTTP\Request::createFromServerArray(array(
+ $request = HTTP\Sapi::createFromServerArray(array(
'PHP_AUTH_DIGEST' => $header,
));
$server->httpRequest = $request;
@@ -73,7 +73,7 @@ class AbstractDigestTest extends \PHPUnit_Framework_TestCase {
$server->httpResponse = $response;
$header = 'username=false, realm=myRealm, nonce=12345, uri=/, response=HASH, opaque=1, qop=auth, nc=1, cnonce=1';
- $request = HTTP\Request::createFromServerArray(array(
+ $request = HTTP\Sapi::createFromServerArray(array(
'PHP_AUTH_DIGEST' => $header,
));
$server->httpRequest = $request;
@@ -93,7 +93,7 @@ class AbstractDigestTest extends \PHPUnit_Framework_TestCase {
$server->httpResponse = $response;
$header = 'username=user, realm=myRealm, nonce=12345, uri=/, response=HASH, opaque=1, qop=auth, nc=1, cnonce=1';
- $request = HTTP\Request::createFromServerArray(array(
+ $request = HTTP\Sapi::createFromServerArray(array(
'PHP_AUTH_DIGEST' => $header,
'REQUEST_METHOD' => 'PUT',
));
@@ -112,7 +112,7 @@ class AbstractDigestTest extends \PHPUnit_Framework_TestCase {
$digestHash = md5('HELLO:12345:1:1:auth:' . md5('GET:/'));
$header = 'username=user, realm=myRealm, nonce=12345, uri=/, response='.$digestHash.', opaque=1, qop=auth, nc=1, cnonce=1';
- $request = HTTP\Request::createFromServerArray(array(
+ $request = HTTP\Sapi::createFromServerArray(array(
'REQUEST_METHOD' => 'GET',
'PHP_AUTH_DIGEST' => $header,
'REQUEST_URI' => '/',
diff --git a/tests/Sabre/DAV/Auth/Backend/ApacheTest.php b/tests/Sabre/DAV/Auth/Backend/ApacheTest.php
index 32131ce..2ae44d7 100644
--- a/tests/Sabre/DAV/Auth/Backend/ApacheTest.php
+++ b/tests/Sabre/DAV/Auth/Backend/ApacheTest.php
@@ -30,7 +30,7 @@ class ApacheTest extends \PHPUnit_Framework_TestCase {
$backend = new Apache();
$server = new DAV\Server();
- $request = HTTP\Request::createFromServerArray(array(
+ $request = HTTP\Sapi::createFromServerArray(array(
'REMOTE_USER' => 'username',
));
$server->httpRequest = $request;
diff --git a/tests/Sabre/DAV/Auth/Backend/BasicCallBackTest.php b/tests/Sabre/DAV/Auth/Backend/BasicCallBackTest.php
index 9570599..a1750d0 100644
--- a/tests/Sabre/DAV/Auth/Backend/BasicCallBackTest.php
+++ b/tests/Sabre/DAV/Auth/Backend/BasicCallBackTest.php
@@ -4,7 +4,7 @@ namespace Sabre\DAV\Auth\Backend;
use
Sabre\DAV\Server,
- Sabre\HTTP\Request;
+ Sabre\HTTP\Sapi;
class BasicCallBackTest extends \PHPUnit_Framework_TestCase {
@@ -21,7 +21,7 @@ class BasicCallBackTest extends \PHPUnit_Framework_TestCase {
$backend = new BasicCallBack($callBack);
$server = new Server();
- $server->httpRequest = Request::createFromServerArray([
+ $server->httpRequest = Sapi::createFromServerArray([
'HTTP_AUTHORIZATION' => 'Basic ' . base64_encode('foo:bar'),
]);
diff --git a/tests/Sabre/DAV/Auth/PluginTest.php b/tests/Sabre/DAV/Auth/PluginTest.php
index 808042c..cc814e2 100644
--- a/tests/Sabre/DAV/Auth/PluginTest.php
+++ b/tests/Sabre/DAV/Auth/PluginTest.php
@@ -52,7 +52,7 @@ class PluginTest extends \PHPUnit_Framework_TestCase {
$plugin = new Plugin(new Backend\Mock(),'realm');
$fakeServer->addPlugin($plugin);
- $request = HTTP\Request::createFromServerArray(array(
+ $request = HTTP\Sapi::createFromServerArray(array(
'REQUEST_METHOD' => 'REPORT',
'HTTP_CONTENT_TYPE' => 'application/xml',
'REQUEST_URI' => '/',
@@ -63,7 +63,7 @@ class PluginTest extends \PHPUnit_Framework_TestCase {
$fakeServer->httpResponse = new HTTP\ResponseMock();
$fakeServer->exec();
- $this->assertEquals('403 Forbidden', $fakeServer->httpResponse->status);
+ $this->assertEquals(403, $fakeServer->httpResponse->status);
}
diff --git a/tests/Sabre/DAV/Browser/MapGetToPropFindTest.php b/tests/Sabre/DAV/Browser/MapGetToPropFindTest.php
index 17641f3..9c615a6 100644
--- a/tests/Sabre/DAV/Browser/MapGetToPropFindTest.php
+++ b/tests/Sabre/DAV/Browser/MapGetToPropFindTest.php
@@ -23,12 +23,12 @@ class MapGetToPropFindTest extends DAV\AbstractServer {
'REQUEST_METHOD' => 'GET',
);
- $request = HTTP\Request::createFromServerArray($serverVars);
+ $request = HTTP\Sapi::createFromServerArray($serverVars);
$request->setBody('');
$this->server->httpRequest = ($request);
$this->server->exec();
- $this->assertEquals('207 Multi-Status',$this->response->status,'Incorrect status response received. Full response body: ' . $this->response->body);
+ $this->assertEquals(207, $this->response->status,'Incorrect status response received. Full response body: ' . $this->response->body);
$this->assertEquals(array(
'Content-Type' => 'application/xml; charset=utf-8',
'DAV' => '1, 3, extended-mkcol',
diff --git a/tests/Sabre/DAV/Browser/PluginTest.php b/tests/Sabre/DAV/Browser/PluginTest.php
index ba4405b..c9da3f7 100644
--- a/tests/Sabre/DAV/Browser/PluginTest.php
+++ b/tests/Sabre/DAV/Browser/PluginTest.php
@@ -23,11 +23,11 @@ class PluginTest extends DAV\AbstractServer{
'REQUEST_METHOD' => 'GET',
);
- $request = HTTP\Request::createFromServerArray($serverVars);
+ $request = HTTP\Sapi::createFromServerArray($serverVars);
$this->server->httpRequest = ($request);
$this->server->exec();
- $this->assertEquals('200 OK',$this->response->status);
+ $this->assertEquals(200, $this->response->status);
$this->assertEquals(array(
'Content-Type' => 'text/html; charset=utf-8',
'Content-Security-Policy' => "img-src 'self'; style-src 'unsafe-inline';"
@@ -47,11 +47,11 @@ class PluginTest extends DAV\AbstractServer{
'REQUEST_METHOD' => 'GET',
);
- $request = HTTP\Request::createFromServerArray($serverVars);
+ $request = HTTP\Sapi::createFromServerArray($serverVars);
$this->server->httpRequest = ($request);
$this->server->exec();
- $this->assertEquals('404 Not Found',$this->response->status);
+ $this->assertEquals(404, $this->response->status);
}
@@ -62,11 +62,11 @@ class PluginTest extends DAV\AbstractServer{
'REQUEST_METHOD' => 'POST',
'CONTENT_TYPE' => 'text/xml',
);
- $request = HTTP\Request::createFromServerArray($serverVars);
+ $request = HTTP\Sapi::createFromServerArray($serverVars);
$this->server->httpRequest = $request;
$this->server->exec();
- $this->assertEquals('501 Not Implemented', $this->response->status);
+ $this->assertEquals(501, $this->response->status);
}
@@ -79,11 +79,11 @@ class PluginTest extends DAV\AbstractServer{
);
$postVars = array();
- $request = HTTP\Request::createFromServerArray($serverVars,$postVars);
+ $request = HTTP\Sapi::createFromServerArray($serverVars,$postVars);
$this->server->httpRequest = $request;
$this->server->exec();
- $this->assertEquals('501 Not Implemented', $this->response->status);
+ $this->assertEquals(501, $this->response->status);
}
@@ -99,12 +99,12 @@ class PluginTest extends DAV\AbstractServer{
'name' => 'new_collection',
);
- $request = HTTP\Request::createFromServerArray($serverVars);
+ $request = HTTP\Sapi::createFromServerArray($serverVars);
$request->setPostData($postVars);
$this->server->httpRequest = $request;
$this->server->exec();
- $this->assertEquals('302 Found', $this->response->status);
+ $this->assertEquals(302, $this->response->status);
$this->assertEquals(array(
'Location' => '/',
), $this->response->headers);
diff --git a/tests/Sabre/DAV/ClientTest.php b/tests/Sabre/DAV/ClientTest.php
index d206444..fae73a2 100644
--- a/tests/Sabre/DAV/ClientTest.php
+++ b/tests/Sabre/DAV/ClientTest.php
@@ -24,951 +24,4 @@ class ClientTest extends \PHPUnit_Framework_TestCase {
}
- function testRequest() {
-
- $client = new ClientMock(array(
- 'baseUri' => 'http://example.org/foo/bar/',
- ));
-
- $responseBlob = array(
- "HTTP/1.1 200 OK",
- "Content-Type: text/plain",
- "",
- "Hello there!"
- );
-
- $client->response = array(
- implode("\r\n", $responseBlob),
- array(
- 'header_size' => 45,
- 'http_code' => 200,
- ),
- 0,
- ""
- );
-
- $body = fopen('php://memory','r+');
- fwrite($body, 'foo');
- rewind($body);
-
- $result = $client->request('POST', 'baz', $body, array('Content-Type' => 'text/plain'));
-
- $this->assertEquals('http://example.org/foo/bar/baz', $client->url);
- $this->assertEquals(array(
- CURLOPT_RETURNTRANSFER => true,
- CURLOPT_FOLLOWLOCATION => true,
- CURLOPT_MAXREDIRS => 5,
- CURLOPT_CUSTOMREQUEST => 'POST',
- CURLOPT_HEADER => true,
- CURLOPT_HTTPHEADER => array('Content-Type: text/plain'),
- CURLOPT_PUT => true,
- CURLOPT_INFILE => $body,
- CURLOPT_POSTREDIR => 3,
- ), $client->curlSettings);
-
- $this->assertEquals(array(
- 'statusCode' => 200,
- 'headers' => array(
- 'content-type' => 'text/plain',
- ),
- 'body' => 'Hello there!'
- ), $result);
-
-
- }
-
- function testStreamRequest() {
-
- $client = new ClientMock(array(
- 'baseUri' => 'http://example.org/foo/bar/',
- ));
-
- $responseBlob = array(
- "HTTP/1.1 200 OK",
- "Content-Type: text/plain",
- "",
- "Hello there!"
- );
-
- $client->response = array(
- implode("\r\n", $responseBlob),
- array(
- 'header_size' => 45,
- 'http_code' => 200,
- ),
- 0,
- ""
- );
-
- $body = fopen('php://memory','r+');
- fwrite($body, 'testing streams');
- rewind($body);
-
- $result = $client->request('POST', 'baz', $body, array('Content-Type' => 'text/plain'));
-
- $this->assertEquals('http://example.org/foo/bar/baz', $client->url);
- $this->assertEquals(array(
- CURLOPT_RETURNTRANSFER => true,
- CURLOPT_FOLLOWLOCATION => true,
- CURLOPT_MAXREDIRS => 5,
- CURLOPT_CUSTOMREQUEST => 'POST',
- CURLOPT_INFILE => $body,
- CURLOPT_HEADER => true,
- CURLOPT_HTTPHEADER => array('Content-Type: text/plain'),
- CURLOPT_PUT => true,
- CURLOPT_POSTREDIR => 3,
- ), $client->curlSettings);
-
- $this->assertEquals(array(
- 'statusCode' => 200,
- 'headers' => array(
- 'content-type' => 'text/plain',
- ),
- 'body' => 'Hello there!'
- ), $result);
-
- }
-
- function testRequestProxy() {
-
- $client = new ClientMock(array(
- 'baseUri' => 'http://example.org/foo/bar/',
- 'proxy' => 'http://localhost:8000/',
- ));
-
- $responseBlob = array(
- "HTTP/1.1 200 OK",
- "Content-Type: text/plain",
- "",
- "Hello there!"
- );
-
- $client->response = array(
- implode("\r\n", $responseBlob),
- array(
- 'header_size' => 45,
- 'http_code' => 200,
- ),
- 0,
- ""
- );
-
- $body = fopen('php://memory','r+');
- fwrite($body, 'foo');
- rewind($body);
-
- $result = $client->request('POST', 'baz', $body, array('Content-Type' => 'text/plain'));
-
- $this->assertEquals('http://example.org/foo/bar/baz', $client->url);
- $this->assertEquals(array(
- CURLOPT_RETURNTRANSFER => true,
- CURLOPT_FOLLOWLOCATION => true,
- CURLOPT_MAXREDIRS => 5,
- CURLOPT_CUSTOMREQUEST => 'POST',
- CURLOPT_HEADER => true,
- CURLOPT_HTTPHEADER => array('Content-Type: text/plain'),
- CURLOPT_PROXY => 'http://localhost:8000/',
- CURLOPT_PUT => true,
- CURLOPT_INFILE => $body,
- CURLOPT_POSTREDIR => 3,
- ), $client->curlSettings);
-
- $this->assertEquals(array(
- 'statusCode' => 200,
- 'headers' => array(
- 'content-type' => 'text/plain',
- ),
- 'body' => 'Hello there!'
- ), $result);
-
- }
-
- function testRequestCAInfo() {
-
- $client = new ClientMock(array(
- 'baseUri' => 'http://example.org/foo/bar/',
- ));
-
- $responseBlob = array(
- "HTTP/1.1 200 OK",
- "Content-Type: text/plain",
- "",
- "Hello there!"
- );
-
- $client->response = array(
- implode("\r\n", $responseBlob),
- array(
- 'header_size' => 45,
- 'http_code' => 200,
- ),
- 0,
- ""
- );
-
- $client->addTrustedCertificates('bla');
-
- $body = fopen('php://memory','r+');
- fwrite($body, 'foo');
- rewind($body);
-
- $result = $client->request('POST', 'baz', $body, array('Content-Type' => 'text/plain'));
-
- $this->assertEquals('http://example.org/foo/bar/baz', $client->url);
- $this->assertEquals(array(
- CURLOPT_RETURNTRANSFER => true,
- CURLOPT_FOLLOWLOCATION => true,
- CURLOPT_MAXREDIRS => 5,
- CURLOPT_CUSTOMREQUEST => 'POST',
- CURLOPT_HEADER => true,
- CURLOPT_CAINFO => 'bla',
- CURLOPT_HTTPHEADER => array('Content-Type: text/plain'),
- CURLOPT_PUT => true,
- CURLOPT_INFILE => $body,
- CURLOPT_POSTREDIR => 3,
- ), $client->curlSettings);
-
- }
-
- function testRequestSslPeer() {
-
- $client = new ClientMock(array(
- 'baseUri' => 'http://example.org/foo/bar/',
- ));
-
- $responseBlob = array(
- "HTTP/1.1 200 OK",
- "Content-Type: text/plain",
- "",
- "Hello there!"
- );
-
- $client->response = array(
- implode("\r\n", $responseBlob),
- array(
- 'header_size' => 45,
- 'http_code' => 200,
- ),
- 0,
- ""
- );
-
- $client->setVerifyPeer(true);
-
- $body = fopen('php://memory','r+');
- fwrite($body, 'foo');
- rewind($body);
-
- $result = $client->request('POST', 'baz', $body, array('Content-Type' => 'text/plain'));
-
- $this->assertEquals('http://example.org/foo/bar/baz', $client->url);
- $this->assertEquals(array(
- CURLOPT_RETURNTRANSFER => true,
- CURLOPT_FOLLOWLOCATION => true,
- CURLOPT_MAXREDIRS => 5,
- CURLOPT_CUSTOMREQUEST => 'POST',
- CURLOPT_HEADER => true,
- CURLOPT_HTTPHEADER => array('Content-Type: text/plain'),
- CURLOPT_SSL_VERIFYPEER => true,
- CURLOPT_PUT => true,
- CURLOPT_INFILE => $body,
- CURLOPT_POSTREDIR => 3,
- ), $client->curlSettings);
-
- }
-
- function testRequestAuth() {
-
- $client = new ClientMock(array(
- 'baseUri' => 'http://example.org/foo/bar/',
- 'userName' => 'user',
- 'password' => 'password',
- ));
-
- $responseBlob = array(
- "HTTP/1.1 200 OK",
- "Content-Type: text/plain",
- "",
- "Hello there!"
- );
-
- $client->response = array(
- implode("\r\n", $responseBlob),
- array(
- 'header_size' => 45,
- 'http_code' => 200,
- ),
- 0,
- ""
- );
-
- $body = fopen('php://memory','r+');
- fwrite($body, 'foo');
- rewind($body);
-
- $result = $client->request('POST', 'baz', $body, array('Content-Type' => 'text/plain'));
-
- $this->assertEquals('http://example.org/foo/bar/baz', $client->url);
- $this->assertEquals(array(
- CURLOPT_RETURNTRANSFER => true,
- CURLOPT_FOLLOWLOCATION => true,
- CURLOPT_MAXREDIRS => 5,
- CURLOPT_CUSTOMREQUEST => 'POST',
- CURLOPT_HEADER => true,
- CURLOPT_HTTPHEADER => array('Content-Type: text/plain'),
- CURLOPT_HTTPAUTH => CURLAUTH_BASIC | CURLAUTH_DIGEST,
- CURLOPT_USERPWD => 'user:password',
- CURLOPT_PUT => true,
- CURLOPT_INFILE => $body,
- CURLOPT_POSTREDIR => 3,
- ), $client->curlSettings);
-
- $this->assertEquals(array(
- 'statusCode' => 200,
- 'headers' => array(
- 'content-type' => 'text/plain',
- ),
- 'body' => 'Hello there!'
- ), $result);
-
- }
-
- function testRequestAuthBasic() {
-
- $client = new ClientMock(array(
- 'baseUri' => 'http://example.org/foo/bar/',
- 'userName' => 'user',
- 'password' => 'password',
- 'authType' => Client::AUTH_BASIC,
- ));
-
- $responseBlob = array(
- "HTTP/1.1 200 OK",
- "Content-Type: text/plain",
- "",
- "Hello there!"
- );
-
- $client->response = array(
- implode("\r\n", $responseBlob),
- array(
- 'header_size' => 45,
- 'http_code' => 200,
- ),
- 0,
- ""
- );
-
- $body = fopen('php://memory','r+');
- fwrite($body, 'foo');
- rewind($body);
-
- $result = $client->request('POST', 'baz', $body, array('Content-Type' => 'text/plain'));
-
- $this->assertEquals('http://example.org/foo/bar/baz', $client->url);
- $this->assertEquals(array(
- CURLOPT_RETURNTRANSFER => true,
- CURLOPT_FOLLOWLOCATION => true,
- CURLOPT_MAXREDIRS => 5,
- CURLOPT_CUSTOMREQUEST => 'POST',
- CURLOPT_HEADER => true,
- CURLOPT_HTTPHEADER => array('Content-Type: text/plain'),
- CURLOPT_HTTPAUTH => CURLAUTH_BASIC,
- CURLOPT_USERPWD => 'user:password',
- CURLOPT_PUT => true,
- CURLOPT_INFILE => $body,
- CURLOPT_POSTREDIR => 3,
- ), $client->curlSettings);
-
- $this->assertEquals(array(
- 'statusCode' => 200,
- 'headers' => array(
- 'content-type' => 'text/plain',
- ),
- 'body' => 'Hello there!'
- ), $result);
-
- }
-
- function testRequestAuthDigest() {
-
- $client = new ClientMock(array(
- 'baseUri' => 'http://example.org/foo/bar/',
- 'userName' => 'user',
- 'password' => 'password',
- 'authType' => Client::AUTH_DIGEST,
- ));
-
- $responseBlob = array(
- "HTTP/1.1 200 OK",
- "Content-Type: text/plain",
- "",
- "Hello there!"
- );
-
- $client->response = array(
- implode("\r\n", $responseBlob),
- array(
- 'header_size' => 45,
- 'http_code' => 200,
- ),
- 0,
- ""
- );
-
- $body = fopen('php://memory','r+');
- fwrite($body, 'foo');
- rewind($body);
-
- $result = $client->request('POST', 'baz', $body, array('Content-Type' => 'text/plain'));
-
- $this->assertEquals('http://example.org/foo/bar/baz', $client->url);
- $this->assertEquals(array(
- CURLOPT_RETURNTRANSFER => true,
- CURLOPT_FOLLOWLOCATION => true,
- CURLOPT_MAXREDIRS => 5,
- CURLOPT_CUSTOMREQUEST => 'POST',
- CURLOPT_HEADER => true,
- CURLOPT_HTTPHEADER => array('Content-Type: text/plain'),
- CURLOPT_HTTPAUTH => CURLAUTH_DIGEST,
- CURLOPT_USERPWD => 'user:password',
- CURLOPT_PUT => true,
- CURLOPT_INFILE => $body,
- CURLOPT_POSTREDIR => 3,
- ), $client->curlSettings);
-
- $this->assertEquals(array(
- 'statusCode' => 200,
- 'headers' => array(
- 'content-type' => 'text/plain',
- ),
- 'body' => 'Hello there!'
- ), $result);
-
- }
-
- /**
- * @expectedException \Sabre\HTTP\ClientException
- */
- function testRequestError() {
-
- $client = new ClientMock(array(
- 'baseUri' => 'http://example.org/foo/bar/',
- ));
-
- $responseBlob = array(
- "HTTP/1.1 200 OK",
- "Content-Type: text/plain",
- "",
- "Hello there!"
- );
-
- $client->response = array(
- implode("\r\n", $responseBlob),
- array(
- 'header_size' => 45,
- 'http_code' => 200,
- ),
- CURLE_COULDNT_CONNECT,
- "Could not connect, or something"
- );
-
- $client->request('POST', 'baz', 'sillybody', array('Content-Type' => 'text/plain'));
-
- }
-
- function testUnsupportedHTTPError() {
-
- $client = new ClientMock(array(
- 'baseUri' => 'http://example.org/foo/bar/',
- ));
-
- $responseBlob = array(
- "HTTP/1.1 580 blabla",
- "Content-Type: text/plain",
- "",
- "Hello there!"
- );
-
- $client->response = array(
- implode("\r\n", $responseBlob),
- array(
- 'header_size' => 42,
- 'http_code' => "580"
- ),
- 0,
- ""
- );
-
- $response = $client->request('POST', 'baz', 'sillybody', array('Content-Type' => 'text/plain'));
- $this->assertEquals(580, $response['statusCode']);
-
- }
-
- function testGetAbsoluteUrl() {
-
- $client = new ClientMock(array(
- 'baseUri' => 'http://example.org/foo/',
- ));
-
- $this->assertEquals(
- 'http://example.org/foo/bar',
- $client->getAbsoluteUrl('bar')
- );
-
- $this->assertEquals(
- 'http://example.org/bar',
- $client->getAbsoluteUrl('/bar')
- );
-
- $this->assertEquals(
- 'http://example.com/bar',
- $client->getAbsoluteUrl('http://example.com/bar')
- );
-
- }
-
- function testOptions() {
-
- $client = new ClientMock(array(
- 'baseUri' => 'http://example.org/foo/bar/',
- ));
-
- $responseBlob = array(
- "HTTP/1.1 200 OK",
- "DAV: feature1, feature2",
- "",
- );
-
- $client->response = array(
- implode("\r\n", $responseBlob),
- array(
- 'header_size' => 40,
- 'http_code' => 200,
- ),
- 0,
- ""
- );
-
- $result = $client->options();
- $this->assertEquals(
- array('feature1', 'feature2'),
- $result
- );
-
- }
-
- function testOptionsNoDav() {
-
- $client = new ClientMock(array(
- 'baseUri' => 'http://example.org/foo/bar/',
- ));
-
- $responseBlob = array(
- "HTTP/1.1 200 OK",
- "",
- );
-
- $client->response = array(
- implode("\r\n", $responseBlob),
- array(
- 'header_size' => 20,
- 'http_code' => 200,
- ),
- 0,
- ""
- );
-
- $result = $client->options();
- $this->assertEquals(
- array(),
- $result
- );
-
- }
-
- /**
- * @expectedException InvalidArgumentException
- */
- function testPropFindNoXML() {
-
- $client = new ClientMock(array(
- 'baseUri' => 'http://example.org/foo/bar/',
- ));
-
- $responseBlob = array(
- "HTTP/1.1 200 OK",
- "",
- );
-
- $client->response = array(
- implode("\r\n", $responseBlob),
- array(
- 'header_size' => 20,
- 'http_code' => 200,
- ),
- 0,
- ""
- );
-
- $client->propfind('', array('{DAV:}foo','{DAV:}bar'));
-
- }
-
- function testPropFind() {
-
- $client = new ClientMock(array(
- 'baseUri' => 'http://example.org/foo/bar/',
- ));
-
- $responseBlob = array(
- "HTTP/1.1 200 OK",
- "",
- "<?xml version=\"1.0\"?>",
- "<d:multistatus xmlns:d=\"DAV:\">",
- " <d:response>",
- " <d:href>/foo/bar/</d:href>",
- " <d:propstat>",
- " <d:prop>",
- " <d:foo>hello</d:foo>",
- " </d:prop>",
- " <d:status>HTTP/1.1 200 OK</d:status>",
- " </d:propstat>",
- " <d:propstat>",
- " <d:prop>",
- " <d:bar />",
- " </d:prop>",
- " <d:status>HTTP/1.1 404 Not Found</d:status>",
- " </d:propstat>",
- " </d:response>",
- "</d:multistatus>",
- );
-
- $client->response = array(
- implode("\r\n", $responseBlob),
- array(
- 'header_size' => 19,
- 'http_code' => 200,
- ),
- 0,
- ""
- );
-
- $result = $client->propfind('', array('{DAV:}foo','{DAV:}bar'));
-
- $this->assertEquals(array(
- '{DAV:}foo' => 'hello',
- ), $result);
-
- $requestBody = array(
- '<?xml version="1.0" encoding="UTF-8"?>',
- '<d:propfind xmlns:d="DAV:">',
- ' <d:prop>',
- ' <d:foo/>',
- ' <d:bar/>',
- ' </d:prop>',
- '</d:propfind>',
- ''
- );
- $requestBody = implode("\n", $requestBody);
-
- $this->assertEquals($requestBody, $client->curlSettings[CURLOPT_POSTFIELDS]);
-
- }
-
- /**
- * This was reported in Issue 235.
- *
- * If no '200 Ok' properties are returned, the client will throw an
- * E_NOTICE.
- */
- function testPropFindNo200s() {
-
- $client = new ClientMock(array(
- 'baseUri' => 'http://example.org/foo/bar/',
- ));
-
- $responseBlob = array(
- "HTTP/1.1 200 OK",
- "",
- "<?xml version=\"1.0\"?>",
- "<d:multistatus xmlns:d=\"DAV:\">",
- " <d:response>",
- " <d:href>/foo/bar/</d:href>",
- " <d:propstat>",
- " <d:prop>",
- " <d:bar />",
- " </d:prop>",
- " <d:status>HTTP/1.1 404 Not Found</d:status>",
- " </d:propstat>",
- " </d:response>",
- "</d:multistatus>",
- );
-
- $client->response = array(
- implode("\r\n", $responseBlob),
- array(
- 'header_size' => 19,
- 'http_code' => 200,
- ),
- 0,
- ""
- );
-
- $result = $client->propfind('', array('{DAV:}foo','{DAV:}bar'));
-
- $this->assertEquals(array(
- ), $result);
-
- }
-
- function testPropFindDepth1CustomProp() {
-
- $client = new ClientMock(array(
- 'baseUri' => 'http://example.org/foo/bar/',
- ));
-
- $responseBlob = array(
- "HTTP/1.1 200 OK",
- "",
- "<?xml version=\"1.0\"?>",
- "<d:multistatus xmlns:d=\"DAV:\" xmlns:x=\"urn:custom\">",
- " <d:response>",
- " <d:href>/foo/bar/</d:href>",
- " <d:propstat>",
- " <d:prop>",
- " <d:foo>hello</d:foo>",
- " <x:bar>world</x:bar>",
- " </d:prop>",
- " <d:status>HTTP/1.1 200 OK</d:status>",
- " </d:propstat>",
- " </d:response>",
- "</d:multistatus>",
- );
-
- $client->response = array(
- implode("\r\n", $responseBlob),
- array(
- 'header_size' => 19,
- 'http_code' => 200,
- ),
- 0,
- ""
- );
-
- $result = $client->propfind('', array('{DAV:}foo','{urn:custom}bar'),1);
-
- $this->assertEquals(array(
- "/foo/bar/" => array(
- '{DAV:}foo' => 'hello',
- '{urn:custom}bar' => 'world',
- ),
- ), $result);
-
- $requestBody = array(
- '<?xml version="1.0" encoding="UTF-8"?>',
- '<d:propfind xmlns:d="DAV:">',
- ' <d:prop xmlns:x="urn:custom">',
- ' <d:foo/>',
- ' <x:bar xmlns:x="urn:custom"/>',
- ' </d:prop>',
- '</d:propfind>',
- ''
- );
- $requestBody = implode("\n", $requestBody);
-
- $this->assertEquals($requestBody, $client->curlSettings[CURLOPT_POSTFIELDS]);
-
- }
-
- function testPropPatch() {
-
- $client = new ClientMock(array(
- 'baseUri' => 'http://example.org/foo/bar/',
- ));
-
- $responseBlob = array(
- "HTTP/1.1 200 OK",
- "",
- );
-
- $client->response = array(
- implode("\r\n", $responseBlob),
- array(
- 'header_size' => 20,
- 'http_code' => 200,
- ),
- 0,
- ""
- );
-
- $client->proppatch('', array(
- '{DAV:}foo' => 'newvalue',
- '{urn:custom}foo' => 'newvalue2',
- '{DAV:}bar' => null,
- '{urn:custom}bar' => null,
- ));
-
- $requestBody = array(
- '<?xml version="1.0" encoding="UTF-8"?>',
- '<d:propertyupdate xmlns:d="DAV:" xmlns:x="urn:custom">',
- ' <d:set>',
- ' <d:prop>',
- ' <d:foo>newvalue</d:foo>',
- ' </d:prop>',
- ' </d:set>',
- ' <d:set>',
- ' <d:prop>',
- ' <x:foo xmlns:x="urn:custom">newvalue2</x:foo>',
- ' </d:prop>',
- ' </d:set>',
- ' <d:remove>',
- ' <d:prop>',
- ' <d:bar/>',
- ' </d:prop>',
- ' </d:remove>',
- ' <d:remove>',
- ' <d:prop>',
- ' <x:bar xmlns:x="urn:custom"/>',
- ' </d:prop>',
- ' </d:remove>',
- '</d:propertyupdate>',
- ''
- );
- $requestBody = implode("\n", $requestBody);
-
- $this->assertEquals($requestBody, $client->curlSettings[CURLOPT_POSTFIELDS]);
-
- }
-
- function testHEADRequest() {
-
- $client = new ClientMock(array(
- 'baseUri' => 'http://example.org/foo/bar/',
- ));
-
- $responseBlob = array(
- "HTTP/1.1 200 OK",
- "Content-Type: text/plain",
- "",
- "Hello there!"
- );
-
- $client->response = array(
- implode("\r\n", $responseBlob),
- array(
- 'header_size' => 45,
- 'http_code' => 200,
- ),
- 0,
- ""
- );
-
- $result = $client->request('HEAD', 'baz');
-
- $this->assertEquals('http://example.org/foo/bar/baz', $client->url);
- $this->assertEquals(array(
- CURLOPT_RETURNTRANSFER => true,
- CURLOPT_FOLLOWLOCATION => true,
- CURLOPT_MAXREDIRS => 5,
- CURLOPT_CUSTOMREQUEST => 'HEAD',
- CURLOPT_NOBODY => true,
- CURLOPT_HEADER => true,
- CURLOPT_HTTPHEADER => array(),
- CURLOPT_POSTREDIR => 3,
- CURLOPT_POSTFIELDS => '',
- CURLOPT_PUT => false,
- ), $client->curlSettings);
-
- }
-
- function testPUTRequest() {
-
- $client = new ClientMock(array(
- 'baseUri' => 'http://example.org/foo/bar/',
- ));
-
- $responseBlob = array(
- "HTTP/1.1 200 OK",
- "Content-Type: text/plain",
- "",
- "Hello there!"
- );
-
- $client->response = array(
- implode("\r\n", $responseBlob),
- array(
- 'header_size' => 45,
- 'http_code' => 200,
- ),
- 0,
- ""
- );
-
- $body = fopen('php://memory','r+');
- fwrite($body, 'foo');
- rewind($body);
-
- $result = $client->request('PUT', 'bar', $body);
-
- $this->assertEquals('http://example.org/foo/bar/bar', $client->url);
- $this->assertEquals(array(
- CURLOPT_RETURNTRANSFER => true,
- CURLOPT_FOLLOWLOCATION => true,
- CURLOPT_MAXREDIRS => 5,
- CURLOPT_CUSTOMREQUEST => "PUT",
- CURLOPT_HEADER => true,
- CURLOPT_HTTPHEADER => array(),
- CURLOPT_INFILE => $body,
- CURLOPT_PUT => true,
- CURLOPT_POSTREDIR => 3,
- ), $client->curlSettings);
-
- }
-
- function testEncoding() {
-
- $client = new ClientMock(array(
- 'baseUri' => 'http://example.org/foo/bar/',
- 'encoding' => Client::ENCODING_ALL,
- ));
-
- $responseBlob = array(
- "HTTP/1.1 200 OK",
- "Content-Type: text/plain",
- "",
- "Hello there!"
- );
-
- $client->response = array(
- implode("\r\n", $responseBlob),
- array(
- 'header_size' => 45,
- 'http_code' => 200,
- ),
- 0,
- ""
- );
-
- $body = fopen('php://memory','r+');
- fwrite($body, 'foo');
- rewind($body);
-
- $result = $client->request('PUT', 'bar', $body);
-
- $this->assertEquals('http://example.org/foo/bar/bar', $client->url);
- $this->assertEquals(array(
- CURLOPT_RETURNTRANSFER => true,
- CURLOPT_FOLLOWLOCATION => true,
- CURLOPT_MAXREDIRS => 5,
- CURLOPT_CUSTOMREQUEST => "PUT",
- CURLOPT_HEADER => true,
- CURLOPT_HTTPHEADER => array(),
- CURLOPT_ENCODING => 'identity,deflate,gzip',
- CURLOPT_INFILE => $body,
- CURLOPT_PUT => true,
- CURLOPT_POSTREDIR => 3,
- ), $client->curlSettings);
-
- }
}
diff --git a/tests/Sabre/DAV/FSExt/ServerTest.php b/tests/Sabre/DAV/FSExt/ServerTest.php
index 0f42546..1cc9cbc 100644
--- a/tests/Sabre/DAV/FSExt/ServerTest.php
+++ b/tests/Sabre/DAV/FSExt/ServerTest.php
@@ -22,7 +22,7 @@ class ServerTest extends DAV\AbstractServer{
'REQUEST_METHOD' => 'GET',
);
- $request = HTTP\Request::createFromServerArray($serverVars);
+ $request = HTTP\Sapi::createFromServerArray($serverVars);
$this->server->httpRequest = ($request);
$this->server->exec();
@@ -35,7 +35,7 @@ class ServerTest extends DAV\AbstractServer{
$this->response->headers
);
- $this->assertEquals('200 OK',$this->response->status);
+ $this->assertEquals(200, $this->response->status);
$this->assertEquals('Test contents', stream_get_contents($this->response->body));
}
@@ -47,7 +47,7 @@ class ServerTest extends DAV\AbstractServer{
'REQUEST_METHOD' => 'HEAD',
);
- $request = HTTP\Request::createFromServerArray($serverVars);
+ $request = HTTP\Sapi::createFromServerArray($serverVars);
$this->server->httpRequest = ($request);
$this->server->exec();
@@ -60,7 +60,7 @@ class ServerTest extends DAV\AbstractServer{
$this->response->headers
);
- $this->assertEquals('200 OK',$this->response->status);
+ $this->assertEquals(200,$this->response->status);
$this->assertEquals('', $this->response->body);
}
@@ -72,7 +72,7 @@ class ServerTest extends DAV\AbstractServer{
'REQUEST_METHOD' => 'PUT',
);
- $request = HTTP\Request::createFromServerArray($serverVars);
+ $request = HTTP\Sapi::createFromServerArray($serverVars);
$request->setBody('Testing new file');
$this->server->httpRequest = ($request);
$this->server->exec();
@@ -82,7 +82,7 @@ class ServerTest extends DAV\AbstractServer{
'ETag' => '"' . md5('Testing new file') . '"',
), $this->response->headers);
- $this->assertEquals('201 Created',$this->response->status);
+ $this->assertEquals(201, $this->response->status);
$this->assertEquals('', $this->response->body);
$this->assertEquals('Testing new file',file_get_contents($this->tempDir . '/testput.txt'));
@@ -96,7 +96,7 @@ class ServerTest extends DAV\AbstractServer{
'HTTP_IF_NONE_MATCH' => '*',
);
- $request = HTTP\Request::createFromServerArray($serverVars);
+ $request = HTTP\Sapi::createFromServerArray($serverVars);
$request->setBody('Testing new file');
$this->server->httpRequest = ($request);
$this->server->exec();
@@ -105,7 +105,7 @@ class ServerTest extends DAV\AbstractServer{
'Content-Type' => 'application/xml; charset=utf-8',
),$this->response->headers);
- $this->assertEquals('412 Precondition failed',$this->response->status);
+ $this->assertEquals(412, $this->response->status);
$this->assertNotEquals('Testing new file',file_get_contents($this->tempDir . '/test.txt'));
}
@@ -117,7 +117,7 @@ class ServerTest extends DAV\AbstractServer{
'REQUEST_METHOD' => 'MKCOL',
);
- $request = HTTP\Request::createFromServerArray($serverVars);
+ $request = HTTP\Sapi::createFromServerArray($serverVars);
$request->setBody("");
$this->server->httpRequest = ($request);
$this->server->exec();
@@ -126,7 +126,7 @@ class ServerTest extends DAV\AbstractServer{
'Content-Length' => '0',
),$this->response->headers);
- $this->assertEquals('201 Created',$this->response->status);
+ $this->assertEquals(201, $this->response->status);
$this->assertEquals('', $this->response->body);
$this->assertTrue(is_dir($this->tempDir . '/testcol'));
@@ -139,14 +139,14 @@ class ServerTest extends DAV\AbstractServer{
'REQUEST_METHOD' => 'PUT',
);
- $request = HTTP\Request::createFromServerArray($serverVars);
+ $request = HTTP\Sapi::createFromServerArray($serverVars);
$request->setBody('Testing updated file');
$this->server->httpRequest = ($request);
$this->server->exec();
$this->assertEquals('0', $this->response->headers['Content-Length']);
- $this->assertEquals('204 No Content',$this->response->status);
+ $this->assertEquals(204, $this->response->status);
$this->assertEquals('', $this->response->body);
$this->assertEquals('Testing updated file',file_get_contents($this->tempDir . '/test.txt'));
@@ -159,7 +159,7 @@ class ServerTest extends DAV\AbstractServer{
'REQUEST_METHOD' => 'DELETE',
);
- $request = HTTP\Request::createFromServerArray($serverVars);
+ $request = HTTP\Sapi::createFromServerArray($serverVars);
$this->server->httpRequest = ($request);
$this->server->exec();
@@ -167,7 +167,7 @@ class ServerTest extends DAV\AbstractServer{
'Content-Length' => '0',
),$this->response->headers);
- $this->assertEquals('204 No Content',$this->response->status);
+ $this->assertEquals(204, $this->response->status);
$this->assertEquals('', $this->response->body);
$this->assertFalse(file_exists($this->tempDir . '/test.txt'));
@@ -183,14 +183,14 @@ class ServerTest extends DAV\AbstractServer{
mkdir($this->tempDir.'/testcol');
file_put_contents($this->tempDir.'/testcol/test.txt','Hi! I\'m a file with a short lifespan');
- $request = HTTP\Request::createFromServerArray($serverVars);
+ $request = HTTP\Sapi::createFromServerArray($serverVars);
$this->server->httpRequest = ($request);
$this->server->exec();
$this->assertEquals(array(
'Content-Length' => '0',
),$this->response->headers);
- $this->assertEquals('204 No Content',$this->response->status);
+ $this->assertEquals(204, $this->response->status);
$this->assertEquals('', $this->response->body);
$this->assertFalse(file_exists($this->tempDir . '/col'));
@@ -203,7 +203,7 @@ class ServerTest extends DAV\AbstractServer{
'REQUEST_METHOD' => 'OPTIONS',
);
- $request = HTTP\Request::createFromServerArray($serverVars);
+ $request = HTTP\Sapi::createFromServerArray($serverVars);
$this->server->httpRequest = ($request);
$this->server->exec();
@@ -216,7 +216,7 @@ class ServerTest extends DAV\AbstractServer{
'X-Sabre-Version'=> DAV\Version::VERSION,
),$this->response->headers);
- $this->assertEquals('200 OK',$this->response->status);
+ $this->assertEquals(200, $this->response->status);
$this->assertEquals('', $this->response->body);
}
diff --git a/tests/Sabre/DAV/GetIfConditionsTest.php b/tests/Sabre/DAV/GetIfConditionsTest.php
index bf7c76f..393e1f3 100644
--- a/tests/Sabre/DAV/GetIfConditionsTest.php
+++ b/tests/Sabre/DAV/GetIfConditionsTest.php
@@ -14,7 +14,7 @@ class GetIfConditionsTest extends AbstractServer {
$serverVars = array(
);
- $request = HTTP\Request::createFromServerArray($serverVars);
+ $request = HTTP\Sapi::createFromServerArray($serverVars);
$this->server->httpRequest = ($request);
$conditions = $this->server->getIfConditions();
@@ -29,7 +29,7 @@ class GetIfConditionsTest extends AbstractServer {
'REQUEST_URI' => '/path/',
);
- $request = HTTP\Request::createFromServerArray($serverVars);
+ $request = HTTP\Sapi::createFromServerArray($serverVars);
$this->server->httpRequest = ($request);
$conditions = $this->server->getIfConditions();
@@ -61,7 +61,7 @@ class GetIfConditionsTest extends AbstractServer {
'REQUEST_URI' => '/bla'
);
- $request = HTTP\Request::createFromServerArray($serverVars);
+ $request = HTTP\Sapi::createFromServerArray($serverVars);
$this->server->httpRequest = ($request);
$conditions = $this->server->getIfConditions();
@@ -91,7 +91,7 @@ class GetIfConditionsTest extends AbstractServer {
'HTTP_IF' => '<http://www.example.com/> (<opaquelocktoken:token1>)',
);
- $request = HTTP\Request::createFromServerArray($serverVars);
+ $request = HTTP\Sapi::createFromServerArray($serverVars);
$this->server->httpRequest = ($request);
$conditions = $this->server->getIfConditions();
@@ -122,7 +122,7 @@ class GetIfConditionsTest extends AbstractServer {
'REQUEST_URI' => '/bla',
);
- $request = HTTP\Request::createFromServerArray($serverVars);
+ $request = HTTP\Sapi::createFromServerArray($serverVars);
$this->server->httpRequest = ($request);
$conditions = $this->server->getIfConditions();
@@ -157,7 +157,7 @@ class GetIfConditionsTest extends AbstractServer {
'HTTP_IF' => '<http://www.example.org/node1> (<opaquelocktoken:token1>) <http://www.example.org/node2> (Not <opaquelocktoken:token2>)',
);
- $request = HTTP\Request::createFromServerArray($serverVars);
+ $request = HTTP\Sapi::createFromServerArray($serverVars);
$this->server->httpRequest = ($request);
$conditions = $this->server->getIfConditions();
@@ -197,7 +197,7 @@ class GetIfConditionsTest extends AbstractServer {
'HTTP_IF' => '<http://www.example.org/node1> (<opaquelocktoken:token1>) (<opaquelocktoken:token2>) <http://www.example.org/node2> (Not <opaquelocktoken:token3>)',
);
- $request = HTTP\Request::createFromServerArray($serverVars);
+ $request = HTTP\Sapi::createFromServerArray($serverVars);
$this->server->httpRequest = ($request);
$conditions = $this->server->getIfConditions();
@@ -243,7 +243,7 @@ class GetIfConditionsTest extends AbstractServer {
'REQUEST_URI' => '/foo',
);
- $request = HTTP\Request::createFromServerArray($serverVars);
+ $request = HTTP\Sapi::createFromServerArray($serverVars);
$this->server->httpRequest = ($request);
$conditions = $this->server->getIfConditions();
@@ -272,7 +272,7 @@ class GetIfConditionsTest extends AbstractServer {
'HTTP_IF' => '<http://www.example.org/> (["etag1"]) (["etag2"])',
);
- $request = HTTP\Request::createFromServerArray($serverVars);
+ $request = HTTP\Sapi::createFromServerArray($serverVars);
$this->server->httpRequest = ($request);
$conditions = $this->server->getIfConditions();
@@ -308,7 +308,7 @@ class GetIfConditionsTest extends AbstractServer {
'(<opaquelocktoken:token3>) (Not <opaquelocktoken:token4>) (["etag3"])',
);
- $request = HTTP\Request::createFromServerArray($serverVars);
+ $request = HTTP\Sapi::createFromServerArray($serverVars);
$this->server->httpRequest = ($request);
$conditions = $this->server->getIfConditions();
diff --git a/tests/Sabre/DAV/HTTPPreferParsingTest.php b/tests/Sabre/DAV/HTTPPreferParsingTest.php
index 1da0973..73c7926 100644
--- a/tests/Sabre/DAV/HTTPPreferParsingTest.php
+++ b/tests/Sabre/DAV/HTTPPreferParsingTest.php
@@ -8,7 +8,7 @@ class HTTPPReferParsingTest extends \Sabre\DAVServerTest {
function testParseSimple() {
- $httpRequest = HTTP\Request::createFromServerArray(array(
+ $httpRequest = HTTP\Sapi::createFromServerArray(array(
'HTTP_PREFER' => 'return-asynch',
));
@@ -28,7 +28,7 @@ class HTTPPReferParsingTest extends \Sabre\DAVServerTest {
function testParseValue() {
- $httpRequest = HTTP\Request::createFromServerArray(array(
+ $httpRequest = HTTP\Sapi::createFromServerArray(array(
'HTTP_PREFER' => 'wait=10',
));
@@ -48,7 +48,7 @@ class HTTPPReferParsingTest extends \Sabre\DAVServerTest {
function testParseMultiple() {
- $httpRequest = HTTP\Request::createFromServerArray(array(
+ $httpRequest = HTTP\Sapi::createFromServerArray(array(
'HTTP_PREFER' => 'return-minimal, strict,lenient',
));
@@ -68,7 +68,7 @@ class HTTPPReferParsingTest extends \Sabre\DAVServerTest {
function testParseWeirdValue() {
- $httpRequest = HTTP\Request::createFromServerArray(array(
+ $httpRequest = HTTP\Sapi::createFromServerArray(array(
'HTTP_PREFER' => 'BOOOH',
));
@@ -88,7 +88,7 @@ class HTTPPReferParsingTest extends \Sabre\DAVServerTest {
function testBrief() {
- $httpRequest = HTTP\Request::createFromServerArray(array(
+ $httpRequest = HTTP\Sapi::createFromServerArray(array(
'HTTP_BRIEF' => 't',
));
@@ -113,7 +113,7 @@ class HTTPPReferParsingTest extends \Sabre\DAVServerTest {
*/
function testpropfindMinimal() {
- $request = HTTP\Request::createFromServerArray(array(
+ $request = HTTP\Sapi::createFromServerArray(array(
'REQUEST_METHOD' => 'PROPFIND',
'REQUEST_URI' => '/',
'HTTP_PREFER' => 'return-minimal',
@@ -138,7 +138,7 @@ BLA
function testproppatchMinimal() {
- $request = HTTP\Request::createFromServerArray(array(
+ $request = HTTP\Sapi::createFromServerArray(array(
'REQUEST_METHOD' => 'PROPPATCH',
'REQUEST_URI' => '/',
'HTTP_PREFER' => 'return-minimal',
@@ -167,13 +167,13 @@ BLA
$response = $this->request($request);
$this->assertEquals(0, strlen($response->body), 'Expected empty body: ' . $response->body);
- $this->assertEquals('204 No Content', $response->status);
+ $this->assertEquals(204, $response->status);
}
function testproppatchMinimalError() {
- $request = HTTP\Request::createFromServerArray(array(
+ $request = HTTP\Sapi::createFromServerArray(array(
'REQUEST_METHOD' => 'PROPPATCH',
'REQUEST_URI' => '/',
'HTTP_PREFER' => 'return-minimal',
@@ -192,7 +192,7 @@ BLA
$response = $this->request($request);
- $this->assertEquals('207 Multi-Status', $response->status);
+ $this->assertEquals(207, $response->status);
$this->assertTrue(strpos($response->body, 'something')!==false);
$this->assertTrue(strpos($response->body, '403 Forbidden')!==false);
diff --git a/tests/Sabre/DAV/Issue33Test.php b/tests/Sabre/DAV/Issue33Test.php
index 1814980..c02d4bf 100644
--- a/tests/Sabre/DAV/Issue33Test.php
+++ b/tests/Sabre/DAV/Issue33Test.php
@@ -28,7 +28,7 @@ class Issue33Test extends \PHPUnit_Framework_TestCase {
'HTTP_OVERWRITE' => 'F',
);
- $request = HTTP\Request::createFromServerArray($serverVars);
+ $request = HTTP\Sapi::createFromServerArray($serverVars);
$server->httpRequest = $request;
@@ -78,7 +78,7 @@ class Issue33Test extends \PHPUnit_Framework_TestCase {
'HTTP_OVERWRITE' => 'F',
);
- $request = HTTP\Request::createFromServerArray($serverVars);
+ $request = HTTP\Sapi::createFromServerArray($serverVars);
$request->setBody('');
$response = new HTTP\ResponseMock();
diff --git a/tests/Sabre/DAV/Locks/MSWordTest.php b/tests/Sabre/DAV/Locks/MSWordTest.php
index 1fef73d..7f078ec 100644
--- a/tests/Sabre/DAV/Locks/MSWordTest.php
+++ b/tests/Sabre/DAV/Locks/MSWordTest.php
@@ -27,7 +27,7 @@ class MSWordTest extends \PHPUnit_Framework_TestCase {
$server->httpResponse = $response1;
$server->exec();
- $this->assertEquals('201 Created', $server->httpResponse->status);
+ $this->assertEquals(201, $server->httpResponse->status);
$this->assertTrue(isset($server->httpResponse->headers['Lock-Token']));
$lockToken = $server->httpResponse->headers['Lock-Token'];
@@ -39,7 +39,7 @@ class MSWordTest extends \PHPUnit_Framework_TestCase {
$server->httpResponse = $response2;
$server->exec();
- $this->assertEquals('201 Created', $server->httpResponse->status);
+ $this->assertEquals(201, $server->httpResponse->status);
$this->assertTrue(isset($server->httpResponse->headers['Lock-Token']));
//sleep(10);
@@ -49,7 +49,7 @@ class MSWordTest extends \PHPUnit_Framework_TestCase {
$server->httpResponse = $response3;
$server->exec();
- $this->assertEquals('204 No Content', $server->httpResponse->status);
+ $this->assertEquals(204, $server->httpResponse->status);
}
@@ -61,7 +61,7 @@ class MSWordTest extends \PHPUnit_Framework_TestCase {
function getLockRequest() {
- $request = HTTP\Request::createFromServerArray(array(
+ $request = HTTP\Sapi::createFromServerArray(array(
'REQUEST_METHOD' => 'LOCK',
'HTTP_CONTENT_TYPE' => 'application/xml',
'HTTP_TIMEOUT' => 'Second-3600',
@@ -85,7 +85,7 @@ class MSWordTest extends \PHPUnit_Framework_TestCase {
}
function getLockRequest2() {
- $request = HTTP\Request::createFromServerArray(array(
+ $request = HTTP\Sapi::createFromServerArray(array(
'REQUEST_METHOD' => 'LOCK',
'HTTP_CONTENT_TYPE' => 'application/xml',
'HTTP_TIMEOUT' => 'Second-3600',
@@ -110,7 +110,7 @@ class MSWordTest extends \PHPUnit_Framework_TestCase {
function getPutRequest($lockToken) {
- $request = HTTP\Request::createFromServerArray(array(
+ $request = HTTP\Sapi::createFromServerArray(array(
'REQUEST_METHOD' => 'PUT',
'REQUEST_URI' => '/Nouveau%20Microsoft%20Office%20Excel%20Worksheet.xlsx',
'HTTP_IF' => 'If: ('.$lockToken.')',
diff --git a/tests/Sabre/DAV/Locks/PluginTest.php b/tests/Sabre/DAV/Locks/PluginTest.php
index 1175a99..6582435 100644
--- a/tests/Sabre/DAV/Locks/PluginTest.php
+++ b/tests/Sabre/DAV/Locks/PluginTest.php
@@ -51,7 +51,7 @@ class PluginTest extends DAV\AbstractServer {
'REQUEST_METHOD' => 'LOCK',
);
- $request = HTTP\Request::createFromServerArray($serverVars);
+ $request = HTTP\Sapi::createFromServerArray($serverVars);
$request->setBody('');
$this->server->httpRequest = ($request);
$this->server->exec();
@@ -62,7 +62,7 @@ class PluginTest extends DAV\AbstractServer {
$this->response->headers
);
- $this->assertEquals('400 Bad request',$this->response->status);
+ $this->assertEquals(400, $this->response->status);
}
@@ -73,7 +73,7 @@ class PluginTest extends DAV\AbstractServer {
'REQUEST_METHOD' => 'LOCK',
);
- $request = HTTP\Request::createFromServerArray($serverVars);
+ $request = HTTP\Sapi::createFromServerArray($serverVars);
$request->setBody('<?xml version="1.0"?>
<D:lockinfo xmlns:D="DAV:">
<D:lockscope><D:exclusive/></D:lockscope>
@@ -89,7 +89,7 @@ class PluginTest extends DAV\AbstractServer {
$this->assertEquals('application/xml; charset=utf-8',$this->response->headers['Content-Type']);
$this->assertTrue(preg_match('/^<opaquelocktoken:(.*)>$/',$this->response->headers['Lock-Token'])===1,'We did not get a valid Locktoken back (' . $this->response->headers['Lock-Token'] . ')');
- $this->assertEquals('200 OK',$this->response->status,'Got an incorrect status back. Response body: ' . $this->response->body);
+ $this->assertEquals(200, $this->response->status,'Got an incorrect status back. Response body: ' . $this->response->body);
$body = preg_replace("/xmlns(:[A-Za-z0-9_])?=(\"|\')DAV:(\"|\')/","xmlns\\1=\"urn:DAV\"",$this->response->body);
$xml = simplexml_load_string($body);
@@ -135,7 +135,7 @@ class PluginTest extends DAV\AbstractServer {
'REQUEST_METHOD' => 'LOCK',
);
- $request = HTTP\Request::createFromServerArray($serverVars);
+ $request = HTTP\Sapi::createFromServerArray($serverVars);
$request->setBody('<?xml version="1.0"?>
<D:lockinfo xmlns:D="DAV:">
<D:lockscope><D:exclusive/></D:lockscope>
@@ -155,7 +155,7 @@ class PluginTest extends DAV\AbstractServer {
$this->assertEquals('application/xml; charset=utf-8',$this->response->headers['Content-Type']);
- $this->assertEquals('423 Locked',$this->response->status, 'Full response: ' . $this->response->body);
+ $this->assertEquals(423, $this->response->status, 'Full response: ' . $this->response->body);
}
@@ -169,7 +169,7 @@ class PluginTest extends DAV\AbstractServer {
'REQUEST_METHOD' => 'LOCK',
);
- $request = HTTP\Request::createFromServerArray($serverVars);
+ $request = HTTP\Sapi::createFromServerArray($serverVars);
$request->setBody('<?xml version="1.0"?>
<D:lockinfo xmlns:D="DAV:">
<D:lockscope><D:exclusive/></D:lockscope>
@@ -192,7 +192,7 @@ class PluginTest extends DAV\AbstractServer {
'REQUEST_METHOD' => 'LOCK',
'HTTP_IF' => '(' . $lockToken . ')',
);
- $request = HTTP\Request::createFromServerArray($serverVars);
+ $request = HTTP\Sapi::createFromServerArray($serverVars);
$request->setBody('');
$this->server->httpRequest = $request;
@@ -200,7 +200,7 @@ class PluginTest extends DAV\AbstractServer {
$this->assertEquals('application/xml; charset=utf-8',$this->response->headers['Content-Type']);
- $this->assertEquals('200 OK',$this->response->status,'We received an incorrect status code. Full response body: ' . $this->response->body);
+ $this->assertEquals(200, $this->response->status,'We received an incorrect status code. Full response body: ' . $this->response->body);
}
@@ -214,7 +214,7 @@ class PluginTest extends DAV\AbstractServer {
'REQUEST_METHOD' => 'LOCK',
);
- $request = HTTP\Request::createFromServerArray($serverVars);
+ $request = HTTP\Sapi::createFromServerArray($serverVars);
$request->setBody('<?xml version="1.0"?>
<D:lockinfo xmlns:D="DAV:">
<D:lockscope><D:exclusive/></D:lockscope>
@@ -230,7 +230,7 @@ class PluginTest extends DAV\AbstractServer {
$this->assertEquals('application/xml; charset=utf-8',$this->response->headers['Content-Type']);
$this->assertTrue(preg_match('/^<opaquelocktoken:(.*)>$/',$this->response->headers['Lock-Token'])===1,'We did not get a valid Locktoken back (' . $this->response->headers['Lock-Token'] . ')');
- $this->assertEquals('201 Created',$this->response->status);
+ $this->assertEquals(201, $this->response->status);
}
@@ -244,7 +244,7 @@ class PluginTest extends DAV\AbstractServer {
'REQUEST_METHOD' => 'UNLOCK',
);
- $request = HTTP\Request::createFromServerArray($serverVars);
+ $request = HTTP\Sapi::createFromServerArray($serverVars);
$this->server->httpRequest = ($request);
$this->server->exec();
@@ -254,7 +254,7 @@ class PluginTest extends DAV\AbstractServer {
$this->response->headers
);
- $this->assertEquals('400 Bad request',$this->response->status);
+ $this->assertEquals(400, $this->response->status);
}
@@ -269,7 +269,7 @@ class PluginTest extends DAV\AbstractServer {
'HTTP_LOCK_TOKEN' => '<opaquelocktoken:blablabla>',
);
- $request = HTTP\Request::createFromServerArray($serverVars);
+ $request = HTTP\Sapi::createFromServerArray($serverVars);
$this->server->httpRequest = ($request);
$this->server->exec();
@@ -279,7 +279,7 @@ class PluginTest extends DAV\AbstractServer {
$this->response->headers
);
- $this->assertEquals('409 Conflict',$this->response->status,'Got an incorrect status code. Full response body: ' . $this->response->body);
+ $this->assertEquals(409, $this->response->status,'Got an incorrect status code. Full response body: ' . $this->response->body);
}
@@ -293,7 +293,7 @@ class PluginTest extends DAV\AbstractServer {
'REQUEST_METHOD' => 'LOCK',
);
- $request = HTTP\Request::createFromServerArray($serverVars);
+ $request = HTTP\Sapi::createFromServerArray($serverVars);
$request->setBody('<?xml version="1.0"?>
<D:lockinfo xmlns:D="DAV:">
<D:lockscope><D:exclusive/></D:lockscope>
@@ -309,14 +309,14 @@ class PluginTest extends DAV\AbstractServer {
$this->assertEquals('application/xml; charset=utf-8',$this->response->headers['Content-Type']);
$this->assertTrue(preg_match('/^<opaquelocktoken:(.*)>$/',$this->response->headers['Lock-Token'])===1,'We did not get a valid Locktoken back (' . $this->response->headers['Lock-Token'] . ')');
- $this->assertEquals('200 OK',$this->response->status);
+ $this->assertEquals(200, $this->response->status);
$serverVars = array(
'REQUEST_URI' => '/test.txt',
'REQUEST_METHOD' => 'PUT',
);
- $request = HTTP\Request::createFromServerArray($serverVars);
+ $request = HTTP\Sapi::createFromServerArray($serverVars);
$request->setBody('newbody');
$this->server->httpRequest = $request;
$this->server->exec();
@@ -324,7 +324,7 @@ class PluginTest extends DAV\AbstractServer {
$this->assertEquals('application/xml; charset=utf-8',$this->response->headers['Content-Type']);
$this->assertTrue(preg_match('/^<opaquelocktoken:(.*)>$/',$this->response->headers['Lock-Token'])===1,'We did not get a valid Locktoken back (' . $this->response->headers['Lock-Token'] . ')');
- $this->assertEquals('423 Locked',$this->response->status);
+ $this->assertEquals(423, $this->response->status);
}
@@ -333,7 +333,7 @@ class PluginTest extends DAV\AbstractServer {
*/
function testUnlock() {
- $request = HTTP\Request::createFromServerArray([
+ $request = HTTP\Sapi::createFromServerArray([
'REQUEST_URI' => '/test.txt',
'REQUEST_METHOD' => 'LOCK',
]);
@@ -357,12 +357,12 @@ class PluginTest extends DAV\AbstractServer {
'REQUEST_METHOD' => 'UNLOCK',
);
- $request = HTTP\Request::createFromServerArray($serverVars);
+ $request = HTTP\Sapi::createFromServerArray($serverVars);
$this->server->httpRequest = $request;
$this->server->httpResponse = new HTTP\ResponseMock();
$this->server->invokeMethod($request, $this->server->httpResponse);
- $this->assertEquals('204 No Content',$this->server->httpResponse->status,'Got an incorrect status code. Full response body: ' . $this->response->body);
+ $this->assertEquals(204,$this->server->httpResponse->status,'Got an incorrect status code. Full response body: ' . $this->response->body);
$this->assertEquals(array(
'Content-Length' => '0',
),
@@ -377,7 +377,7 @@ class PluginTest extends DAV\AbstractServer {
*/
function testUnlockWindowsBug() {
- $request = HTTP\Request::createFromServerArray([
+ $request = HTTP\Sapi::createFromServerArray([
'REQUEST_URI' => '/test.txt',
'REQUEST_METHOD' => 'LOCK',
]);
@@ -404,12 +404,12 @@ class PluginTest extends DAV\AbstractServer {
'REQUEST_METHOD' => 'UNLOCK',
);
- $request = HTTP\Request::createFromServerArray($serverVars);
+ $request = HTTP\Sapi::createFromServerArray($serverVars);
$this->server->httpRequest = $request;
$this->server->httpResponse = new HTTP\ResponseMock();
$this->server->invokeMethod($request, $this->server->httpResponse);
- $this->assertEquals('204 No Content',$this->server->httpResponse->status,'Got an incorrect status code. Full response body: ' . $this->response->body);
+ $this->assertEquals(204, $this->server->httpResponse->status,'Got an incorrect status code. Full response body: ' . $this->response->body);
$this->assertEquals(array(
'Content-Length' => '0',
),
@@ -424,7 +424,7 @@ class PluginTest extends DAV\AbstractServer {
*/
function testLockRetainOwner() {
- $request = HTTP\Request::createFromServerArray([
+ $request = HTTP\Sapi::createFromServerArray([
'REQUEST_URI' => '/test.txt',
'REQUEST_METHOD' => 'LOCK',
]);
@@ -457,7 +457,7 @@ class PluginTest extends DAV\AbstractServer {
'REQUEST_METHOD' => 'LOCK',
);
- $request = HTTP\Request::createFromServerArray($serverVars);
+ $request = HTTP\Sapi::createFromServerArray($serverVars);
$request->setBody('<?xml version="1.0"?>
<D:lockinfo xmlns:D="DAV:">
<D:lockscope><D:exclusive/></D:lockscope>
@@ -473,7 +473,7 @@ class PluginTest extends DAV\AbstractServer {
$this->assertEquals('application/xml; charset=utf-8',$this->response->headers['Content-Type']);
$this->assertTrue(preg_match('/^<opaquelocktoken:(.*)>$/',$this->response->headers['Lock-Token'])===1,'We did not get a valid Locktoken back (' . $this->response->headers['Lock-Token'] . ')');
- $this->assertEquals('200 OK',$this->response->status);
+ $this->assertEquals(200, $this->response->status);
$serverVars = array(
'REQUEST_URI' => '/test.txt',
@@ -481,7 +481,7 @@ class PluginTest extends DAV\AbstractServer {
'HTTP_IF' => '(<opaquelocktoken:token1>)',
);
- $request = HTTP\Request::createFromServerArray($serverVars);
+ $request = HTTP\Sapi::createFromServerArray($serverVars);
$request->setBody('newbody');
$this->server->httpRequest = $request;
$this->server->exec();
@@ -490,7 +490,7 @@ class PluginTest extends DAV\AbstractServer {
$this->assertTrue(preg_match('/^<opaquelocktoken:(.*)>$/',$this->response->headers['Lock-Token'])===1,'We did not get a valid Locktoken back (' . $this->response->headers['Lock-Token'] . ')');
// $this->assertEquals('412 Precondition failed',$this->response->status);
- $this->assertEquals('423 Locked',$this->response->status);
+ $this->assertEquals(423, $this->response->status);
}
@@ -504,7 +504,7 @@ class PluginTest extends DAV\AbstractServer {
'REQUEST_METHOD' => 'LOCK',
);
- $request = HTTP\Request::createFromServerArray($serverVars);
+ $request = HTTP\Sapi::createFromServerArray($serverVars);
$request->setBody('<?xml version="1.0"?>
<D:lockinfo xmlns:D="DAV:">
<D:lockscope><D:exclusive/></D:lockscope>
@@ -520,18 +520,18 @@ class PluginTest extends DAV\AbstractServer {
$this->assertEquals('application/xml; charset=utf-8',$this->response->headers['Content-Type']);
$this->assertTrue(preg_match('/^<opaquelocktoken:(.*)>$/',$this->response->headers['Lock-Token'])===1,'We did not get a valid Locktoken back (' . $this->response->headers['Lock-Token'] . ')');
- $this->assertEquals('200 OK',$this->response->status);
+ $this->assertEquals(200, $this->response->status);
$serverVars = array(
'REQUEST_URI' => '/dir',
'REQUEST_METHOD' => 'DELETE',
);
- $request = HTTP\Request::createFromServerArray($serverVars);
+ $request = HTTP\Sapi::createFromServerArray($serverVars);
$this->server->httpRequest = $request;
$this->server->exec();
- $this->assertEquals('423 Locked',$this->response->status);
+ $this->assertEquals(423, $this->response->status);
$this->assertEquals('application/xml; charset=utf-8',$this->response->headers['Content-Type']);
}
@@ -545,7 +545,7 @@ class PluginTest extends DAV\AbstractServer {
'REQUEST_METHOD' => 'LOCK',
);
- $request = HTTP\Request::createFromServerArray($serverVars);
+ $request = HTTP\Sapi::createFromServerArray($serverVars);
$request->setBody('<?xml version="1.0"?>
<D:lockinfo xmlns:D="DAV:">
<D:lockscope><D:exclusive/></D:lockscope>
@@ -561,7 +561,7 @@ class PluginTest extends DAV\AbstractServer {
$this->assertEquals('application/xml; charset=utf-8',$this->response->headers['Content-Type']);
$this->assertTrue(preg_match('/^<opaquelocktoken:(.*)>$/',$this->response->headers['Lock-Token'])===1,'We did not get a valid Locktoken back (' . $this->response->headers['Lock-Token'] . ')');
- $this->assertEquals('200 OK',$this->response->status);
+ $this->assertEquals(200, $this->response->status);
$serverVars = array(
'REQUEST_URI' => '/dir/child.txt',
@@ -569,11 +569,11 @@ class PluginTest extends DAV\AbstractServer {
'HTTP_IF' => '(' . $this->response->headers['Lock-Token'] . ')',
);
- $request = HTTP\Request::createFromServerArray($serverVars);
+ $request = HTTP\Sapi::createFromServerArray($serverVars);
$this->server->httpRequest = $request;
$this->server->exec();
- $this->assertEquals('204 No Content',$this->response->status);
+ $this->assertEquals(204, $this->response->status);
$this->assertEquals('application/xml; charset=utf-8',$this->response->headers['Content-Type']);
}
@@ -588,7 +588,7 @@ class PluginTest extends DAV\AbstractServer {
'REQUEST_METHOD' => 'LOCK',
);
- $request = HTTP\Request::createFromServerArray($serverVars);
+ $request = HTTP\Sapi::createFromServerArray($serverVars);
$request->setBody('<?xml version="1.0"?>
<D:lockinfo xmlns:D="DAV:">
<D:lockscope><D:exclusive/></D:lockscope>
@@ -604,7 +604,7 @@ class PluginTest extends DAV\AbstractServer {
$this->assertEquals('application/xml; charset=utf-8',$this->response->headers['Content-Type']);
$this->assertTrue(preg_match('/^<opaquelocktoken:(.*)>$/',$this->response->headers['Lock-Token'])===1,'We did not get a valid Locktoken back (' . $this->response->headers['Lock-Token'] . ')');
- $this->assertEquals('200 OK',$this->response->status);
+ $this->assertEquals(200, $this->response->status);
$serverVars = array(
'REQUEST_URI' => '/dir/child.txt',
@@ -612,11 +612,11 @@ class PluginTest extends DAV\AbstractServer {
'HTTP_DESTINATION' => '/dir/child2.txt',
);
- $request = HTTP\Request::createFromServerArray($serverVars);
+ $request = HTTP\Sapi::createFromServerArray($serverVars);
$this->server->httpRequest = $request;
$this->server->exec();
- $this->assertEquals('201 Created',$this->response->status,'Copy must succeed if only the source is locked, but not the destination');
+ $this->assertEquals(201, $this->response->status,'Copy must succeed if only the source is locked, but not the destination');
$this->assertEquals('application/xml; charset=utf-8',$this->response->headers['Content-Type']);
}
@@ -630,7 +630,7 @@ class PluginTest extends DAV\AbstractServer {
'REQUEST_METHOD' => 'LOCK',
);
- $request = HTTP\Request::createFromServerArray($serverVars);
+ $request = HTTP\Sapi::createFromServerArray($serverVars);
$request->setBody('<?xml version="1.0"?>
<D:lockinfo xmlns:D="DAV:">
<D:lockscope><D:exclusive/></D:lockscope>
@@ -646,7 +646,7 @@ class PluginTest extends DAV\AbstractServer {
$this->assertEquals('application/xml; charset=utf-8',$this->response->headers['Content-Type']);
$this->assertTrue(preg_match('/^<opaquelocktoken:(.*)>$/',$this->response->headers['Lock-Token'])===1,'We did not get a valid Locktoken back (' . $this->response->headers['Lock-Token'] . ')');
- $this->assertEquals('201 Created',$this->response->status);
+ $this->assertEquals(201, $this->response->status);
$serverVars = array(
'REQUEST_URI' => '/dir/child.txt',
@@ -654,11 +654,11 @@ class PluginTest extends DAV\AbstractServer {
'HTTP_DESTINATION' => '/dir/child2.txt',
);
- $request = HTTP\Request::createFromServerArray($serverVars);
+ $request = HTTP\Sapi::createFromServerArray($serverVars);
$this->server->httpRequest = $request;
$this->server->exec();
- $this->assertEquals('423 Locked',$this->response->status,'Copy must succeed if only the source is locked, but not the destination');
+ $this->assertEquals(423, $this->response->status,'Copy must succeed if only the source is locked, but not the destination');
$this->assertEquals('application/xml; charset=utf-8',$this->response->headers['Content-Type']);
}
@@ -673,7 +673,7 @@ class PluginTest extends DAV\AbstractServer {
'REQUEST_METHOD' => 'LOCK',
);
- $request = HTTP\Request::createFromServerArray($serverVars);
+ $request = HTTP\Sapi::createFromServerArray($serverVars);
$request->setBody('<?xml version="1.0"?>
<D:lockinfo xmlns:D="DAV:">
<D:lockscope><D:exclusive/></D:lockscope>
@@ -689,7 +689,7 @@ class PluginTest extends DAV\AbstractServer {
$this->assertEquals('application/xml; charset=utf-8',$this->response->headers['Content-Type']);
$this->assertTrue(preg_match('/^<opaquelocktoken:(.*)>$/',$this->response->headers['Lock-Token'])===1,'We did not get a valid Locktoken back (' . $this->response->headers['Lock-Token'] . ')');
- $this->assertEquals('200 OK',$this->response->status);
+ $this->assertEquals(200, $this->response->status);
$serverVars = array(
'REQUEST_URI' => '/dir/child.txt',
@@ -697,11 +697,11 @@ class PluginTest extends DAV\AbstractServer {
'HTTP_DESTINATION' => '/dir/child2.txt',
);
- $request = HTTP\Request::createFromServerArray($serverVars);
+ $request = HTTP\Sapi::createFromServerArray($serverVars);
$this->server->httpRequest = $request;
$this->server->exec();
- $this->assertEquals('423 Locked',$this->response->status,'Copy must succeed if only the source is locked, but not the destination');
+ $this->assertEquals(423, $this->response->status,'Copy must succeed if only the source is locked, but not the destination');
$this->assertEquals('application/xml; charset=utf-8',$this->response->headers['Content-Type']);
}
@@ -716,7 +716,7 @@ class PluginTest extends DAV\AbstractServer {
'REQUEST_METHOD' => 'LOCK',
);
- $request = HTTP\Request::createFromServerArray($serverVars);
+ $request = HTTP\Sapi::createFromServerArray($serverVars);
$request->setBody('<?xml version="1.0"?>
<D:lockinfo xmlns:D="DAV:">
<D:lockscope><D:exclusive/></D:lockscope>
@@ -732,7 +732,7 @@ class PluginTest extends DAV\AbstractServer {
$this->assertEquals('application/xml; charset=utf-8',$this->response->headers['Content-Type']);
$this->assertTrue(preg_match('/^<opaquelocktoken:(.*)>$/',$this->response->headers['Lock-Token'])===1,'We did not get a valid Locktoken back (' . $this->response->headers['Lock-Token'] . ')');
- $this->assertEquals('200 OK',$this->response->status);
+ $this->assertEquals(200, $this->response->status);
$serverVars = array(
'REQUEST_URI' => '/dir/child.txt',
@@ -741,11 +741,11 @@ class PluginTest extends DAV\AbstractServer {
'HTTP_IF' => '(' . $this->response->headers['Lock-Token'] . ')',
);
- $request = HTTP\Request::createFromServerArray($serverVars);
+ $request = HTTP\Sapi::createFromServerArray($serverVars);
$this->server->httpRequest = $request;
$this->server->exec();
- $this->assertEquals('201 Created',$this->response->status,'A valid lock-token was provided for the source, so this MOVE operation must succeed. Full response body: ' . $this->response->body);
+ $this->assertEquals(201, $this->response->status,'A valid lock-token was provided for the source, so this MOVE operation must succeed. Full response body: ' . $this->response->body);
}
@@ -759,7 +759,7 @@ class PluginTest extends DAV\AbstractServer {
'REQUEST_METHOD' => 'LOCK',
);
- $request = HTTP\Request::createFromServerArray($serverVars);
+ $request = HTTP\Sapi::createFromServerArray($serverVars);
$request->setBody('<?xml version="1.0"?>
<D:lockinfo xmlns:D="DAV:">
<D:lockscope><D:exclusive/></D:lockscope>
@@ -775,7 +775,7 @@ class PluginTest extends DAV\AbstractServer {
$this->assertEquals('application/xml; charset=utf-8',$this->response->headers['Content-Type']);
$this->assertTrue(preg_match('/^<opaquelocktoken:(.*)>$/',$this->response->headers['Lock-Token'])===1,'We did not get a valid Locktoken back (' . $this->response->headers['Lock-Token'] . ')');
- $this->assertEquals('201 Created',$this->response->status);
+ $this->assertEquals(201, $this->response->status);
$serverVars = array(
'REQUEST_URI' => '/dir/child.txt',
@@ -783,11 +783,11 @@ class PluginTest extends DAV\AbstractServer {
'HTTP_DESTINATION' => '/dir/child2.txt',
);
- $request = HTTP\Request::createFromServerArray($serverVars);
+ $request = HTTP\Sapi::createFromServerArray($serverVars);
$this->server->httpRequest = $request;
$this->server->exec();
- $this->assertEquals('423 Locked',$this->response->status,'Copy must succeed if only the source is locked, but not the destination');
+ $this->assertEquals(423, $this->response->status,'Copy must succeed if only the source is locked, but not the destination');
$this->assertEquals('application/xml; charset=utf-8',$this->response->headers['Content-Type']);
}
@@ -802,7 +802,7 @@ class PluginTest extends DAV\AbstractServer {
'HTTP_DEPTH' => 'infinite',
);
- $request = HTTP\Request::createFromServerArray($serverVars);
+ $request = HTTP\Sapi::createFromServerArray($serverVars);
$request->setBody('<?xml version="1.0"?>
<D:lockinfo xmlns:D="DAV:">
<D:lockscope><D:exclusive/></D:lockscope>
@@ -818,7 +818,7 @@ class PluginTest extends DAV\AbstractServer {
$this->assertEquals('application/xml; charset=utf-8',$this->response->headers['Content-Type']);
$this->assertTrue(preg_match('/^<opaquelocktoken:(.*)>$/',$this->response->headers['Lock-Token'])===1,'We did not get a valid Locktoken back (' . $this->response->headers['Lock-Token'] . ')');
- $this->assertEquals('200 OK',$this->response->status);
+ $this->assertEquals(200,$this->response->status);
$serverVars = array(
'REQUEST_URI' => '/dir/child.txt',
@@ -827,11 +827,11 @@ class PluginTest extends DAV\AbstractServer {
'HTTP_IF' => '</dir> (' . $this->response->headers['Lock-Token'] . ')',
);
- $request = HTTP\Request::createFromServerArray($serverVars);
+ $request = HTTP\Sapi::createFromServerArray($serverVars);
$this->server->httpRequest = $request;
$this->server->exec();
- $this->assertEquals('201 Created',$this->response->status,'We locked the parent of both the source and destination, but the move didn\'t succeed.');
+ $this->assertEquals(201, $this->response->status,'We locked the parent of both the source and destination, but the move didn\'t succeed.');
$this->assertEquals('application/xml; charset=utf-8',$this->response->headers['Content-Type']);
}
@@ -846,7 +846,7 @@ class PluginTest extends DAV\AbstractServer {
'REQUEST_METHOD' => 'LOCK',
);
- $request = HTTP\Request::createFromServerArray($serverVars);
+ $request = HTTP\Sapi::createFromServerArray($serverVars);
$request->setBody('<?xml version="1.0"?>
<D:lockinfo xmlns:D="DAV:">
<D:lockscope><D:exclusive/></D:lockscope>
@@ -862,7 +862,7 @@ class PluginTest extends DAV\AbstractServer {
$this->assertEquals('application/xml; charset=utf-8',$this->response->headers['Content-Type']);
$this->assertTrue(preg_match('/^<opaquelocktoken:(.*)>$/',$this->response->headers['Lock-Token'])===1,'We did not get a valid Locktoken back (' . $this->response->headers['Lock-Token'] . ')');
- $this->assertEquals('200 OK',$this->response->status);
+ $this->assertEquals(200, $this->response->status);
$serverVars = array(
'REQUEST_URI' => '/test.txt',
@@ -870,7 +870,7 @@ class PluginTest extends DAV\AbstractServer {
'HTTP_IF' => '('.$this->response->headers['Lock-Token'].')',
);
- $request = HTTP\Request::createFromServerArray($serverVars);
+ $request = HTTP\Sapi::createFromServerArray($serverVars);
$request->setBody('newbody');
$this->server->httpRequest = $request;
$this->server->exec();
@@ -878,7 +878,7 @@ class PluginTest extends DAV\AbstractServer {
$this->assertEquals('application/xml; charset=utf-8',$this->response->headers['Content-Type']);
$this->assertTrue(preg_match('/^<opaquelocktoken:(.*)>$/',$this->response->headers['Lock-Token'])===1,'We did not get a valid Locktoken back (' . $this->response->headers['Lock-Token'] . ')');
- $this->assertEquals('204 No Content',$this->response->status);
+ $this->assertEquals(204, $this->response->status);
}
@@ -890,11 +890,11 @@ class PluginTest extends DAV\AbstractServer {
'HTTP_IF' => '(["etag1"])',
);
- $request = HTTP\Request::createFromServerArray($serverVars);
+ $request = HTTP\Sapi::createFromServerArray($serverVars);
$request->setBody('newbody');
$this->server->httpRequest = $request;
$this->server->exec();
- $this->assertEquals('412 Precondition failed',$this->response->status);
+ $this->assertEquals(412, $this->response->status);
}
@@ -914,17 +914,17 @@ class PluginTest extends DAV\AbstractServer {
'HTTP_IF' => '(["'.$etag.'"])',
);
- $request = HTTP\Request::createFromServerArray($serverVars);
+ $request = HTTP\Sapi::createFromServerArray($serverVars);
$request->setBody('newbody');
$this->server->httpRequest = $request;
$this->server->exec();
- $this->assertEquals('204 No Content',$this->response->status, 'Incorrect status received. Full response body:' . $this->response->body);
+ $this->assertEquals(204, $this->response->status, 'Incorrect status received. Full response body:' . $this->response->body);
}
function testGetTimeoutHeader() {
- $request = HTTP\Request::createFromServerArray(array(
+ $request = HTTP\Sapi::createFromServerArray(array(
'HTTP_TIMEOUT' => 'second-100',
));
@@ -936,7 +936,7 @@ class PluginTest extends DAV\AbstractServer {
function testGetTimeoutHeaderNotSet() {
- $request = HTTP\Request::createFromServerArray(array(
+ $request = HTTP\Sapi::createFromServerArray(array(
));
$this->server->httpRequest = $request;
@@ -947,7 +947,7 @@ class PluginTest extends DAV\AbstractServer {
function testGetTimeoutHeaderInfinite() {
- $request = HTTP\Request::createFromServerArray(array(
+ $request = HTTP\Sapi::createFromServerArray(array(
'HTTP_TIMEOUT' => 'infinite',
));
@@ -961,7 +961,7 @@ class PluginTest extends DAV\AbstractServer {
*/
function testGetTimeoutHeaderInvalid() {
- $request = HTTP\Request::createFromServerArray(array(
+ $request = HTTP\Sapi::createFromServerArray(array(
'HTTP_TIMEOUT' => 'yourmom',
));
diff --git a/tests/Sabre/DAV/Mount/PluginTest.php b/tests/Sabre/DAV/Mount/PluginTest.php
index df36024..091c286 100644
--- a/tests/Sabre/DAV/Mount/PluginTest.php
+++ b/tests/Sabre/DAV/Mount/PluginTest.php
@@ -23,11 +23,11 @@ class PluginTest extends DAV\AbstractServer {
'REQUEST_METHOD' => 'GET',
);
- $request = HTTP\Request::createFromServerArray($serverVars);
+ $request = HTTP\Sapi::createFromServerArray($serverVars);
$this->server->httpRequest = ($request);
$this->server->exec();
- $this->assertEquals('501 Not Implemented',$this->response->status,'We expected GET to not be implemented for Directories. Response body: ' . $this->response->body);
+ $this->assertEquals(501, $this->response->status,'We expected GET to not be implemented for Directories. Response body: ' . $this->response->body);
}
@@ -40,11 +40,11 @@ class PluginTest extends DAV\AbstractServer {
'HTTP_HOST' => 'example.org',
);
- $request = HTTP\Request::createFromServerArray($serverVars);
+ $request = HTTP\Sapi::createFromServerArray($serverVars);
$this->server->httpRequest = ($request);
$this->server->exec();
- $this->assertEquals('200 OK',$this->response->status);
+ $this->assertEquals(200, $this->response->status);
$xml = simplexml_load_string($this->response->body);
$this->assertTrue($xml==true,'Response was not a valid xml document');
diff --git a/tests/Sabre/DAV/PartialUpdate/PluginTest.php b/tests/Sabre/DAV/PartialUpdate/PluginTest.php
index 22656e7..280331f 100644
--- a/tests/Sabre/DAV/PartialUpdate/PluginTest.php
+++ b/tests/Sabre/DAV/PartialUpdate/PluginTest.php
@@ -41,20 +41,20 @@ class PluginTest extends \Sabre\DAVServerTest {
public function testPatchNoRange() {
$this->node->put('00000000');
- $request = HTTP\Request::createFromServerArray(array(
+ $request = HTTP\Sapi::createFromServerArray(array(
'REQUEST_METHOD' => 'PATCH',
'REQUEST_URI' => '/partial',
));
$response = $this->request($request);
- $this->assertEquals('400 Bad request', $response->status, 'Full response body:' . $response->body);
+ $this->assertEquals(400, $response->status, 'Full response body:' . $response->body);
}
public function testPatchNotSupported() {
$this->node->put('00000000');
- $request = HTTP\Request::createFromServerArray(array(
+ $request = HTTP\Sapi::createFromServerArray(array(
'REQUEST_METHOD' => 'PATCH',
'REQUEST_URI' => '/',
'X_UPDATE_RANGE' => '3-4',
@@ -65,14 +65,14 @@ class PluginTest extends \Sabre\DAVServerTest {
);
$response = $this->request($request);
- $this->assertEquals('405 Method Not Allowed', $response->status, 'Full response body:' . $response->body);
+ $this->assertEquals(405, $response->status, 'Full response body:' . $response->body);
}
public function testPatchNoContentType() {
$this->node->put('00000000');
- $request = HTTP\Request::createFromServerArray(array(
+ $request = HTTP\Sapi::createFromServerArray(array(
'REQUEST_METHOD' => 'PATCH',
'REQUEST_URI' => '/partial',
'HTTP_X_UPDATE_RANGE' => 'bytes=3-4',
@@ -83,14 +83,14 @@ class PluginTest extends \Sabre\DAVServerTest {
);
$response = $this->request($request);
- $this->assertEquals('415 Unsupported Media Type', $response->status, 'Full response body:' . $response->body);
+ $this->assertEquals(415, $response->status, 'Full response body:' . $response->body);
}
public function testPatchBadRange() {
$this->node->put('00000000');
- $request = HTTP\Request::createFromServerArray(array(
+ $request = HTTP\Sapi::createFromServerArray(array(
'REQUEST_METHOD' => 'PATCH',
'REQUEST_URI' => '/partial',
'HTTP_X_UPDATE_RANGE' => 'bytes=3-4',
@@ -101,14 +101,14 @@ class PluginTest extends \Sabre\DAVServerTest {
);
$response = $this->request($request);
- $this->assertEquals('416 Requested Range Not Satisfiable', $response->status, 'Full response body:' . $response->body);
+ $this->assertEquals(416, $response->status, 'Full response body:' . $response->body);
}
public function testPatchSuccess() {
$this->node->put('00000000');
- $request = HTTP\Request::createFromServerArray(array(
+ $request = HTTP\Sapi::createFromServerArray(array(
'REQUEST_METHOD' => 'PATCH',
'REQUEST_URI' => '/partial',
'HTTP_X_UPDATE_RANGE' => 'bytes=3-5',
@@ -120,7 +120,7 @@ class PluginTest extends \Sabre\DAVServerTest {
);
$response = $this->request($request);
- $this->assertEquals('204 No Content', $response->status, 'Full response body:' . $response->body);
+ $this->assertEquals(204, $response->status, 'Full response body:' . $response->body);
$this->assertEquals('00111000', $this->node->get());
}
diff --git a/tests/Sabre/DAV/Property/SupportedReportSetTest.php b/tests/Sabre/DAV/Property/SupportedReportSetTest.php
index d8aac0b..e089211 100644
--- a/tests/Sabre/DAV/Property/SupportedReportSetTest.php
+++ b/tests/Sabre/DAV/Property/SupportedReportSetTest.php
@@ -18,7 +18,7 @@ class SupportedReportSetTest extends DAV\AbstractServer {
'HTTP_DEPTH' => '0',
);
- $request = HTTP\Request::createFromServerArray($serverVars);
+ $request = HTTP\Sapi::createFromServerArray($serverVars);
$request->setBody($body);
$this->server->httpRequest = ($request);
@@ -40,7 +40,7 @@ class SupportedReportSetTest extends DAV\AbstractServer {
$this->sendPROPFIND($xml);
- $this->assertEquals('207 Multi-Status',$this->response->status,'We expected a multi-status response. Full response body: ' . $this->response->body);
+ $this->assertEquals(207, $this->response->status,'We expected a multi-status response. Full response body: ' . $this->response->body);
$body = preg_replace("/xmlns(:[A-Za-z0-9_])?=(\"|\')DAV:(\"|\')/","xmlns\\1=\"urn:DAV\"",$this->response->body);
$xml = simplexml_load_string($body);
@@ -77,7 +77,7 @@ class SupportedReportSetTest extends DAV\AbstractServer {
$this->sendPROPFIND($xml);
- $this->assertEquals('207 Multi-Status',$this->response->status,'We expected a multi-status response. Full response body: ' . $this->response->body);
+ $this->assertEquals(207, $this->response->status,'We expected a multi-status response. Full response body: ' . $this->response->body);
$body = preg_replace("/xmlns(:[A-Za-z0-9_])?=(\"|\')DAV:(\"|\')/","xmlns\\1=\"urn:DAV\"",$this->response->body);
$xml = simplexml_load_string($body);
diff --git a/tests/Sabre/DAV/ServerCopyMoveTest.php b/tests/Sabre/DAV/ServerCopyMoveTest.php
index 5c6b7e1..9b16ff9 100644
--- a/tests/Sabre/DAV/ServerCopyMoveTest.php
+++ b/tests/Sabre/DAV/ServerCopyMoveTest.php
@@ -56,11 +56,11 @@ class ServerCopyMoveTest extends \PHPUnit_Framework_TestCase {
'HTTP_DESTINATION' => '/test2.txt',
);
- $request = HTTP\Request::createFromServerArray($serverVars);
+ $request = HTTP\Sapi::createFromServerArray($serverVars);
$this->server->httpRequest = ($request);
$this->server->exec();
- $this->assertEquals('204 No Content',$this->response->status,'Received an incorrect HTTP status. Full body inspection: ' . $this->response->body);
+ $this->assertEquals(204, $this->response->status,'Received an incorrect HTTP status. Full body inspection: ' . $this->response->body);
$this->assertEquals(array(
'Content-Length' => '0',
),
@@ -79,11 +79,11 @@ class ServerCopyMoveTest extends \PHPUnit_Framework_TestCase {
'HTTP_DESTINATION' => '/test.txt',
);
- $request = HTTP\Request::createFromServerArray($serverVars);
+ $request = HTTP\Sapi::createFromServerArray($serverVars);
$this->server->httpRequest = ($request);
$this->server->exec();
- $this->assertEquals('403 Forbidden',$this->response->status,'Received an incorrect HTTP status. Full body inspection: ' . $this->response->body);
+ $this->assertEquals(403, $this->response->status,'Received an incorrect HTTP status. Full body inspection: ' . $this->response->body);
$this->assertEquals('Test contents',file_get_contents(SABRE_TEMPDIR. '/test.txt'));
}
@@ -96,11 +96,11 @@ class ServerCopyMoveTest extends \PHPUnit_Framework_TestCase {
'HTTP_DESTINATION' => '/test.txt',
);
- $request = HTTP\Request::createFromServerArray($serverVars);
+ $request = HTTP\Sapi::createFromServerArray($serverVars);
$this->server->httpRequest = ($request);
$this->server->exec();
- $this->assertEquals('403 Forbidden',$this->response->status,'Received an incorrect HTTP status. Full body inspection: ' . $this->response->body);
+ $this->assertEquals(403, $this->response->status,'Received an incorrect HTTP status. Full body inspection: ' . $this->response->body);
$this->assertEquals('Test contents',file_get_contents(SABRE_TEMPDIR. '/test.txt'));
}
@@ -113,7 +113,7 @@ class ServerCopyMoveTest extends \PHPUnit_Framework_TestCase {
'HTTP_DESTINATION' => '/test2.txt',
);
- $request = HTTP\Request::createFromServerArray($serverVars);
+ $request = HTTP\Sapi::createFromServerArray($serverVars);
$this->server->httpRequest = ($request);
$this->server->exec();
@@ -123,7 +123,7 @@ class ServerCopyMoveTest extends \PHPUnit_Framework_TestCase {
$this->response->headers
);
- $this->assertEquals('204 No Content',$this->response->status);
+ $this->assertEquals(204, $this->response->status);
$this->assertEquals('Test contents',file_get_contents(SABRE_TEMPDIR . '/test2.txt'));
$this->assertFalse(file_exists(SABRE_TEMPDIR . '/test.txt'),'The sourcefile test.txt should no longer exist at this point');
@@ -138,7 +138,7 @@ class ServerCopyMoveTest extends \PHPUnit_Framework_TestCase {
'HTTP_OVERWRITE' => 'F',
);
- $request = HTTP\Request::createFromServerArray($serverVars);
+ $request = HTTP\Sapi::createFromServerArray($serverVars);
$this->server->httpRequest = ($request);
$this->server->exec();
@@ -148,7 +148,7 @@ class ServerCopyMoveTest extends \PHPUnit_Framework_TestCase {
$this->response->headers
);
- $this->assertEquals('412 Precondition failed',$this->response->status);
+ $this->assertEquals(412, $this->response->status);
$this->assertEquals('Test contents2',file_get_contents(SABRE_TEMPDIR . '/test2.txt'));
@@ -163,7 +163,7 @@ class ServerCopyMoveTest extends \PHPUnit_Framework_TestCase {
'HTTP_OVERWRITE' => 'F',
);
- $request = HTTP\Request::createFromServerArray($serverVars);
+ $request = HTTP\Sapi::createFromServerArray($serverVars);
$this->server->httpRequest = ($request);
$this->server->exec();
@@ -173,7 +173,7 @@ class ServerCopyMoveTest extends \PHPUnit_Framework_TestCase {
$this->response->headers
);
- $this->assertEquals('409 Conflict',$this->response->status);
+ $this->assertEquals(409, $this->response->status);
}
@@ -186,11 +186,11 @@ class ServerCopyMoveTest extends \PHPUnit_Framework_TestCase {
'HTTP_OVERWRITE' => 'SURE!',
);
- $request = HTTP\Request::createFromServerArray($serverVars);
+ $request = HTTP\Sapi::createFromServerArray($serverVars);
$this->server->httpRequest = ($request);
$this->server->exec();
- $this->assertEquals('400 Bad request',$this->response->status);
+ $this->assertEquals(400, $this->response->status);
}
@@ -202,11 +202,11 @@ class ServerCopyMoveTest extends \PHPUnit_Framework_TestCase {
'HTTP_DESTINATION' => '/col2',
);
- $request = HTTP\Request::createFromServerArray($serverVars);
+ $request = HTTP\Sapi::createFromServerArray($serverVars);
$this->server->httpRequest = ($request);
$this->server->exec();
- $this->assertEquals('201 Created',$this->response->status,'Full response: ' . $this->response->getBody(true));
+ $this->assertEquals(201, $this->response->status,'Full response: ' . $this->response->getBody(true));
$this->assertEquals(array(
'Content-Length' => '0',
@@ -227,7 +227,7 @@ class ServerCopyMoveTest extends \PHPUnit_Framework_TestCase {
'HTTP_DESTINATION' => '/test3.txt',
);
- $request = HTTP\Request::createFromServerArray($serverVars);
+ $request = HTTP\Sapi::createFromServerArray($serverVars);
$this->server->httpRequest = ($request);
$this->server->exec();
@@ -237,7 +237,7 @@ class ServerCopyMoveTest extends \PHPUnit_Framework_TestCase {
$this->response->headers
);
- $this->assertEquals('201 Created',$this->response->status);
+ $this->assertEquals(201, $this->response->status);
$this->assertEquals('Test contents',file_get_contents(SABRE_TEMPDIR . '/test3.txt'));
}
@@ -250,11 +250,11 @@ class ServerCopyMoveTest extends \PHPUnit_Framework_TestCase {
'HTTP_DESTINATION' => '/col2',
);
- $request = HTTP\Request::createFromServerArray($serverVars);
+ $request = HTTP\Sapi::createFromServerArray($serverVars);
$this->server->httpRequest = ($request);
$this->server->exec();
- $this->assertEquals('201 Created',$this->response->status,'Incorrect status received. Full response body: ' . $this->response->body);
+ $this->assertEquals(201, $this->response->status,'Incorrect status received. Full response body: ' . $this->response->body);
$this->assertEquals(array(
'Content-Length' => '0',
diff --git a/tests/Sabre/DAV/ServerEventsTest.php b/tests/Sabre/DAV/ServerEventsTest.php
index b846aff..ea8bab9 100644
--- a/tests/Sabre/DAV/ServerEventsTest.php
+++ b/tests/Sabre/DAV/ServerEventsTest.php
@@ -34,7 +34,7 @@ class ServerEventsTest extends AbstractServer {
$this->assertFalse($this->server->createFile('bla','body'));
// Also testing put()
- $req = HTTP\Request::createFromServerArray(array(
+ $req = HTTP\Sapi::createFromServerArray(array(
'REQUEST_METHOD' => 'PUT',
'REQUEST_URI' => '/barbar',
));
@@ -56,7 +56,7 @@ class ServerEventsTest extends AbstractServer {
$this->server->on('exception', [$this, 'exceptionHandler']);
- $req = HTTP\Request::createFromServerArray(array(
+ $req = HTTP\Sapi::createFromServerArray(array(
'REQUEST_METHOD' => 'GET',
'REQUEST_URI' => '/not/exisitng',
));
diff --git a/tests/Sabre/DAV/ServerFinderBlockTest.php b/tests/Sabre/DAV/ServerFinderBlockTest.php
index 477ea57..cd0c524 100644
--- a/tests/Sabre/DAV/ServerFinderBlockTest.php
+++ b/tests/Sabre/DAV/ServerFinderBlockTest.php
@@ -17,13 +17,13 @@ class ServerFinderBlockTest extends AbstractServer{
'HTTP_X_EXPECTED_ENTITY_LENGTH' => '20',
);
- $request = HTTP\Request::createFromServerArray($serverVars);
+ $request = HTTP\Sapi::createFromServerArray($serverVars);
$request->setBody('Testing finder');
$this->server->httpRequest = $request;
$this->server->exec();
$this->assertEquals('', $this->response->body);
- $this->assertEquals('201 Created',$this->response->status);
+ $this->assertEquals(201, $this->response->status);
$this->assertEquals('0', $this->response->headers['Content-Length']);
$this->assertEquals('Testing finder',file_get_contents(SABRE_TEMPDIR . '/testput.txt'));
@@ -38,12 +38,12 @@ class ServerFinderBlockTest extends AbstractServer{
'HTTP_X_EXPECTED_ENTITY_LENGTH' => '20',
);
- $request = HTTP\Request::createFromServerArray($serverVars);
+ $request = HTTP\Sapi::createFromServerArray($serverVars);
$request->setBody('');
$this->server->httpRequest = $request;
$this->server->exec();
- $this->assertEquals('403 Forbidden',$this->response->status);
+ $this->assertEquals(403, $this->response->status);
$this->assertEquals(array(
'Content-Type' => 'application/xml; charset=utf-8',
),$this->response->headers);
diff --git a/tests/Sabre/DAV/ServerMKCOLTest.php b/tests/Sabre/DAV/ServerMKCOLTest.php
index 5ccfb36..0722a1a 100644
--- a/tests/Sabre/DAV/ServerMKCOLTest.php
+++ b/tests/Sabre/DAV/ServerMKCOLTest.php
@@ -17,7 +17,7 @@ class ServerMKCOLTest extends AbstractServer {
'REQUEST_METHOD' => 'MKCOL',
);
- $request = HTTP\Request::createFromServerArray($serverVars);
+ $request = HTTP\Sapi::createFromServerArray($serverVars);
$request->setBody("");
$this->server->httpRequest = ($request);
$this->server->exec();
@@ -26,7 +26,7 @@ class ServerMKCOLTest extends AbstractServer {
'Content-Length' => '0',
),$this->response->headers);
- $this->assertEquals('201 Created',$this->response->status);
+ $this->assertEquals(201, $this->response->status);
$this->assertEquals('', $this->response->body);
$this->assertTrue(is_dir($this->tempDir . '/testcol'));
@@ -42,7 +42,7 @@ class ServerMKCOLTest extends AbstractServer {
'REQUEST_METHOD' => 'MKCOL',
);
- $request = HTTP\Request::createFromServerArray($serverVars);
+ $request = HTTP\Sapi::createFromServerArray($serverVars);
$request->setBody("Hello");
$this->server->httpRequest = ($request);
$this->server->exec();
@@ -51,7 +51,7 @@ class ServerMKCOLTest extends AbstractServer {
'Content-Type' => 'application/xml; charset=utf-8',
),$this->response->headers);
- $this->assertEquals('415 Unsupported Media Type',$this->response->status);
+ $this->assertEquals(415, $this->response->status);
}
@@ -66,7 +66,7 @@ class ServerMKCOLTest extends AbstractServer {
'HTTP_CONTENT_TYPE' => 'application/xml',
);
- $request = HTTP\Request::createFromServerArray($serverVars);
+ $request = HTTP\Sapi::createFromServerArray($serverVars);
$request->setBody("Hello");
$this->server->httpRequest = ($request);
$this->server->exec();
@@ -75,7 +75,7 @@ class ServerMKCOLTest extends AbstractServer {
'Content-Type' => 'application/xml; charset=utf-8',
),$this->response->headers);
- $this->assertEquals('400 Bad request',$this->response->status);
+ $this->assertEquals(400, $this->response->status);
}
@@ -90,7 +90,7 @@ class ServerMKCOLTest extends AbstractServer {
'HTTP_CONTENT_TYPE' => 'application/xml',
);
- $request = HTTP\Request::createFromServerArray($serverVars);
+ $request = HTTP\Sapi::createFromServerArray($serverVars);
$request->setBody('<?xml version="1.0"?><html></html>');
$this->server->httpRequest = ($request);
$this->server->exec();
@@ -99,7 +99,7 @@ class ServerMKCOLTest extends AbstractServer {
'Content-Type' => 'application/xml; charset=utf-8',
),$this->response->headers);
- $this->assertEquals('415 Unsupported Media Type',$this->response->status);
+ $this->assertEquals(415, $this->response->status);
}
@@ -114,7 +114,7 @@ class ServerMKCOLTest extends AbstractServer {
'HTTP_CONTENT_TYPE' => 'application/xml',
);
- $request = HTTP\Request::createFromServerArray($serverVars);
+ $request = HTTP\Sapi::createFromServerArray($serverVars);
$request->setBody('<?xml version="1.0"?>
<mkcol xmlns="DAV:">
<set>
@@ -130,7 +130,7 @@ class ServerMKCOLTest extends AbstractServer {
'Content-Type' => 'application/xml; charset=utf-8',
),$this->response->headers);
- $this->assertEquals('400 Bad request',$this->response->status,'Wrong statuscode received. Full response body: ' .$this->response->body);
+ $this->assertEquals(400, $this->response->status,'Wrong statuscode received. Full response body: ' .$this->response->body);
}
@@ -145,7 +145,7 @@ class ServerMKCOLTest extends AbstractServer {
'HTTP_CONTENT_TYPE' => 'application/xml',
);
- $request = HTTP\Request::createFromServerArray($serverVars);
+ $request = HTTP\Sapi::createFromServerArray($serverVars);
$request->setBody('<?xml version="1.0"?>
<mkcol xmlns="DAV:">
<set>
@@ -161,7 +161,7 @@ class ServerMKCOLTest extends AbstractServer {
'Content-Type' => 'application/xml; charset=utf-8',
),$this->response->headers);
- $this->assertEquals('403 Forbidden',$this->response->status,'Wrong statuscode received. Full response body: ' .$this->response->body);
+ $this->assertEquals(403, $this->response->status,'Wrong statuscode received. Full response body: ' .$this->response->body);
}
@@ -176,7 +176,7 @@ class ServerMKCOLTest extends AbstractServer {
'HTTP_CONTENT_TYPE' => 'application/xml',
);
- $request = HTTP\Request::createFromServerArray($serverVars);
+ $request = HTTP\Sapi::createFromServerArray($serverVars);
$request->setBody('<?xml version="1.0"?>
<mkcol xmlns="DAV:">
<set>
@@ -192,7 +192,7 @@ class ServerMKCOLTest extends AbstractServer {
'Content-Type' => 'application/xml; charset=utf-8',
),$this->response->headers);
- $this->assertEquals('403 Forbidden',$this->response->status,'Wrong statuscode received. Full response body: ' .$this->response->body);
+ $this->assertEquals(403, $this->response->status,'Wrong statuscode received. Full response body: ' .$this->response->body);
}
@@ -207,7 +207,7 @@ class ServerMKCOLTest extends AbstractServer {
'HTTP_CONTENT_TYPE' => 'application/xml',
);
- $request = HTTP\Request::createFromServerArray($serverVars);
+ $request = HTTP\Sapi::createFromServerArray($serverVars);
$request->setBody('<?xml version="1.0"?>
<mkcol xmlns="DAV:">
<set>
@@ -223,7 +223,7 @@ class ServerMKCOLTest extends AbstractServer {
'Content-Length' => '0',
),$this->response->headers);
- $this->assertEquals('201 Created',$this->response->status,'Wrong statuscode received. Full response body: ' .$this->response->body);
+ $this->assertEquals(201, $this->response->status,'Wrong statuscode received. Full response body: ' .$this->response->body);
}
@@ -238,7 +238,7 @@ class ServerMKCOLTest extends AbstractServer {
'HTTP_CONTENT_TYPE' => 'application/xml',
);
- $request = HTTP\Request::createFromServerArray($serverVars);
+ $request = HTTP\Sapi::createFromServerArray($serverVars);
$request->setBody('<?xml version="1.0"?>
<mkcol xmlns="DAV:">
<set>
@@ -256,7 +256,7 @@ class ServerMKCOLTest extends AbstractServer {
'Content-Length' => '0',
),$this->response->headers);
- $this->assertEquals('201 Created',$this->response->status,'Wrong statuscode received. Full response body: ' .$this->response->body);
+ $this->assertEquals(201, $this->response->status,'Wrong statuscode received. Full response body: ' .$this->response->body);
}
@@ -270,7 +270,7 @@ class ServerMKCOLTest extends AbstractServer {
'REQUEST_METHOD' => 'MKCOL',
);
- $request = HTTP\Request::createFromServerArray($serverVars);
+ $request = HTTP\Sapi::createFromServerArray($serverVars);
$request->setBody('');
$this->server->httpRequest = ($request);
@@ -280,7 +280,7 @@ class ServerMKCOLTest extends AbstractServer {
'Content-Type' => 'application/xml; charset=utf-8',
),$this->response->headers);
- $this->assertEquals('409 Conflict',$this->response->status,'Wrong statuscode received. Full response body: ' .$this->response->body);
+ $this->assertEquals(409, $this->response->status,'Wrong statuscode received. Full response body: ' .$this->response->body);
}
@@ -294,7 +294,7 @@ class ServerMKCOLTest extends AbstractServer {
'REQUEST_METHOD' => 'MKCOL',
);
- $request = HTTP\Request::createFromServerArray($serverVars);
+ $request = HTTP\Sapi::createFromServerArray($serverVars);
$request->setBody('');
$this->server->httpRequest = ($request);
@@ -304,7 +304,7 @@ class ServerMKCOLTest extends AbstractServer {
'Content-Type' => 'application/xml; charset=utf-8',
),$this->response->headers);
- $this->assertEquals('409 Conflict',$this->response->status,'Wrong statuscode received. Full response body: ' .$this->response->body);
+ $this->assertEquals(409, $this->response->status,'Wrong statuscode received. Full response body: ' .$this->response->body);
}
@@ -318,7 +318,7 @@ class ServerMKCOLTest extends AbstractServer {
'REQUEST_METHOD' => 'MKCOL',
);
- $request = HTTP\Request::createFromServerArray($serverVars);
+ $request = HTTP\Sapi::createFromServerArray($serverVars);
$request->setBody('');
$this->server->httpRequest = ($request);
@@ -329,7 +329,7 @@ class ServerMKCOLTest extends AbstractServer {
'Allow' => 'OPTIONS, GET, HEAD, DELETE, PROPFIND, PUT, PROPPATCH, COPY, MOVE, REPORT',
),$this->response->headers);
- $this->assertEquals('405 Method Not Allowed',$this->response->status,'Wrong statuscode received. Full response body: ' .$this->response->body);
+ $this->assertEquals(405, $this->response->status,'Wrong statuscode received. Full response body: ' .$this->response->body);
}
@@ -345,7 +345,7 @@ class ServerMKCOLTest extends AbstractServer {
'HTTP_CONTENT_TYPE' => 'application/xml',
);
- $request = HTTP\Request::createFromServerArray($serverVars);
+ $request = HTTP\Sapi::createFromServerArray($serverVars);
$request->setBody('<?xml version="1.0"?>
<mkcol xmlns="DAV:">
<set>
@@ -358,7 +358,7 @@ class ServerMKCOLTest extends AbstractServer {
$this->server->httpRequest = ($request);
$this->server->exec();
- $this->assertEquals('207 Multi-Status',$this->response->status,'Wrong statuscode received. Full response body: ' .$this->response->body);
+ $this->assertEquals(207, $this->response->status,'Wrong statuscode received. Full response body: ' .$this->response->body);
$this->assertEquals(array(
'Content-Type' => 'application/xml; charset=utf-8',
diff --git a/tests/Sabre/DAV/ServerPluginTest.php b/tests/Sabre/DAV/ServerPluginTest.php
index 0e48ec5..29ffc8b 100644
--- a/tests/Sabre/DAV/ServerPluginTest.php
+++ b/tests/Sabre/DAV/ServerPluginTest.php
@@ -41,7 +41,7 @@ class ServerPluginTest extends AbstractServer {
'REQUEST_METHOD' => 'OPTIONS',
);
- $request = HTTP\Request::createFromServerArray($serverVars);
+ $request = HTTP\Sapi::createFromServerArray($serverVars);
$this->server->httpRequest = ($request);
$this->server->exec();
@@ -54,7 +54,7 @@ class ServerPluginTest extends AbstractServer {
'X-Sabre-Version' => Version::VERSION,
),$this->response->headers);
- $this->assertEquals('200 OK',$this->response->status);
+ $this->assertEquals(200, $this->response->status);
$this->assertEquals('', $this->response->body);
$this->assertEquals('OPTIONS',$this->testPlugin->beforeMethod);
diff --git a/tests/Sabre/DAV/ServerPreconditionTest.php b/tests/Sabre/DAV/ServerPreconditionTest.php
index 18c7bb8..5d65a9f 100644
--- a/tests/Sabre/DAV/ServerPreconditionTest.php
+++ b/tests/Sabre/DAV/ServerPreconditionTest.php
@@ -16,7 +16,7 @@ class ServerPreconditionsTest extends \PHPUnit_Framework_TestCase {
$root = new SimpleCollection('root',array(new ServerPreconditionsNode()));
$server = new Server($root);
- $httpRequest = HTTP\Request::createFromServerArray(array(
+ $httpRequest = HTTP\Sapi::createFromServerArray(array(
'HTTP_IF_MATCH' => '*',
'REQUEST_URI' => '/bar'
));
@@ -33,7 +33,7 @@ class ServerPreconditionsTest extends \PHPUnit_Framework_TestCase {
$root = new SimpleCollection('root',array(new ServerPreconditionsNode()));
$server = new Server($root);
- $httpRequest = HTTP\Request::createFromServerArray(array(
+ $httpRequest = HTTP\Sapi::createFromServerArray(array(
'HTTP_IF_MATCH' => '*',
'REQUEST_URI' => '/foo'
));
@@ -51,7 +51,7 @@ class ServerPreconditionsTest extends \PHPUnit_Framework_TestCase {
$root = new SimpleCollection('root',array(new ServerPreconditionsNode()));
$server = new Server($root);
- $httpRequest = HTTP\Request::createFromServerArray(array(
+ $httpRequest = HTTP\Sapi::createFromServerArray(array(
'HTTP_IF_MATCH' => '1234',
'REQUEST_URI' => '/foo'
));
@@ -68,7 +68,7 @@ class ServerPreconditionsTest extends \PHPUnit_Framework_TestCase {
$root = new SimpleCollection('root',array(new ServerPreconditionsNode()));
$server = new Server($root);
- $httpRequest = HTTP\Request::createFromServerArray(array(
+ $httpRequest = HTTP\Sapi::createFromServerArray(array(
'HTTP_IF_MATCH' => '"abc123"',
'REQUEST_URI' => '/foo'
));
@@ -88,7 +88,7 @@ class ServerPreconditionsTest extends \PHPUnit_Framework_TestCase {
$root = new SimpleCollection('root',array(new ServerPreconditionsNode()));
$server = new Server($root);
- $httpRequest = HTTP\Request::createFromServerArray(array(
+ $httpRequest = HTTP\Sapi::createFromServerArray(array(
'HTTP_IF_MATCH' => '\\"abc123\\"',
'REQUEST_URI' => '/foo'
));
@@ -105,7 +105,7 @@ class ServerPreconditionsTest extends \PHPUnit_Framework_TestCase {
$root = new SimpleCollection('root',array(new ServerPreconditionsNode()));
$server = new Server($root);
- $httpRequest = HTTP\Request::createFromServerArray(array(
+ $httpRequest = HTTP\Sapi::createFromServerArray(array(
'HTTP_IF_MATCH' => '"hellothere", "abc123"',
'REQUEST_URI' => '/foo'
));
@@ -122,7 +122,7 @@ class ServerPreconditionsTest extends \PHPUnit_Framework_TestCase {
$root = new SimpleCollection('root',array(new ServerPreconditionsNode()));
$server = new Server($root);
- $httpRequest = HTTP\Request::createFromServerArray(array(
+ $httpRequest = HTTP\Sapi::createFromServerArray(array(
'HTTP_IF_NONE_MATCH' => '*',
'REQUEST_URI' => '/bar'
));
@@ -140,7 +140,7 @@ class ServerPreconditionsTest extends \PHPUnit_Framework_TestCase {
$root = new SimpleCollection('root',array(new ServerPreconditionsNode()));
$server = new Server($root);
- $httpRequest = HTTP\Request::createFromServerArray(array(
+ $httpRequest = HTTP\Sapi::createFromServerArray(array(
'HTTP_IF_NONE_MATCH' => '*',
'REQUEST_URI' => '/foo'
));
@@ -157,7 +157,7 @@ class ServerPreconditionsTest extends \PHPUnit_Framework_TestCase {
$root = new SimpleCollection('root',array(new ServerPreconditionsNode()));
$server = new Server($root);
- $httpRequest = HTTP\Request::createFromServerArray(array(
+ $httpRequest = HTTP\Sapi::createFromServerArray(array(
'HTTP_IF_NONE_MATCH' => '"1234"',
'REQUEST_URI' => '/foo'
));
@@ -174,7 +174,7 @@ class ServerPreconditionsTest extends \PHPUnit_Framework_TestCase {
$root = new SimpleCollection('root',array(new ServerPreconditionsNode()));
$server = new Server($root);
- $httpRequest = HTTP\Request::createFromServerArray(array(
+ $httpRequest = HTTP\Sapi::createFromServerArray(array(
'HTTP_IF_NONE_MATCH' => '"1234", "5678"',
'REQUEST_URI' => '/foo'
));
@@ -192,7 +192,7 @@ class ServerPreconditionsTest extends \PHPUnit_Framework_TestCase {
$root = new SimpleCollection('root',array(new ServerPreconditionsNode()));
$server = new Server($root);
- $httpRequest = HTTP\Request::createFromServerArray(array(
+ $httpRequest = HTTP\Sapi::createFromServerArray(array(
'HTTP_IF_NONE_MATCH' => '"abc123"',
'REQUEST_URI' => '/foo'
));
@@ -210,7 +210,7 @@ class ServerPreconditionsTest extends \PHPUnit_Framework_TestCase {
$root = new SimpleCollection('root',array(new ServerPreconditionsNode()));
$server = new Server($root);
- $httpRequest = HTTP\Request::createFromServerArray(array(
+ $httpRequest = HTTP\Sapi::createFromServerArray(array(
'HTTP_IF_NONE_MATCH' => '"1234", "abc123"',
'REQUEST_URI' => '/foo'
));
@@ -227,7 +227,7 @@ class ServerPreconditionsTest extends \PHPUnit_Framework_TestCase {
$root = new SimpleCollection('root',array(new ServerPreconditionsNode()));
$server = new Server($root);
- $httpRequest = HTTP\Request::createFromServerArray(array(
+ $httpRequest = HTTP\Sapi::createFromServerArray(array(
'HTTP_IF_NONE_MATCH' => '"abc123"',
'REQUEST_URI' => '/foo'
));
@@ -235,7 +235,7 @@ class ServerPreconditionsTest extends \PHPUnit_Framework_TestCase {
$server->httpResponse = new HTTP\ResponseMock();
$this->assertFalse($server->checkPreconditions(true));
- $this->assertEquals('304 Not Modified',$server->httpResponse->status);
+ $this->assertEquals(304, $server->httpResponse->status);
}
@@ -246,7 +246,7 @@ class ServerPreconditionsTest extends \PHPUnit_Framework_TestCase {
$root = new SimpleCollection('root',array(new ServerPreconditionsNode()));
$server = new Server($root);
- $httpRequest = HTTP\Request::createFromServerArray(array(
+ $httpRequest = HTTP\Sapi::createFromServerArray(array(
'HTTP_IF_MODIFIED_SINCE' => 'Sun, 06 Nov 1994 08:49:37 GMT',
'REQUEST_URI' => '/foo'
));
@@ -254,7 +254,7 @@ class ServerPreconditionsTest extends \PHPUnit_Framework_TestCase {
$server->httpResponse = new HTTP\ResponseMock();
$this->assertFalse($server->checkPreconditions());
- $this->assertEquals('304 Not Modified',$server->httpResponse->status);
+ $this->assertEquals(304, $server->httpResponse->status);
$this->assertEquals(array(
'Last-Modified' => 'Sat, 06 Apr 1985 23:30:00 GMT',
), $server->httpResponse->headers);
@@ -269,7 +269,7 @@ class ServerPreconditionsTest extends \PHPUnit_Framework_TestCase {
$root = new SimpleCollection('root',array(new ServerPreconditionsNode()));
$server = new Server($root);
- $httpRequest = HTTP\Request::createFromServerArray(array(
+ $httpRequest = HTTP\Sapi::createFromServerArray(array(
'HTTP_IF_MODIFIED_SINCE' => 'Tue, 06 Nov 1984 08:49:37 GMT',
'REQUEST_URI' => '/foo'
));
@@ -286,7 +286,7 @@ class ServerPreconditionsTest extends \PHPUnit_Framework_TestCase {
$root = new SimpleCollection('root',array(new ServerPreconditionsNode()));
$server = new Server($root);
- $httpRequest = HTTP\Request::createFromServerArray(array(
+ $httpRequest = HTTP\Sapi::createFromServerArray(array(
'HTTP_IF_MODIFIED_SINCE' => 'Your mother',
'REQUEST_URI' => '/foo'
));
@@ -305,7 +305,7 @@ class ServerPreconditionsTest extends \PHPUnit_Framework_TestCase {
$root = new SimpleCollection('root',array(new ServerPreconditionsNode()));
$server = new Server($root);
- $httpRequest = HTTP\Request::createFromServerArray(array(
+ $httpRequest = HTTP\Sapi::createFromServerArray(array(
'HTTP_IF_MODIFIED_SINCE' => 'Sun, 06 Nov 1994 08:49:37 EST',
'REQUEST_URI' => '/foo'
));
@@ -323,7 +323,7 @@ class ServerPreconditionsTest extends \PHPUnit_Framework_TestCase {
$root = new SimpleCollection('root',array(new ServerPreconditionsNode()));
$server = new Server($root);
- $httpRequest = HTTP\Request::createFromServerArray(array(
+ $httpRequest = HTTP\Sapi::createFromServerArray(array(
'HTTP_IF_UNMODIFIED_SINCE' => 'Sun, 06 Nov 1994 08:49:37 GMT',
'REQUEST_URI' => '/foo'
));
@@ -341,7 +341,7 @@ class ServerPreconditionsTest extends \PHPUnit_Framework_TestCase {
$root = new SimpleCollection('root',array(new ServerPreconditionsNode()));
$server = new Server($root);
- $httpRequest = HTTP\Request::createFromServerArray(array(
+ $httpRequest = HTTP\Sapi::createFromServerArray(array(
'HTTP_IF_UNMODIFIED_SINCE' => 'Tue, 06 Nov 1984 08:49:37 GMT',
'REQUEST_URI' => '/foo'
));
@@ -358,7 +358,7 @@ class ServerPreconditionsTest extends \PHPUnit_Framework_TestCase {
$root = new SimpleCollection('root',array(new ServerPreconditionsNode()));
$server = new Server($root);
- $httpRequest = HTTP\Request::createFromServerArray(array(
+ $httpRequest = HTTP\Sapi::createFromServerArray(array(
'HTTP_IF_UNMODIFIED_SINCE' => 'Sun, 06 Nov 1984 08:49:37 CET',
'REQUEST_URI' => '/foo'
));
diff --git a/tests/Sabre/DAV/ServerPropsTest.php b/tests/Sabre/DAV/ServerPropsTest.php
index 643aa18..ff373b0 100644
--- a/tests/Sabre/DAV/ServerPropsTest.php
+++ b/tests/Sabre/DAV/ServerPropsTest.php
@@ -40,7 +40,7 @@ class ServerPropsTest extends AbstractServer {
'HTTP_DEPTH' => '0',
);
- $request = HTTP\Request::createFromServerArray($serverVars);
+ $request = HTTP\Sapi::createFromServerArray($serverVars);
$request->setBody($body);
$this->server->httpRequest = ($request);
@@ -67,7 +67,7 @@ class ServerPropsTest extends AbstractServer {
$this->assertTrue($hasFired);
- $this->assertEquals('207 Multi-Status',$this->response->status);
+ $this->assertEquals(207, $this->response->status);
$this->assertEquals(array(
'Content-Type' => 'application/xml; charset=utf-8',
@@ -316,7 +316,7 @@ class ServerPropsTest extends AbstractServer {
<d:set><d:prop><s:someprop>somevalue</s:someprop></d:prop></d:set>
</d:propertyupdate>';
- $request = HTTP\Request::createFromServerArray($serverVars);
+ $request = HTTP\Sapi::createFromServerArray($serverVars);
$request->setBody($body);
$this->server->httpRequest = ($request);
@@ -329,7 +329,7 @@ class ServerPropsTest extends AbstractServer {
$this->response->headers
);
- $this->assertEquals('207 Multi-Status',$this->response->status,'We got the wrong status. Full XML response: ' . $this->response->body);
+ $this->assertEquals(207, $this->response->status,'We got the wrong status. Full XML response: ' . $this->response->body);
$body = preg_replace("/xmlns(:[A-Za-z0-9_])?=(\"|\')DAV:(\"|\')/","xmlns\\1=\"urn:DAV\"",$this->response->body);
$xml = simplexml_load_string($body);
diff --git a/tests/Sabre/DAV/ServerRangeTest.php b/tests/Sabre/DAV/ServerRangeTest.php
index 396b651..0035ebd 100644
--- a/tests/Sabre/DAV/ServerRangeTest.php
+++ b/tests/Sabre/DAV/ServerRangeTest.php
@@ -21,7 +21,7 @@ class ServerRangeTest extends AbstractServer{
'HTTP_RANGE' => 'bytes=2-5',
);
- $request = HTTP\Request::createFromServerArray($serverVars);
+ $request = HTTP\Sapi::createFromServerArray($serverVars);
$this->server->httpRequest = ($request);
$this->server->exec();
@@ -35,7 +35,7 @@ class ServerRangeTest extends AbstractServer{
$this->response->headers
);
- $this->assertEquals('206 Partial Content',$this->response->status);
+ $this->assertEquals(206, $this->response->status);
$this->assertEquals('st c', stream_get_contents($this->response->body));
}
@@ -51,7 +51,7 @@ class ServerRangeTest extends AbstractServer{
'HTTP_RANGE' => 'bytes=2-',
);
- $request = HTTP\Request::createFromServerArray($serverVars);
+ $request = HTTP\Sapi::createFromServerArray($serverVars);
$this->server->httpRequest = ($request);
$this->server->exec();
@@ -65,7 +65,7 @@ class ServerRangeTest extends AbstractServer{
$this->response->headers
);
- $this->assertEquals('206 Partial Content',$this->response->status);
+ $this->assertEquals(206, $this->response->status);
$this->assertEquals('st contents', stream_get_contents($this->response->body));
}
@@ -81,7 +81,7 @@ class ServerRangeTest extends AbstractServer{
'HTTP_RANGE' => 'bytes=-8',
);
- $request = HTTP\Request::createFromServerArray($serverVars);
+ $request = HTTP\Sapi::createFromServerArray($serverVars);
$this->server->httpRequest = ($request);
$this->server->exec();
@@ -95,7 +95,7 @@ class ServerRangeTest extends AbstractServer{
$this->response->headers
);
- $this->assertEquals('206 Partial Content',$this->response->status);
+ $this->assertEquals(206, $this->response->status);
$this->assertEquals('contents', stream_get_contents($this->response->body));
}
@@ -111,11 +111,11 @@ class ServerRangeTest extends AbstractServer{
'HTTP_RANGE' => 'bytes=100-200',
);
- $request = HTTP\Request::createFromServerArray($serverVars);
+ $request = HTTP\Sapi::createFromServerArray($serverVars);
$this->server->httpRequest = ($request);
$this->server->exec();
- $this->assertEquals('416 Requested Range Not Satisfiable',$this->response->status);
+ $this->assertEquals(416, $this->response->status);
}
@@ -130,11 +130,11 @@ class ServerRangeTest extends AbstractServer{
'HTTP_RANGE' => 'bytes=8-4',
);
- $request = HTTP\Request::createFromServerArray($serverVars);
+ $request = HTTP\Sapi::createFromServerArray($serverVars);
$this->server->httpRequest = ($request);
$this->server->exec();
- $this->assertEquals('416 Requested Range Not Satisfiable',$this->response->status);
+ $this->assertEquals(416, $this->response->status);
}
@@ -152,7 +152,7 @@ class ServerRangeTest extends AbstractServer{
'HTTP_IF_RANGE' => $node->getETag(),
);
- $request = HTTP\Request::createFromServerArray($serverVars);
+ $request = HTTP\Sapi::createFromServerArray($serverVars);
$this->server->httpRequest = ($request);
$this->server->exec();
@@ -166,7 +166,7 @@ class ServerRangeTest extends AbstractServer{
$this->response->headers
);
- $this->assertEquals('206 Partial Content',$this->response->status);
+ $this->assertEquals(206, $this->response->status);
$this->assertEquals('st c', stream_get_contents($this->response->body));
}
@@ -185,7 +185,7 @@ class ServerRangeTest extends AbstractServer{
'HTTP_IF_RANGE' => $node->getETag() . 'blabla',
);
- $request = HTTP\Request::createFromServerArray($serverVars);
+ $request = HTTP\Sapi::createFromServerArray($serverVars);
$this->server->httpRequest = ($request);
$this->server->exec();
@@ -198,7 +198,7 @@ class ServerRangeTest extends AbstractServer{
$this->response->headers
);
- $this->assertEquals('200 OK',$this->response->status);
+ $this->assertEquals(200, $this->response->status);
$this->assertEquals('Test contents', stream_get_contents($this->response->body));
}
@@ -217,7 +217,7 @@ class ServerRangeTest extends AbstractServer{
'HTTP_IF_RANGE' => 'tomorrow',
);
- $request = HTTP\Request::createFromServerArray($serverVars);
+ $request = HTTP\Sapi::createFromServerArray($serverVars);
$this->server->httpRequest = ($request);
$this->server->exec();
@@ -231,7 +231,7 @@ class ServerRangeTest extends AbstractServer{
$this->response->headers
);
- $this->assertEquals('206 Partial Content',$this->response->status);
+ $this->assertEquals(206, $this->response->status);
$this->assertEquals('st c', stream_get_contents($this->response->body));
}
@@ -250,7 +250,7 @@ class ServerRangeTest extends AbstractServer{
'HTTP_IF_RANGE' => '-2 years',
);
- $request = HTTP\Request::createFromServerArray($serverVars);
+ $request = HTTP\Sapi::createFromServerArray($serverVars);
$this->server->httpRequest = ($request);
$this->server->exec();
@@ -263,7 +263,7 @@ class ServerRangeTest extends AbstractServer{
$this->response->headers
);
- $this->assertEquals('200 OK',$this->response->status);
+ $this->assertEquals(200, $this->response->status);
$this->assertEquals('Test contents', stream_get_contents($this->response->body));
}
diff --git a/tests/Sabre/DAV/ServerSimpleTest.php b/tests/Sabre/DAV/ServerSimpleTest.php
index ca816b3..1ef1e63 100644
--- a/tests/Sabre/DAV/ServerSimpleTest.php
+++ b/tests/Sabre/DAV/ServerSimpleTest.php
@@ -51,7 +51,7 @@ class ServerSimpleTest extends AbstractServer{
'REQUEST_METHOD' => 'GET',
);
- $request = HTTP\Request::createFromServerArray($serverVars);
+ $request = HTTP\Sapi::createFromServerArray($serverVars);
$this->server->httpRequest = ($request);
$this->server->exec();
@@ -63,7 +63,7 @@ class ServerSimpleTest extends AbstractServer{
$this->response->headers
);
- $this->assertEquals('200 OK',$this->response->status);
+ $this->assertEquals(200, $this->response->status);
$this->assertEquals('Test contents', stream_get_contents($this->response->body));
}
@@ -75,7 +75,7 @@ class ServerSimpleTest extends AbstractServer{
'SERVER_PROTOCOL' => 'HTTP/1.0',
);
- $request = HTTP\Request::createFromServerArray($serverVars);
+ $request = HTTP\Sapi::createFromServerArray($serverVars);
$this->server->httpRequest = ($request);
$this->server->exec();
@@ -87,7 +87,7 @@ class ServerSimpleTest extends AbstractServer{
$this->response->headers
);
- $this->assertEquals('200 OK',$this->response->status);
+ $this->assertEquals(200, $this->response->status);
$this->assertEquals('1.0', $this->response->getHttpVersion());
$this->assertEquals('Test contents', stream_get_contents($this->response->body));
@@ -100,10 +100,10 @@ class ServerSimpleTest extends AbstractServer{
'REQUEST_METHOD' => 'GET',
);
- $request = HTTP\Request::createFromServerArray($serverVars);
+ $request = HTTP\Sapi::createFromServerArray($serverVars);
$this->server->httpRequest = ($request);
$this->server->exec();
- $this->assertEquals('404 Not Found',$this->response->status);
+ $this->assertEquals(404, $this->response->status);
}
@@ -114,10 +114,10 @@ class ServerSimpleTest extends AbstractServer{
'REQUEST_METHOD' => 'GET',
);
- $request = HTTP\Request::createFromServerArray($serverVars);
+ $request = HTTP\Sapi::createFromServerArray($serverVars);
$this->server->httpRequest = ($request);
$this->server->exec();
- $this->assertEquals('404 Not Found',$this->response->status);
+ $this->assertEquals(404, $this->response->status);
}
@@ -134,7 +134,7 @@ class ServerSimpleTest extends AbstractServer{
'REQUEST_METHOD' => 'GET',
);
- $request = HTTP\Request::createFromServerArray($serverVars);
+ $request = HTTP\Sapi::createFromServerArray($serverVars);
$this->server->httpRequest = ($request);
$this->server->exec();
@@ -146,7 +146,7 @@ class ServerSimpleTest extends AbstractServer{
$this->response->headers
);
- $this->assertEquals('200 OK',$this->response->status);
+ $this->assertEquals(200, $this->response->status);
$this->assertEquals('Test contents', stream_get_contents($this->response->body));
}
@@ -159,7 +159,7 @@ class ServerSimpleTest extends AbstractServer{
'REQUEST_METHOD' => 'HEAD',
);
- $request = HTTP\Request::createFromServerArray($serverVars);
+ $request = HTTP\Sapi::createFromServerArray($serverVars);
$this->server->httpRequest = ($request);
$this->server->exec();
@@ -171,7 +171,7 @@ class ServerSimpleTest extends AbstractServer{
$this->response->headers
);
- $this->assertEquals('200 OK',$this->response->status);
+ $this->assertEquals(200, $this->response->status);
$this->assertEquals('', $this->response->body);
}
@@ -183,13 +183,13 @@ class ServerSimpleTest extends AbstractServer{
'REQUEST_METHOD' => 'PUT',
);
- $request = HTTP\Request::createFromServerArray($serverVars);
+ $request = HTTP\Sapi::createFromServerArray($serverVars);
$request->setBody('Testing new file');
$this->server->httpRequest = ($request);
$this->server->exec();
$this->assertEquals('', $this->response->body);
- $this->assertEquals('201 Created',$this->response->status);
+ $this->assertEquals(201, $this->response->status);
$this->assertEquals(array(
"Content-Length" => "0",
), $this->response->headers);
@@ -206,7 +206,7 @@ class ServerSimpleTest extends AbstractServer{
'HTTP_IF_NONE_MATCH' => '*',
);
- $request = HTTP\Request::createFromServerArray($serverVars);
+ $request = HTTP\Sapi::createFromServerArray($serverVars);
$request->setBody('Testing new file');
$this->server->httpRequest = ($request);
$this->server->exec();
@@ -215,7 +215,7 @@ class ServerSimpleTest extends AbstractServer{
'Content-Type' => 'application/xml; charset=utf-8',
),$this->response->headers);
- $this->assertEquals('412 Precondition failed',$this->response->status);
+ $this->assertEquals(412, $this->response->status);
$this->assertNotEquals('Testing new file',file_get_contents($this->tempDir . '/test.txt'));
}
@@ -227,14 +227,14 @@ class ServerSimpleTest extends AbstractServer{
'REQUEST_METHOD' => 'PUT',
);
- $request = HTTP\Request::createFromServerArray($serverVars);
+ $request = HTTP\Sapi::createFromServerArray($serverVars);
$request->setBody('Testing updated file');
$this->server->httpRequest = ($request);
$this->server->exec();
$this->assertEquals('0', $this->response->headers['Content-Length']);
- $this->assertEquals('204 No Content',$this->response->status);
+ $this->assertEquals(204, $this->response->status);
$this->assertEquals('', $this->response->body);
$this->assertEquals('Testing updated file',file_get_contents($this->tempDir . '/test.txt'));
@@ -247,12 +247,12 @@ class ServerSimpleTest extends AbstractServer{
'REQUEST_METHOD' => 'PUT',
);
- $request = HTTP\Request::createFromServerArray($serverVars);
+ $request = HTTP\Sapi::createFromServerArray($serverVars);
$request->setBody('Testing updated file');
$this->server->httpRequest = ($request);
$this->server->exec();
- $this->assertEquals('409 Conflict',$this->response->status);
+ $this->assertEquals(409, $this->response->status);
}
@@ -264,12 +264,12 @@ class ServerSimpleTest extends AbstractServer{
'HTTP_CONTENT_RANGE' => 'bytes/100-200',
);
- $request = HTTP\Request::createFromServerArray($serverVars);
+ $request = HTTP\Sapi::createFromServerArray($serverVars);
$request->setBody('Testing new file');
$this->server->httpRequest = ($request);
$this->server->exec();
- $this->assertEquals('501 Not Implemented',$this->response->status);
+ $this->assertEquals(501, $this->response->status);
}
@@ -281,7 +281,7 @@ class ServerSimpleTest extends AbstractServer{
'REQUEST_METHOD' => 'DELETE',
);
- $request = HTTP\Request::createFromServerArray($serverVars);
+ $request = HTTP\Sapi::createFromServerArray($serverVars);
$this->server->httpRequest = ($request);
$this->server->exec();
@@ -289,7 +289,7 @@ class ServerSimpleTest extends AbstractServer{
'Content-Length' => '0',
),$this->response->headers);
- $this->assertEquals('204 No Content',$this->response->status);
+ $this->assertEquals(204, $this->response->status);
$this->assertEquals('', $this->response->body);
$this->assertFalse(file_exists($this->tempDir . '/test.txt'));
@@ -305,14 +305,14 @@ class ServerSimpleTest extends AbstractServer{
mkdir($this->tempDir.'/testcol');
file_put_contents($this->tempDir.'/testcol/test.txt','Hi! I\'m a file with a short lifespan');
- $request = HTTP\Request::createFromServerArray($serverVars);
+ $request = HTTP\Sapi::createFromServerArray($serverVars);
$this->server->httpRequest = ($request);
$this->server->exec();
$this->assertEquals(array(
'Content-Length' => '0',
),$this->response->headers);
- $this->assertEquals('204 No Content',$this->response->status);
+ $this->assertEquals(204, $this->response->status);
$this->assertEquals('', $this->response->body);
$this->assertFalse(file_exists($this->tempDir . '/col'));
@@ -325,7 +325,7 @@ class ServerSimpleTest extends AbstractServer{
'REQUEST_METHOD' => 'OPTIONS',
);
- $request = HTTP\Request::createFromServerArray($serverVars);
+ $request = HTTP\Sapi::createFromServerArray($serverVars);
$this->server->httpRequest = ($request);
$this->server->exec();
@@ -338,7 +338,7 @@ class ServerSimpleTest extends AbstractServer{
'X-Sabre-Version' => Version::VERSION,
),$this->response->headers);
- $this->assertEquals('200 OK',$this->response->status);
+ $this->assertEquals(200, $this->response->status);
$this->assertEquals('', $this->response->body);
@@ -350,7 +350,7 @@ class ServerSimpleTest extends AbstractServer{
'REQUEST_METHOD' => 'BLABLA',
);
- $request = HTTP\Request::createFromServerArray($serverVars);
+ $request = HTTP\Sapi::createFromServerArray($serverVars);
$this->server->httpRequest = ($request);
$this->server->exec();
@@ -358,7 +358,7 @@ class ServerSimpleTest extends AbstractServer{
'Content-Type' => 'application/xml; charset=utf-8',
),$this->response->headers);
- $this->assertEquals('501 Not Implemented',$this->response->status);
+ $this->assertEquals(501, $this->response->status);
}
@@ -370,7 +370,7 @@ class ServerSimpleTest extends AbstractServer{
'REQUEST_METHOD' => 'GET',
);
- $request = HTTP\Request::createFromServerArray($serverVars);
+ $request = HTTP\Sapi::createFromServerArray($serverVars);
$this->server->httpRequest = ($request);
$this->server->exec();
@@ -378,7 +378,7 @@ class ServerSimpleTest extends AbstractServer{
'Content-Type' => 'application/xml; charset=utf-8',
),$this->response->headers);
- $this->assertEquals('501 Not Implemented',$this->response->status);
+ $this->assertEquals(501, $this->response->status);
}
@@ -389,11 +389,11 @@ class ServerSimpleTest extends AbstractServer{
'REQUEST_METHOD' => 'HEAD',
);
- $request = HTTP\Request::createFromServerArray($serverVars);
+ $request = HTTP\Sapi::createFromServerArray($serverVars);
$this->server->httpRequest = ($request);
$this->server->exec();
- $this->assertEquals('200 OK',$this->response->status);
+ $this->assertEquals(200, $this->response->status);
}
@@ -404,7 +404,7 @@ class ServerSimpleTest extends AbstractServer{
'REQUEST_METHOD' => 'GET',
);
- $request = HTTP\Request::createFromServerArray($serverVars);
+ $request = HTTP\Sapi::createFromServerArray($serverVars);
$this->server->setBaseUri('/blabla/');
$this->assertEquals('/blabla/',$this->server->getBaseUri());
$this->server->httpRequest = ($request);
@@ -418,7 +418,7 @@ class ServerSimpleTest extends AbstractServer{
$this->response->headers
);
- $this->assertEquals('200 OK',$this->response->status);
+ $this->assertEquals(200, $this->response->status);
$this->assertEquals('Test contents', stream_get_contents($this->response->body));
}
@@ -532,7 +532,7 @@ class ServerSimpleTest extends AbstractServer{
'PATH_INFO' => '/root',
);
- $httpRequest = HTTP\Request::createFromServerArray($serverVars);
+ $httpRequest = HTTP\Sapi::createFromServerArray($serverVars);
$server = new Server();
$server->httpRequest = $httpRequest;
@@ -551,7 +551,7 @@ class ServerSimpleTest extends AbstractServer{
'PATH_INFO' => '/dir/path2/path with spaces',
);
- $httpRequest = HTTP\Request::createFromServerArray($serverVars);
+ $httpRequest = HTTP\Sapi::createFromServerArray($serverVars);
$server = new Server();
$server->httpRequest = $httpRequest;
@@ -572,7 +572,7 @@ class ServerSimpleTest extends AbstractServer{
'PATH_INFO' => '/dir/path2/path with spaces',
);
- $httpRequest = HTTP\Request::createFromServerArray($serverVars);
+ $httpRequest = HTTP\Sapi::createFromServerArray($serverVars);
$server = new Server();
$server->httpRequest = $httpRequest;
@@ -587,7 +587,7 @@ class ServerSimpleTest extends AbstractServer{
'PATH_INFO' => '/root/',
);
- $httpRequest = HTTP\Request::createFromServerArray($serverVars);
+ $httpRequest = HTTP\Sapi::createFromServerArray($serverVars);
$server = new Server();
$server->httpRequest = $httpRequest;
@@ -601,7 +601,7 @@ class ServerSimpleTest extends AbstractServer{
'REQUEST_URI' => '/index.php/root',
);
- $httpRequest = HTTP\Request::createFromServerArray($serverVars);
+ $httpRequest = HTTP\Sapi::createFromServerArray($serverVars);
$server = new Server();
$server->httpRequest = $httpRequest;
@@ -615,7 +615,7 @@ class ServerSimpleTest extends AbstractServer{
'REQUEST_URI' => '/a/b/c/test.php',
);
- $httpRequest = HTTP\Request::createFromServerArray($serverVars);
+ $httpRequest = HTTP\Sapi::createFromServerArray($serverVars);
$server = new Server();
$server->httpRequest = $httpRequest;
@@ -635,7 +635,7 @@ class ServerSimpleTest extends AbstractServer{
'PATH_INFO' => '/root',
);
- $httpRequest = HTTP\Request::createFromServerArray($serverVars);
+ $httpRequest = HTTP\Sapi::createFromServerArray($serverVars);
$server = new Server();
$server->httpRequest = $httpRequest;
@@ -655,7 +655,7 @@ class ServerSimpleTest extends AbstractServer{
'PATH_INFO' => '/root',
);
- $httpRequest = HTTP\Request::createFromServerArray($serverVars);
+ $httpRequest = HTTP\Sapi::createFromServerArray($serverVars);
$server = new Server();
$server->httpRequest = $httpRequest;
@@ -670,7 +670,7 @@ class ServerSimpleTest extends AbstractServer{
'REQUEST_METHOD' => 'FOO',
);
- $httpRequest = HTTP\Request::createFromServerArray($serverVars);
+ $httpRequest = HTTP\Sapi::createFromServerArray($serverVars);
$this->server->httpRequest = $httpRequest;
$this->server->on('beforeMethod', [$this,'exceptionTrigger']);
$this->server->exec();
@@ -679,7 +679,7 @@ class ServerSimpleTest extends AbstractServer{
'Content-Type' => 'application/xml; charset=utf-8',
),$this->response->headers);
- $this->assertEquals('500 Internal Server Error',$this->response->status);
+ $this->assertEquals(500, $this->response->status);
}
@@ -696,7 +696,7 @@ class ServerSimpleTest extends AbstractServer{
'REQUEST_METHOD' => 'REPORT',
);
- $request = HTTP\Request::createFromServerArray($serverVars);
+ $request = HTTP\Sapi::createFromServerArray($serverVars);
$this->server->httpRequest = ($request);
$this->server->httpRequest->setBody('<?xml version="1.0"?><bla:myreport xmlns:bla="http://www.rooftopsolutions.nl/NS"></bla:myreport>');
$this->server->exec();
@@ -707,7 +707,7 @@ class ServerSimpleTest extends AbstractServer{
$this->response->headers
);
- $this->assertEquals('403 Forbidden',$this->response->status,'We got an incorrect status back. Full response body follows: ' . $this->response->body);
+ $this->assertEquals(403, $this->response->status,'We got an incorrect status back. Full response body follows: ' . $this->response->body);
}
@@ -718,7 +718,7 @@ class ServerSimpleTest extends AbstractServer{
'REQUEST_METHOD' => 'REPORT',
);
- $request = HTTP\Request::createFromServerArray($serverVars);
+ $request = HTTP\Sapi::createFromServerArray($serverVars);
$this->server->httpRequest = ($request);
$this->server->httpRequest->setBody('<?xml version="1.0"?><bla:myreport xmlns:bla="http://www.rooftopsolutions.nl/NS"></bla:myreport>');
$this->server->on('report', [$this,'reportHandler']);
@@ -730,7 +730,7 @@ class ServerSimpleTest extends AbstractServer{
$this->response->headers
);
- $this->assertEquals('418 I\'m a teapot',$this->response->status,'We got an incorrect status back. Full response body follows: ' . $this->response->body);
+ $this->assertEquals(418, $this->response->status,'We got an incorrect status back. Full response body follows: ' . $this->response->body);
}
diff --git a/tests/Sabre/DAV/Sync/PluginTest.php b/tests/Sabre/DAV/Sync/PluginTest.php
index 561e111..534600a 100644
--- a/tests/Sabre/DAV/Sync/PluginTest.php
+++ b/tests/Sabre/DAV/Sync/PluginTest.php
@@ -69,7 +69,7 @@ class PluginTest extends \Sabre\DAVServerTest {
// Making a change
$this->collection->addChange(['file1.txt'], [], []);
- $request = HTTP\Request::createFromServerArray([
+ $request = HTTP\Sapi::createFromServerArray([
'REQUEST_METHOD' => 'REPORT',
'REQUEST_URI' => '/coll/',
'CONTENT_TYPE' => 'application/xml',
@@ -90,7 +90,7 @@ BLA;
$response = $this->request($request);
- $this->assertEquals('207 Multi-Status', $response->status, 'Full response body:' . $response->body);
+ $this->assertEquals(207, $response->status, 'Full response body:' . $response->body);
$dom = DAV\XMLUtil::loadDOMDocument(
$response->body
@@ -139,7 +139,7 @@ BLA;
// Making another change
$this->collection->addChange([], ['file2.txt'], ['file3.txt']);
- $request = HTTP\Request::createFromServerArray([
+ $request = HTTP\Sapi::createFromServerArray([
'REQUEST_METHOD' => 'REPORT',
'REQUEST_URI' => '/coll/',
'CONTENT_TYPE' => 'application/xml',
@@ -160,7 +160,7 @@ BLA;
$response = $this->request($request);
- $this->assertEquals('207 Multi-Status', $response->status, 'Full response body:' . $response->body);
+ $this->assertEquals(207, $response->status, 'Full response body:' . $response->body);
$dom = DAV\XMLUtil::loadDOMDocument(
$response->body
@@ -205,7 +205,7 @@ BLA;
// Making another change
$this->collection->addChange([], ['file2.txt'], ['file3.txt']);
- $request = HTTP\Request::createFromServerArray([
+ $request = HTTP\Sapi::createFromServerArray([
'REQUEST_METHOD' => 'REPORT',
'REQUEST_URI' => '/coll/',
'CONTENT_TYPE' => 'application/xml',
@@ -227,7 +227,7 @@ BLA;
$response = $this->request($request);
- $this->assertEquals('207 Multi-Status', $response->status, 'Full response body:' . $response->body);
+ $this->assertEquals(207, $response->status, 'Full response body:' . $response->body);
$dom = DAV\XMLUtil::loadDOMDocument(
$response->body
@@ -262,7 +262,7 @@ BLA;
// Making another change
$this->collection->addChange([], ['file2.txt'], ['file3.txt']);
- $request = HTTP\Request::createFromServerArray([
+ $request = HTTP\Sapi::createFromServerArray([
'REQUEST_METHOD' => 'REPORT',
'REQUEST_URI' => '/coll/',
'CONTENT_TYPE' => 'application/xml',
@@ -283,7 +283,7 @@ BLA;
$response = $this->request($request);
- $this->assertEquals('207 Multi-Status', $response->status, 'Full response body:' . $response->body);
+ $this->assertEquals(207, $response->status, 'Full response body:' . $response->body);
$dom = DAV\XMLUtil::loadDOMDocument(
$response->body
@@ -323,7 +323,7 @@ BLA;
public function testSyncNoSyncInfo() {
- $request = HTTP\Request::createFromServerArray([
+ $request = HTTP\Sapi::createFromServerArray([
'REQUEST_METHOD' => 'REPORT',
'REQUEST_URI' => '/coll/',
'CONTENT_TYPE' => 'application/xml',
@@ -346,13 +346,13 @@ BLA;
// The default state has no sync-token, so this report should not yet
// be supported.
- $this->assertEquals('403 Forbidden', $response->status, 'Full response body:' . $response->body);
+ $this->assertEquals(403, $response->status, 'Full response body:' . $response->body);
}
public function testSyncNoSyncCollection() {
- $request = HTTP\Request::createFromServerArray([
+ $request = HTTP\Sapi::createFromServerArray([
'REQUEST_METHOD' => 'REPORT',
'REQUEST_URI' => '/normalcoll/',
'CONTENT_TYPE' => 'application/xml',
@@ -375,14 +375,14 @@ BLA;
// The default state has no sync-token, so this report should not yet
// be supported.
- $this->assertEquals('403 Forbidden', $response->status, 'Full response body:' . $response->body);
+ $this->assertEquals(403, $response->status, 'Full response body:' . $response->body);
}
public function testSyncInvalidToken() {
$this->collection->addChange(['file1.txt'], [], []);
- $request = HTTP\Request::createFromServerArray([
+ $request = HTTP\Sapi::createFromServerArray([
'REQUEST_METHOD' => 'REPORT',
'REQUEST_URI' => '/coll/',
'CONTENT_TYPE' => 'application/xml',
@@ -405,13 +405,13 @@ BLA;
// The default state has no sync-token, so this report should not yet
// be supported.
- $this->assertEquals('403 Forbidden', $response->status, 'Full response body:' . $response->body);
+ $this->assertEquals(403, $response->status, 'Full response body:' . $response->body);
}
public function testSyncInvalidTokenNoPrefix() {
$this->collection->addChange(['file1.txt'], [], []);
- $request = HTTP\Request::createFromServerArray([
+ $request = HTTP\Sapi::createFromServerArray([
'REQUEST_METHOD' => 'REPORT',
'REQUEST_URI' => '/coll/',
'CONTENT_TYPE' => 'application/xml',
@@ -434,13 +434,13 @@ BLA;
// The default state has no sync-token, so this report should not yet
// be supported.
- $this->assertEquals('403 Forbidden', $response->status, 'Full response body:' . $response->body);
+ $this->assertEquals(403, $response->status, 'Full response body:' . $response->body);
}
public function testSyncNoSyncToken() {
- $request = HTTP\Request::createFromServerArray([
+ $request = HTTP\Sapi::createFromServerArray([
'REQUEST_METHOD' => 'REPORT',
'REQUEST_URI' => '/coll/',
'CONTENT_TYPE' => 'application/xml',
@@ -462,14 +462,14 @@ BLA;
// The default state has no sync-token, so this report should not yet
// be supported.
- $this->assertEquals('400 Bad request', $response->status, 'Full response body:' . $response->body);
+ $this->assertEquals(400, $response->status, 'Full response body:' . $response->body);
}
public function testSyncNoProp() {
$this->collection->addChange(['file1.txt'], [], []);
- $request = HTTP\Request::createFromServerArray([
+ $request = HTTP\Sapi::createFromServerArray([
'REQUEST_METHOD' => 'REPORT',
'REQUEST_URI' => '/coll/',
'CONTENT_TYPE' => 'application/xml',
@@ -489,14 +489,14 @@ BLA;
// The default state has no sync-token, so this report should not yet
// be supported.
- $this->assertEquals('400 Bad request', $response->status, 'Full response body:' . $response->body);
+ $this->assertEquals(400, $response->status, 'Full response body:' . $response->body);
}
public function testIfConditions() {
$this->collection->addChange(['file1.txt'], [], []);
- $request = HTTP\Request::createFromServerArray([
+ $request = HTTP\Sapi::createFromServerArray([
'REQUEST_METHOD' => 'DELETE',
'REQUEST_URI' => '/coll/file1.txt',
'HTTP_IF' => '</coll> (<http://sabredav.org/ns/sync/1>)',
@@ -506,14 +506,14 @@ BLA;
// If a 403 is thrown this works correctly. The file in questions
// doesn't allow itself to be deleted.
// If the If conditions failed, it would have been a 412 instead.
- $this->assertEquals('403 Forbidden', $response->status);
+ $this->assertEquals(403, $response->status);
}
public function testIfConditionsNot() {
$this->collection->addChange(['file1.txt'], [], []);
- $request = HTTP\Request::createFromServerArray([
+ $request = HTTP\Sapi::createFromServerArray([
'REQUEST_METHOD' => 'DELETE',
'REQUEST_URI' => '/coll/file1.txt',
'HTTP_IF' => '</coll> (Not <http://sabredav.org/ns/sync/2>)',
@@ -523,21 +523,21 @@ BLA;
// If a 403 is thrown this works correctly. The file in questions
// doesn't allow itself to be deleted.
// If the If conditions failed, it would have been a 412 instead.
- $this->assertEquals('403 Forbidden', $response->status);
+ $this->assertEquals(403, $response->status);
}
public function testIfConditionsNoSyncToken() {
$this->collection->addChange(['file1.txt'], [], []);
- $request = HTTP\Request::createFromServerArray([
+ $request = HTTP\Sapi::createFromServerArray([
'REQUEST_METHOD' => 'DELETE',
'REQUEST_URI' => '/coll/file1.txt',
'HTTP_IF' => '</coll> (<opaquelocktoken:foo>)',
]);
$response = $this->request($request);
- $this->assertEquals('412 Precondition failed', $response->status);
+ $this->assertEquals(412, $response->status);
}
}
diff --git a/tests/Sabre/DAV/TemporaryFileFilterTest.php b/tests/Sabre/DAV/TemporaryFileFilterTest.php
index 6048153..cce9c24 100644
--- a/tests/Sabre/DAV/TemporaryFileFilterTest.php
+++ b/tests/Sabre/DAV/TemporaryFileFilterTest.php
@@ -21,13 +21,13 @@ class TemporaryFileFilterTest extends AbstractServer {
'REQUEST_METHOD' => 'PUT',
);
- $request = HTTP\Request::createFromServerArray($serverVars);
+ $request = HTTP\Sapi::createFromServerArray($serverVars);
$request->setBody('Testing new file');
$this->server->httpRequest = ($request);
$this->server->exec();
$this->assertEquals('', $this->response->body);
- $this->assertEquals('201 Created',$this->response->status);
+ $this->assertEquals(201, $this->response->status);
$this->assertEquals('0', $this->response->headers['Content-Length']);
$this->assertEquals('Testing new file',file_get_contents(SABRE_TEMPDIR . '/testput.txt'));
@@ -42,13 +42,13 @@ class TemporaryFileFilterTest extends AbstractServer {
'REQUEST_METHOD' => 'PUT',
);
- $request = HTTP\Request::createFromServerArray($serverVars);
+ $request = HTTP\Sapi::createFromServerArray($serverVars);
$request->setBody('Testing new file');
$this->server->httpRequest = ($request);
$this->server->exec();
$this->assertEquals('', $this->response->body);
- $this->assertEquals('201 Created',$this->response->status);
+ $this->assertEquals(201, $this->response->status);
$this->assertEquals(array(
'X-Sabre-Temp' => 'true',
),$this->response->headers);
@@ -66,13 +66,13 @@ class TemporaryFileFilterTest extends AbstractServer {
'HTTP_IF_NONE_MATCH' => '*',
);
- $request = HTTP\Request::createFromServerArray($serverVars);
+ $request = HTTP\Sapi::createFromServerArray($serverVars);
$request->setBody('Testing new file');
$this->server->httpRequest = ($request);
$this->server->exec();
$this->assertEquals('', $this->response->body);
- $this->assertEquals('201 Created',$this->response->status);
+ $this->assertEquals(201, $this->response->status);
$this->assertEquals(array(
'X-Sabre-Temp' => 'true',
),$this->response->headers);
@@ -82,7 +82,7 @@ class TemporaryFileFilterTest extends AbstractServer {
$this->server->exec();
- $this->assertEquals('412 Precondition failed',$this->response->status);
+ $this->assertEquals(412, $this->response->status);
$this->assertEquals(array(
'X-Sabre-Temp' => 'true',
'Content-Type' => 'application/xml; charset=utf-8',
@@ -98,13 +98,13 @@ class TemporaryFileFilterTest extends AbstractServer {
'REQUEST_METHOD' => 'PUT',
);
- $request = HTTP\Request::createFromServerArray($serverVars);
+ $request = HTTP\Sapi::createFromServerArray($serverVars);
$request->setBody('Testing new file');
$this->server->httpRequest = ($request);
$this->server->exec();
$this->assertEquals('', $this->response->body);
- $this->assertEquals('201 Created',$this->response->status);
+ $this->assertEquals(201, $this->response->status);
$this->assertEquals(array(
'X-Sabre-Temp' => 'true',
),$this->response->headers);
@@ -114,11 +114,11 @@ class TemporaryFileFilterTest extends AbstractServer {
'REQUEST_METHOD' => 'GET',
);
- $request = HTTP\Request::createFromServerArray($serverVars);
+ $request = HTTP\Sapi::createFromServerArray($serverVars);
$this->server->httpRequest = ($request);
$this->server->exec();
- $this->assertEquals('200 OK',$this->response->status);
+ $this->assertEquals(200, $this->response->status);
$this->assertEquals(array(
'X-Sabre-Temp' => 'true',
'Content-Length' => 16,
@@ -142,7 +142,7 @@ class TemporaryFileFilterTest extends AbstractServer {
'REQUEST_METHOD' => 'LOCK',
);
- $request = HTTP\Request::createFromServerArray($serverVars);
+ $request = HTTP\Sapi::createFromServerArray($serverVars);
$request->setBody('<?xml version="1.0"?>
<D:lockinfo xmlns:D="DAV:">
@@ -156,7 +156,7 @@ class TemporaryFileFilterTest extends AbstractServer {
$this->server->httpRequest = ($request);
$this->server->exec();
- $this->assertEquals('201 Created',$this->response->status);
+ $this->assertEquals(201, $this->response->status);
$this->assertEquals('application/xml; charset=utf-8',$this->response->headers['Content-Type']);
$this->assertTrue(preg_match('/^<opaquelocktoken:(.*)>$/',$this->response->headers['Lock-Token'])===1,'We did not get a valid Locktoken back (' . $this->response->headers['Lock-Token'] . ')');
$this->assertEquals('true',$this->response->headers['X-Sabre-Temp']);
@@ -173,13 +173,13 @@ class TemporaryFileFilterTest extends AbstractServer {
'REQUEST_METHOD' => 'PUT',
);
- $request = HTTP\Request::createFromServerArray($serverVars);
+ $request = HTTP\Sapi::createFromServerArray($serverVars);
$request->setBody('Testing new file');
$this->server->httpRequest = ($request);
$this->server->exec();
$this->assertEquals('', $this->response->body);
- $this->assertEquals('201 Created',$this->response->status);
+ $this->assertEquals(201, $this->response->status);
$this->assertEquals(array(
'X-Sabre-Temp' => 'true',
),$this->response->headers);
@@ -189,11 +189,11 @@ class TemporaryFileFilterTest extends AbstractServer {
'REQUEST_METHOD' => 'DELETE',
);
- $request = HTTP\Request::createFromServerArray($serverVars);
+ $request = HTTP\Sapi::createFromServerArray($serverVars);
$this->server->httpRequest = ($request);
$this->server->exec();
- $this->assertEquals('204 No Content',$this->response->status, "Incorrect status code received. Full body:\n". $this->response->body);
+ $this->assertEquals(204, $this->response->status, "Incorrect status code received. Full body:\n". $this->response->body);
$this->assertEquals(array(
'X-Sabre-Temp' => 'true',
),$this->response->headers);
@@ -210,13 +210,13 @@ class TemporaryFileFilterTest extends AbstractServer {
'REQUEST_METHOD' => 'PUT',
);
- $request = HTTP\Request::createFromServerArray($serverVars);
+ $request = HTTP\Sapi::createFromServerArray($serverVars);
$request->setBody('Testing new file');
$this->server->httpRequest = ($request);
$this->server->exec();
$this->assertEquals('', $this->response->body);
- $this->assertEquals('201 Created',$this->response->status);
+ $this->assertEquals(201, $this->response->status);
$this->assertEquals(array(
'X-Sabre-Temp' => 'true',
),$this->response->headers);
@@ -226,12 +226,12 @@ class TemporaryFileFilterTest extends AbstractServer {
'REQUEST_METHOD' => 'PROPFIND',
);
- $request = HTTP\Request::createFromServerArray($serverVars);
+ $request = HTTP\Sapi::createFromServerArray($serverVars);
$request->setBody('');
$this->server->httpRequest = ($request);
$this->server->exec();
- $this->assertEquals('207 Multi-Status',$this->response->status,'Incorrect status code returned. Body: ' . $this->response->body);
+ $this->assertEquals(207, $this->response->status,'Incorrect status code returned. Body: ' . $this->response->body);
$this->assertEquals(array(
'X-Sabre-Temp' => 'true',
'Content-Type' => 'application/xml; charset=utf-8',
diff --git a/tests/Sabre/DAVACL/ExpandPropertiesTest.php b/tests/Sabre/DAVACL/ExpandPropertiesTest.php
index bc518ed..9ee6e0d 100644
--- a/tests/Sabre/DAVACL/ExpandPropertiesTest.php
+++ b/tests/Sabre/DAVACL/ExpandPropertiesTest.php
@@ -58,7 +58,7 @@ class ExpandPropertiesTest extends \PHPUnit_Framework_TestCase {
'REQUEST_URI' => '/node1',
);
- $request = HTTP\Request::createFromServerArray($serverVars);
+ $request = HTTP\Sapi::createFromServerArray($serverVars);
$request->setBody($xml);
$server = $this->getServer();
@@ -66,7 +66,7 @@ class ExpandPropertiesTest extends \PHPUnit_Framework_TestCase {
$server->exec();
- $this->assertEquals('207 Multi-Status', $server->httpResponse->status,'Incorrect status code received. Full body: ' . $server->httpResponse->body);
+ $this->assertEquals(207, $server->httpResponse->status,'Incorrect status code received. Full body: ' . $server->httpResponse->body);
$this->assertEquals(array(
'Content-Type' => 'application/xml; charset=utf-8',
), $server->httpResponse->headers);
@@ -120,7 +120,7 @@ class ExpandPropertiesTest extends \PHPUnit_Framework_TestCase {
'REQUEST_URI' => '/node1',
);
- $request = HTTP\Request::createFromServerArray($serverVars);
+ $request = HTTP\Sapi::createFromServerArray($serverVars);
$request->setBody($xml);
$server = $this->getServer();
@@ -128,7 +128,7 @@ class ExpandPropertiesTest extends \PHPUnit_Framework_TestCase {
$server->exec();
- $this->assertEquals('207 Multi-Status', $server->httpResponse->status, 'Incorrect response status received. Full response body: ' . $server->httpResponse->body);
+ $this->assertEquals(207, $server->httpResponse->status, 'Incorrect response status received. Full response body: ' . $server->httpResponse->body);
$this->assertEquals(array(
'Content-Type' => 'application/xml; charset=utf-8',
), $server->httpResponse->headers);
@@ -184,7 +184,7 @@ class ExpandPropertiesTest extends \PHPUnit_Framework_TestCase {
'REQUEST_URI' => '/node2',
);
- $request = HTTP\Request::createFromServerArray($serverVars);
+ $request = HTTP\Sapi::createFromServerArray($serverVars);
$request->setBody($xml);
$server = $this->getServer();
@@ -192,7 +192,7 @@ class ExpandPropertiesTest extends \PHPUnit_Framework_TestCase {
$server->exec();
- $this->assertEquals('207 Multi-Status', $server->httpResponse->status);
+ $this->assertEquals(207, $server->httpResponse->status);
$this->assertEquals(array(
'Content-Type' => 'application/xml; charset=utf-8',
), $server->httpResponse->headers);
@@ -251,7 +251,7 @@ class ExpandPropertiesTest extends \PHPUnit_Framework_TestCase {
'REQUEST_URI' => '/node2',
);
- $request = HTTP\Request::createFromServerArray($serverVars);
+ $request = HTTP\Sapi::createFromServerArray($serverVars);
$request->setBody($xml);
$server = $this->getServer();
@@ -259,7 +259,7 @@ class ExpandPropertiesTest extends \PHPUnit_Framework_TestCase {
$server->exec();
- $this->assertEquals('207 Multi-Status', $server->httpResponse->status);
+ $this->assertEquals(207, $server->httpResponse->status);
$this->assertEquals(array(
'Content-Type' => 'application/xml; charset=utf-8',
), $server->httpResponse->headers);
diff --git a/tests/Sabre/DAVACL/PluginAdminTest.php b/tests/Sabre/DAVACL/PluginAdminTest.php
index 1bb1f46..f257832 100644
--- a/tests/Sabre/DAVACL/PluginAdminTest.php
+++ b/tests/Sabre/DAVACL/PluginAdminTest.php
@@ -26,7 +26,7 @@ class PluginAdminTest extends \PHPUnit_Framework_TestCase {
$plugin = new Plugin();
$fakeServer->addPlugin($plugin);
- $request = HTTP\Request::createFromServerArray(array(
+ $request = HTTP\Sapi::createFromServerArray(array(
'REQUEST_METHOD' => 'OPTIONS',
'HTTP_DEPTH' => 1,
'REQUEST_URI' => '/adminonly',
@@ -39,7 +39,7 @@ class PluginAdminTest extends \PHPUnit_Framework_TestCase {
$fakeServer->exec();
- $this->assertEquals('403 Forbidden', $response->status);
+ $this->assertEquals(403, $response->status);
}
@@ -64,7 +64,7 @@ class PluginAdminTest extends \PHPUnit_Framework_TestCase {
);
$fakeServer->addPlugin($plugin);
- $request = HTTP\Request::createFromServerArray(array(
+ $request = HTTP\Sapi::createFromServerArray(array(
'REQUEST_METHOD' => 'OPTIONS',
'HTTP_DEPTH' => 1,
'REQUEST_URI' => '/adminonly',
@@ -77,7 +77,7 @@ class PluginAdminTest extends \PHPUnit_Framework_TestCase {
$fakeServer->exec();
- $this->assertEquals('200 OK', $response->status);
+ $this->assertEquals(200, $response->status);
}
}
diff --git a/tests/Sabre/DAVACL/PrincipalPropertySearchTest.php b/tests/Sabre/DAVACL/PrincipalPropertySearchTest.php
index b953114..1989946 100644
--- a/tests/Sabre/DAVACL/PrincipalPropertySearchTest.php
+++ b/tests/Sabre/DAVACL/PrincipalPropertySearchTest.php
@@ -53,7 +53,7 @@ class PrincipalPropertySearchTest extends \PHPUnit_Framework_TestCase {
'REQUEST_URI' => '/principals',
);
- $request = HTTP\Request::createFromServerArray($serverVars);
+ $request = HTTP\Sapi::createFromServerArray($serverVars);
$request->setBody($xml);
$server = $this->getServer();
@@ -61,7 +61,7 @@ class PrincipalPropertySearchTest extends \PHPUnit_Framework_TestCase {
$server->exec();
- $this->assertEquals('400 Bad request', $server->httpResponse->status);
+ $this->assertEquals(400, $server->httpResponse->status);
$this->assertEquals(array(
'Content-Type' => 'application/xml; charset=utf-8',
), $server->httpResponse->headers);
@@ -91,7 +91,7 @@ class PrincipalPropertySearchTest extends \PHPUnit_Framework_TestCase {
'REQUEST_URI' => '/principals',
);
- $request = HTTP\Request::createFromServerArray($serverVars);
+ $request = HTTP\Sapi::createFromServerArray($serverVars);
$request->setBody($xml);
$server = $this->getServer();
@@ -99,7 +99,7 @@ class PrincipalPropertySearchTest extends \PHPUnit_Framework_TestCase {
$server->exec();
- $this->assertEquals('207 Multi-Status', $server->httpResponse->status);
+ $this->assertEquals(207, $server->httpResponse->status);
$this->assertEquals(array(
'Content-Type' => 'application/xml; charset=utf-8',
'Vary' => 'Brief,Prefer',
@@ -130,7 +130,7 @@ class PrincipalPropertySearchTest extends \PHPUnit_Framework_TestCase {
'REQUEST_URI' => '/',
);
- $request = HTTP\Request::createFromServerArray($serverVars);
+ $request = HTTP\Sapi::createFromServerArray($serverVars);
$request->setBody($xml);
$server = $this->getServer();
@@ -138,7 +138,7 @@ class PrincipalPropertySearchTest extends \PHPUnit_Framework_TestCase {
$server->exec();
- $this->assertEquals('207 Multi-Status', $server->httpResponse->status, $server->httpResponse->body);
+ $this->assertEquals(207, $server->httpResponse->status, $server->httpResponse->body);
$this->assertEquals(array(
'Content-Type' => 'application/xml; charset=utf-8',
'Vary' => 'Brief,Prefer',
@@ -194,7 +194,7 @@ class PrincipalPropertySearchTest extends \PHPUnit_Framework_TestCase {
'REQUEST_URI' => '/',
);
- $request = HTTP\Request::createFromServerArray($serverVars);
+ $request = HTTP\Sapi::createFromServerArray($serverVars);
$request->setBody($xml);
$server = $this->getServer();
@@ -202,7 +202,7 @@ class PrincipalPropertySearchTest extends \PHPUnit_Framework_TestCase {
$server->exec();
- $this->assertEquals('207 Multi-Status', $server->httpResponse->status, $server->httpResponse->body);
+ $this->assertEquals(207, $server->httpResponse->status, $server->httpResponse->body);
$this->assertEquals(array(
'Content-Type' => 'application/xml; charset=utf-8',
'Vary' => 'Brief,Prefer',
diff --git a/tests/Sabre/DAVACL/PrincipalSearchPropertySetTest.php b/tests/Sabre/DAVACL/PrincipalSearchPropertySetTest.php
index b076118..4fb2446 100644
--- a/tests/Sabre/DAVACL/PrincipalSearchPropertySetTest.php
+++ b/tests/Sabre/DAVACL/PrincipalSearchPropertySetTest.php
@@ -39,7 +39,7 @@ class PrincipalSearchPropertySetTest extends \PHPUnit_Framework_TestCase {
'REQUEST_URI' => '/principals',
);
- $request = HTTP\Request::createFromServerArray($serverVars);
+ $request = HTTP\Sapi::createFromServerArray($serverVars);
$request->setBody($xml);
$server = $this->getServer();
@@ -47,7 +47,7 @@ class PrincipalSearchPropertySetTest extends \PHPUnit_Framework_TestCase {
$server->exec();
- $this->assertEquals('400 Bad request', $server->httpResponse->status);
+ $this->assertEquals(400, $server->httpResponse->status);
$this->assertEquals(array(
'Content-Type' => 'application/xml; charset=utf-8',
), $server->httpResponse->headers);
@@ -65,7 +65,7 @@ class PrincipalSearchPropertySetTest extends \PHPUnit_Framework_TestCase {
'REQUEST_URI' => '/principals',
);
- $request = HTTP\Request::createFromServerArray($serverVars);
+ $request = HTTP\Sapi::createFromServerArray($serverVars);
$request->setBody($xml);
$server = $this->getServer();
@@ -73,7 +73,7 @@ class PrincipalSearchPropertySetTest extends \PHPUnit_Framework_TestCase {
$server->exec();
- $this->assertEquals('400 Bad request', $server->httpResponse->status, $server->httpResponse->body);
+ $this->assertEquals(400, $server->httpResponse->status, $server->httpResponse->body);
$this->assertEquals(array(
'Content-Type' => 'application/xml; charset=utf-8',
), $server->httpResponse->headers);
@@ -91,7 +91,7 @@ class PrincipalSearchPropertySetTest extends \PHPUnit_Framework_TestCase {
'REQUEST_URI' => '/principals',
);
- $request = HTTP\Request::createFromServerArray($serverVars);
+ $request = HTTP\Sapi::createFromServerArray($serverVars);
$request->setBody($xml);
$server = $this->getServer();
@@ -99,7 +99,7 @@ class PrincipalSearchPropertySetTest extends \PHPUnit_Framework_TestCase {
$server->exec();
- $this->assertEquals('200 OK', $server->httpResponse->status, $server->httpResponse->body);
+ $this->assertEquals(200, $server->httpResponse->status, $server->httpResponse->body);
$this->assertEquals(array(
'Content-Type' => 'application/xml; charset=utf-8',
), $server->httpResponse->headers);
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/php-sabredav.git
More information about the Pkg-owncloud-commits
mailing list