From 66effbfe0827fc61fff6d248797a894213ad20d6 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Sat, 28 May 2016 17:46:24 +0200 Subject: upgrade to sabre32 --- .../tests/Sabre/DAVACL/ExpandPropertiesTest.php | 206 ++++++++++----------- 1 file changed, 103 insertions(+), 103 deletions(-) (limited to 'vendor/sabre/dav/tests/Sabre/DAVACL/ExpandPropertiesTest.php') diff --git a/vendor/sabre/dav/tests/Sabre/DAVACL/ExpandPropertiesTest.php b/vendor/sabre/dav/tests/Sabre/DAVACL/ExpandPropertiesTest.php index 5e99f2e73..0612b5474 100644 --- a/vendor/sabre/dav/tests/Sabre/DAVACL/ExpandPropertiesTest.php +++ b/vendor/sabre/dav/tests/Sabre/DAVACL/ExpandPropertiesTest.php @@ -11,31 +11,31 @@ class ExpandPropertiesTest extends \PHPUnit_Framework_TestCase { function getServer() { - $tree = array( - new DAV\Mock\PropertiesCollection('node1', [], array( + $tree = [ + new DAV\Mock\PropertiesCollection('node1', [], [ '{http://sabredav.org/ns}simple' => 'foo', '{http://sabredav.org/ns}href' => new DAV\Xml\Property\Href('node2'), - '{DAV:}displayname' => 'Node 1', - )), - new DAV\Mock\PropertiesCollection('node2', [], array( + '{DAV:}displayname' => 'Node 1', + ]), + new DAV\Mock\PropertiesCollection('node2', [], [ + '{http://sabredav.org/ns}simple' => 'simple', + '{http://sabredav.org/ns}hreflist' => new DAV\Xml\Property\Href(['node1', 'node3']), + '{DAV:}displayname' => 'Node 2', + ]), + new DAV\Mock\PropertiesCollection('node3', [], [ '{http://sabredav.org/ns}simple' => 'simple', - '{http://sabredav.org/ns}hreflist' => new DAV\Xml\Property\Href(['node1','node3']), - '{DAV:}displayname' => 'Node 2', - )), - new DAV\Mock\PropertiesCollection('node3', [], array( - '{http://sabredav.org/ns}simple' => 'simple', - '{DAV:}displayname' => 'Node 3', - )), - ); + '{DAV:}displayname' => 'Node 3', + ]), + ]; $fakeServer = new DAV\Server($tree); $fakeServer->sapi = new HTTP\SapiMock(); $fakeServer->debugExceptions = true; $fakeServer->httpResponse = new HTTP\ResponseMock(); $plugin = new Plugin(); - $plugin->allowAccessToNodesWithoutACL = true; - + $plugin->allowUnauthenticatedAccess = false; $this->assertTrue($plugin instanceof Plugin); + $fakeServer->addPlugin($plugin); $this->assertEquals($plugin, $fakeServer->getPlugin('acl')); @@ -53,11 +53,11 @@ class ExpandPropertiesTest extends \PHPUnit_Framework_TestCase { '; - $serverVars = array( + $serverVars = [ 'REQUEST_METHOD' => 'REPORT', 'HTTP_DEPTH' => '0', 'REQUEST_URI' => '/node1', - ); + ]; $request = HTTP\Sapi::createFromServerArray($serverVars); $request->setBody($xml); @@ -67,38 +67,38 @@ class ExpandPropertiesTest extends \PHPUnit_Framework_TestCase { $server->exec(); - $this->assertEquals(207, $server->httpResponse->status,'Incorrect status code received. Full body: ' . $server->httpResponse->body); - $this->assertEquals(array( + $this->assertEquals(207, $server->httpResponse->status, 'Incorrect status code received. Full body: ' . $server->httpResponse->body); + $this->assertEquals([ 'X-Sabre-Version' => [DAV\Version::VERSION], - 'Content-Type' => ['application/xml; charset=utf-8'], - ), $server->httpResponse->getHeaders()); + 'Content-Type' => ['application/xml; charset=utf-8'], + ], $server->httpResponse->getHeaders()); - $check = array( + $check = [ '/d:multistatus', - '/d:multistatus/d:response' => 1, - '/d:multistatus/d:response/d:href' => 1, - '/d:multistatus/d:response/d:propstat' => 2, - '/d:multistatus/d:response/d:propstat/d:prop' => 2, + '/d:multistatus/d:response' => 1, + '/d:multistatus/d:response/d:href' => 1, + '/d:multistatus/d:response/d:propstat' => 2, + '/d:multistatus/d:response/d:propstat/d:prop' => 2, '/d:multistatus/d:response/d:propstat/d:prop/d:displayname' => 1, - '/d:multistatus/d:response/d:propstat/d:prop/s:simple' => 1, - '/d:multistatus/d:response/d:propstat/d:prop/s:href' => 1, + '/d:multistatus/d:response/d:propstat/d:prop/s:simple' => 1, + '/d:multistatus/d:response/d:propstat/d:prop/s:href' => 1, '/d:multistatus/d:response/d:propstat/d:prop/s:href/d:href' => 1, - ); + ]; $xml = simplexml_load_string($server->httpResponse->body); - $xml->registerXPathNamespace('d','DAV:'); - $xml->registerXPathNamespace('s','http://sabredav.org/ns'); - foreach($check as $v1=>$v2) { + $xml->registerXPathNamespace('d', 'DAV:'); + $xml->registerXPathNamespace('s', 'http://sabredav.org/ns'); + foreach ($check as $v1 => $v2) { - $xpath = is_int($v1)?$v2:$v1; + $xpath = is_int($v1) ? $v2 : $v1; $result = $xml->xpath($xpath); $count = 1; if (!is_int($v1)) $count = $v2; - $this->assertEquals($count,count($result), 'we expected ' . $count . ' appearances of ' . $xpath . ' . We found ' . count($result) . '. Full response: ' . $server->httpResponse->body); + $this->assertEquals($count, count($result), 'we expected ' . $count . ' appearances of ' . $xpath . ' . We found ' . count($result) . '. Full response: ' . $server->httpResponse->body); } @@ -116,11 +116,11 @@ class ExpandPropertiesTest extends \PHPUnit_Framework_TestCase { '; - $serverVars = array( + $serverVars = [ 'REQUEST_METHOD' => 'REPORT', 'HTTP_DEPTH' => '0', 'REQUEST_URI' => '/node1', - ); + ]; $request = HTTP\Sapi::createFromServerArray($serverVars); $request->setBody($xml); @@ -131,39 +131,39 @@ class ExpandPropertiesTest extends \PHPUnit_Framework_TestCase { $server->exec(); $this->assertEquals(207, $server->httpResponse->status, 'Incorrect response status received. Full response body: ' . $server->httpResponse->body); - $this->assertEquals(array( + $this->assertEquals([ 'X-Sabre-Version' => [DAV\Version::VERSION], - 'Content-Type' => ['application/xml; charset=utf-8'], - ), $server->httpResponse->getHeaders()); + 'Content-Type' => ['application/xml; charset=utf-8'], + ], $server->httpResponse->getHeaders()); - $check = array( + $check = [ '/d:multistatus', - '/d:multistatus/d:response' => 1, - '/d:multistatus/d:response/d:href' => 1, - '/d:multistatus/d:response/d:propstat' => 1, - '/d:multistatus/d:response/d:propstat/d:prop' => 1, - '/d:multistatus/d:response/d:propstat/d:prop/s:href' => 1, - '/d:multistatus/d:response/d:propstat/d:prop/s:href/d:response' => 1, - '/d:multistatus/d:response/d:propstat/d:prop/s:href/d:response/d:href' => 1, - '/d:multistatus/d:response/d:propstat/d:prop/s:href/d:response/d:propstat' => 1, - '/d:multistatus/d:response/d:propstat/d:prop/s:href/d:response/d:propstat/d:prop' => 1, + '/d:multistatus/d:response' => 1, + '/d:multistatus/d:response/d:href' => 1, + '/d:multistatus/d:response/d:propstat' => 1, + '/d:multistatus/d:response/d:propstat/d:prop' => 1, + '/d:multistatus/d:response/d:propstat/d:prop/s:href' => 1, + '/d:multistatus/d:response/d:propstat/d:prop/s:href/d:response' => 1, + '/d:multistatus/d:response/d:propstat/d:prop/s:href/d:response/d:href' => 1, + '/d:multistatus/d:response/d:propstat/d:prop/s:href/d:response/d:propstat' => 1, + '/d:multistatus/d:response/d:propstat/d:prop/s:href/d:response/d:propstat/d:prop' => 1, '/d:multistatus/d:response/d:propstat/d:prop/s:href/d:response/d:propstat/d:prop/d:displayname' => 1, - ); + ]; $xml = simplexml_load_string($server->httpResponse->body); - $xml->registerXPathNamespace('d','DAV:'); - $xml->registerXPathNamespace('s','http://sabredav.org/ns'); - foreach($check as $v1=>$v2) { + $xml->registerXPathNamespace('d', 'DAV:'); + $xml->registerXPathNamespace('s', 'http://sabredav.org/ns'); + foreach ($check as $v1 => $v2) { - $xpath = is_int($v1)?$v2:$v1; + $xpath = is_int($v1) ? $v2 : $v1; $result = $xml->xpath($xpath); $count = 1; if (!is_int($v1)) $count = $v2; - $this->assertEquals($count,count($result), 'we expected ' . $count . ' appearances of ' . $xpath . ' . We found ' . count($result) . ' Full response body: ' . $server->httpResponse->getBodyAsString()); + $this->assertEquals($count, count($result), 'we expected ' . $count . ' appearances of ' . $xpath . ' . We found ' . count($result) . ' Full response body: ' . $server->httpResponse->getBodyAsString()); } @@ -181,11 +181,11 @@ class ExpandPropertiesTest extends \PHPUnit_Framework_TestCase { '; - $serverVars = array( + $serverVars = [ 'REQUEST_METHOD' => 'REPORT', 'HTTP_DEPTH' => '0', 'REQUEST_URI' => '/node2', - ); + ]; $request = HTTP\Sapi::createFromServerArray($serverVars); $request->setBody($xml); @@ -196,39 +196,39 @@ class ExpandPropertiesTest extends \PHPUnit_Framework_TestCase { $server->exec(); $this->assertEquals(207, $server->httpResponse->status); - $this->assertEquals(array( + $this->assertEquals([ 'X-Sabre-Version' => [DAV\Version::VERSION], - 'Content-Type' => ['application/xml; charset=utf-8'], - ), $server->httpResponse->getHeaders()); + 'Content-Type' => ['application/xml; charset=utf-8'], + ], $server->httpResponse->getHeaders()); - $check = array( + $check = [ '/d:multistatus', - '/d:multistatus/d:response' => 1, - '/d:multistatus/d:response/d:href' => 1, - '/d:multistatus/d:response/d:propstat' => 1, - '/d:multistatus/d:response/d:propstat/d:prop' => 1, - '/d:multistatus/d:response/d:propstat/d:prop/s:hreflist' => 1, - '/d:multistatus/d:response/d:propstat/d:prop/s:hreflist/d:response' => 2, - '/d:multistatus/d:response/d:propstat/d:prop/s:hreflist/d:response/d:href' => 2, - '/d:multistatus/d:response/d:propstat/d:prop/s:hreflist/d:response/d:propstat' => 2, - '/d:multistatus/d:response/d:propstat/d:prop/s:hreflist/d:response/d:propstat/d:prop' => 2, + '/d:multistatus/d:response' => 1, + '/d:multistatus/d:response/d:href' => 1, + '/d:multistatus/d:response/d:propstat' => 1, + '/d:multistatus/d:response/d:propstat/d:prop' => 1, + '/d:multistatus/d:response/d:propstat/d:prop/s:hreflist' => 1, + '/d:multistatus/d:response/d:propstat/d:prop/s:hreflist/d:response' => 2, + '/d:multistatus/d:response/d:propstat/d:prop/s:hreflist/d:response/d:href' => 2, + '/d:multistatus/d:response/d:propstat/d:prop/s:hreflist/d:response/d:propstat' => 2, + '/d:multistatus/d:response/d:propstat/d:prop/s:hreflist/d:response/d:propstat/d:prop' => 2, '/d:multistatus/d:response/d:propstat/d:prop/s:hreflist/d:response/d:propstat/d:prop/d:displayname' => 2, - ); + ]; $xml = simplexml_load_string($server->httpResponse->body); - $xml->registerXPathNamespace('d','DAV:'); - $xml->registerXPathNamespace('s','http://sabredav.org/ns'); - foreach($check as $v1=>$v2) { + $xml->registerXPathNamespace('d', 'DAV:'); + $xml->registerXPathNamespace('s', 'http://sabredav.org/ns'); + foreach ($check as $v1 => $v2) { - $xpath = is_int($v1)?$v2:$v1; + $xpath = is_int($v1) ? $v2 : $v1; $result = $xml->xpath($xpath); $count = 1; if (!is_int($v1)) $count = $v2; - $this->assertEquals($count,count($result), 'we expected ' . $count . ' appearances of ' . $xpath . ' . We found ' . count($result)); + $this->assertEquals($count, count($result), 'we expected ' . $count . ' appearances of ' . $xpath . ' . We found ' . count($result)); } @@ -249,11 +249,11 @@ class ExpandPropertiesTest extends \PHPUnit_Framework_TestCase { '; - $serverVars = array( + $serverVars = [ 'REQUEST_METHOD' => 'REPORT', 'HTTP_DEPTH' => '0', 'REQUEST_URI' => '/node2', - ); + ]; $request = HTTP\Sapi::createFromServerArray($serverVars); $request->setBody($xml); @@ -264,45 +264,45 @@ class ExpandPropertiesTest extends \PHPUnit_Framework_TestCase { $server->exec(); $this->assertEquals(207, $server->httpResponse->status); - $this->assertEquals(array( + $this->assertEquals([ 'X-Sabre-Version' => [DAV\Version::VERSION], - 'Content-Type' => ['application/xml; charset=utf-8'], - ), $server->httpResponse->getHeaders()); + 'Content-Type' => ['application/xml; charset=utf-8'], + ], $server->httpResponse->getHeaders()); - $check = array( + $check = [ '/d:multistatus', - '/d:multistatus/d:response' => 1, - '/d:multistatus/d:response/d:href' => 1, - '/d:multistatus/d:response/d:propstat' => 1, - '/d:multistatus/d:response/d:propstat/d:prop' => 1, - '/d:multistatus/d:response/d:propstat/d:prop/s:hreflist' => 1, - '/d:multistatus/d:response/d:propstat/d:prop/s:hreflist/d:response' => 2, - '/d:multistatus/d:response/d:propstat/d:prop/s:hreflist/d:response/d:href' => 2, - '/d:multistatus/d:response/d:propstat/d:prop/s:hreflist/d:response/d:propstat' => 3, - '/d:multistatus/d:response/d:propstat/d:prop/s:hreflist/d:response/d:propstat/d:prop' => 3, - '/d:multistatus/d:response/d:propstat/d:prop/s:hreflist/d:response/d:propstat/d:prop/d:displayname' => 2, - '/d:multistatus/d:response/d:propstat/d:prop/s:hreflist/d:response/d:propstat/d:prop/s:href' => 2, - '/d:multistatus/d:response/d:propstat/d:prop/s:hreflist/d:response/d:propstat/d:prop/s:href/d:response' => 1, - '/d:multistatus/d:response/d:propstat/d:prop/s:hreflist/d:response/d:propstat/d:prop/s:href/d:response/d:href' => 1, - '/d:multistatus/d:response/d:propstat/d:prop/s:hreflist/d:response/d:propstat/d:prop/s:href/d:response/d:propstat' => 1, - '/d:multistatus/d:response/d:propstat/d:prop/s:hreflist/d:response/d:propstat/d:prop/s:href/d:response/d:propstat/d:prop' => 1, + '/d:multistatus/d:response' => 1, + '/d:multistatus/d:response/d:href' => 1, + '/d:multistatus/d:response/d:propstat' => 1, + '/d:multistatus/d:response/d:propstat/d:prop' => 1, + '/d:multistatus/d:response/d:propstat/d:prop/s:hreflist' => 1, + '/d:multistatus/d:response/d:propstat/d:prop/s:hreflist/d:response' => 2, + '/d:multistatus/d:response/d:propstat/d:prop/s:hreflist/d:response/d:href' => 2, + '/d:multistatus/d:response/d:propstat/d:prop/s:hreflist/d:response/d:propstat' => 3, + '/d:multistatus/d:response/d:propstat/d:prop/s:hreflist/d:response/d:propstat/d:prop' => 3, + '/d:multistatus/d:response/d:propstat/d:prop/s:hreflist/d:response/d:propstat/d:prop/d:displayname' => 2, + '/d:multistatus/d:response/d:propstat/d:prop/s:hreflist/d:response/d:propstat/d:prop/s:href' => 2, + '/d:multistatus/d:response/d:propstat/d:prop/s:hreflist/d:response/d:propstat/d:prop/s:href/d:response' => 1, + '/d:multistatus/d:response/d:propstat/d:prop/s:hreflist/d:response/d:propstat/d:prop/s:href/d:response/d:href' => 1, + '/d:multistatus/d:response/d:propstat/d:prop/s:hreflist/d:response/d:propstat/d:prop/s:href/d:response/d:propstat' => 1, + '/d:multistatus/d:response/d:propstat/d:prop/s:hreflist/d:response/d:propstat/d:prop/s:href/d:response/d:propstat/d:prop' => 1, '/d:multistatus/d:response/d:propstat/d:prop/s:hreflist/d:response/d:propstat/d:prop/s:href/d:response/d:propstat/d:prop/d:displayname' => 1, - ); + ]; $xml = simplexml_load_string($server->httpResponse->body); - $xml->registerXPathNamespace('d','DAV:'); - $xml->registerXPathNamespace('s','http://sabredav.org/ns'); - foreach($check as $v1=>$v2) { + $xml->registerXPathNamespace('d', 'DAV:'); + $xml->registerXPathNamespace('s', 'http://sabredav.org/ns'); + foreach ($check as $v1 => $v2) { - $xpath = is_int($v1)?$v2:$v1; + $xpath = is_int($v1) ? $v2 : $v1; $result = $xml->xpath($xpath); $count = 1; if (!is_int($v1)) $count = $v2; - $this->assertEquals($count,count($result), 'we expected ' . $count . ' appearances of ' . $xpath . ' . We found ' . count($result)); + $this->assertEquals($count, count($result), 'we expected ' . $count . ' appearances of ' . $xpath . ' . We found ' . count($result)); } -- cgit v1.2.3