From 0b02a6d123b2014705998c94ddf3d460948d3eac Mon Sep 17 00:00:00 2001 From: redmatrix Date: Tue, 10 May 2016 17:26:44 -0700 Subject: initial sabre upgrade (needs lots of work - to wit: authentication, redo the browser interface, and rework event export/import) --- .../DAVACL/PrincipalSearchPropertySetTest.php | 32 ++++++++++++---------- 1 file changed, 18 insertions(+), 14 deletions(-) (limited to 'vendor/sabre/dav/tests/Sabre/DAVACL/PrincipalSearchPropertySetTest.php') diff --git a/vendor/sabre/dav/tests/Sabre/DAVACL/PrincipalSearchPropertySetTest.php b/vendor/sabre/dav/tests/Sabre/DAVACL/PrincipalSearchPropertySetTest.php index 412389e8b..952dc174a 100644 --- a/vendor/sabre/dav/tests/Sabre/DAVACL/PrincipalSearchPropertySetTest.php +++ b/vendor/sabre/dav/tests/Sabre/DAVACL/PrincipalSearchPropertySetTest.php @@ -17,9 +17,10 @@ class PrincipalSearchPropertySetTest extends \PHPUnit_Framework_TestCase { $principals = new PrincipalCollection($backend); $dir->addChild($principals); - $fakeServer = new DAV\Server(new DAV\ObjectTree($dir)); + $fakeServer = new DAV\Server($dir); + $fakeServer->sapi = new HTTP\SapiMock(); $fakeServer->httpResponse = new HTTP\ResponseMock(); - $plugin = new Plugin($backend,'realm'); + $plugin = new Plugin(); $this->assertTrue($plugin instanceof Plugin); $fakeServer->addPlugin($plugin); $this->assertEquals($plugin, $fakeServer->getPlugin('acl')); @@ -39,7 +40,7 @@ class PrincipalSearchPropertySetTest extends \PHPUnit_Framework_TestCase { 'REQUEST_URI' => '/principals', ); - $request = new HTTP\Request($serverVars); + $request = HTTP\Sapi::createFromServerArray($serverVars); $request->setBody($xml); $server = $this->getServer(); @@ -47,10 +48,11 @@ class PrincipalSearchPropertySetTest extends \PHPUnit_Framework_TestCase { $server->exec(); - $this->assertEquals('HTTP/1.1 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); + 'X-Sabre-Version' => [DAV\Version::VERSION], + 'Content-Type' => ['application/xml; charset=utf-8'], + ), $server->httpResponse->getHeaders()); } @@ -65,7 +67,7 @@ class PrincipalSearchPropertySetTest extends \PHPUnit_Framework_TestCase { 'REQUEST_URI' => '/principals', ); - $request = new HTTP\Request($serverVars); + $request = HTTP\Sapi::createFromServerArray($serverVars); $request->setBody($xml); $server = $this->getServer(); @@ -73,10 +75,11 @@ class PrincipalSearchPropertySetTest extends \PHPUnit_Framework_TestCase { $server->exec(); - $this->assertEquals('HTTP/1.1 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); + 'X-Sabre-Version' => [DAV\Version::VERSION], + 'Content-Type' => ['application/xml; charset=utf-8'], + ), $server->httpResponse->getHeaders()); } @@ -91,7 +94,7 @@ class PrincipalSearchPropertySetTest extends \PHPUnit_Framework_TestCase { 'REQUEST_URI' => '/principals', ); - $request = new HTTP\Request($serverVars); + $request = HTTP\Sapi::createFromServerArray($serverVars); $request->setBody($xml); $server = $this->getServer(); @@ -99,10 +102,11 @@ class PrincipalSearchPropertySetTest extends \PHPUnit_Framework_TestCase { $server->exec(); - $this->assertEquals('HTTP/1.1 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); + 'X-Sabre-Version' => [DAV\Version::VERSION], + 'Content-Type' => ['application/xml; charset=utf-8'], + ), $server->httpResponse->getHeaders()); $check = array( -- cgit v1.2.3