From 580c3f4ffe9608d2beb56d418c68b3b112420e76 Mon Sep 17 00:00:00 2001 From: Mario Date: Sun, 10 Nov 2019 12:49:51 +0000 Subject: another bulk of composer updates (cherry picked from commit 6685381fd8db507493c3d7c1793f8c05c681bbce) --- .../DAVACL/PrincipalSearchPropertySetTest.php | 62 ++++++++++------------ 1 file changed, 29 insertions(+), 33 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 fa1314d10..04f168f92 100644 --- a/vendor/sabre/dav/tests/Sabre/DAVACL/PrincipalSearchPropertySetTest.php +++ b/vendor/sabre/dav/tests/Sabre/DAVACL/PrincipalSearchPropertySetTest.php @@ -1,5 +1,7 @@ assertEquals($plugin, $fakeServer->getPlugin('acl')); return $fakeServer; - } - function testDepth1() { - + public function testDepth1() + { $xml = ' '; $serverVars = [ 'REQUEST_METHOD' => 'REPORT', - 'HTTP_DEPTH' => '1', - 'REQUEST_URI' => '/principals', + 'HTTP_DEPTH' => '1', + 'REQUEST_URI' => '/principals', ]; $request = HTTP\Sapi::createFromServerArray($serverVars); @@ -52,20 +53,19 @@ class PrincipalSearchPropertySetTest extends \PHPUnit_Framework_TestCase { $this->assertEquals(400, $server->httpResponse->status); $this->assertEquals([ 'X-Sabre-Version' => [DAV\Version::VERSION], - 'Content-Type' => ['application/xml; charset=utf-8'], + 'Content-Type' => ['application/xml; charset=utf-8'], ], $server->httpResponse->getHeaders()); - } - function testDepthIncorrectXML() { - + public function testDepthIncorrectXML() + { $xml = ' '; $serverVars = [ 'REQUEST_METHOD' => 'REPORT', - 'HTTP_DEPTH' => '0', - 'REQUEST_URI' => '/principals', + 'HTTP_DEPTH' => '0', + 'REQUEST_URI' => '/principals', ]; $request = HTTP\Sapi::createFromServerArray($serverVars); @@ -79,20 +79,19 @@ class PrincipalSearchPropertySetTest extends \PHPUnit_Framework_TestCase { $this->assertEquals(400, $server->httpResponse->status, $server->httpResponse->body); $this->assertEquals([ 'X-Sabre-Version' => [DAV\Version::VERSION], - 'Content-Type' => ['application/xml; charset=utf-8'], + 'Content-Type' => ['application/xml; charset=utf-8'], ], $server->httpResponse->getHeaders()); - } - function testCorrect() { - + public function testCorrect() + { $xml = ' '; $serverVars = [ 'REQUEST_METHOD' => 'REPORT', - 'HTTP_DEPTH' => '0', - 'REQUEST_URI' => '/principals', + 'HTTP_DEPTH' => '0', + 'REQUEST_URI' => '/principals', ]; $request = HTTP\Sapi::createFromServerArray($serverVars); @@ -106,35 +105,32 @@ class PrincipalSearchPropertySetTest extends \PHPUnit_Framework_TestCase { $this->assertEquals(200, $server->httpResponse->status, $server->httpResponse->body); $this->assertEquals([ 'X-Sabre-Version' => [DAV\Version::VERSION], - 'Content-Type' => ['application/xml; charset=utf-8'], + 'Content-Type' => ['application/xml; charset=utf-8'], ], $server->httpResponse->getHeaders()); - $check = [ '/d:principal-search-property-set', - '/d:principal-search-property-set/d:principal-search-property' => 2, - '/d:principal-search-property-set/d:principal-search-property/d:prop' => 2, - '/d:principal-search-property-set/d:principal-search-property/d:prop/d:displayname' => 1, + '/d:principal-search-property-set/d:principal-search-property' => 2, + '/d:principal-search-property-set/d:principal-search-property/d:prop' => 2, + '/d:principal-search-property-set/d:principal-search-property/d:prop/d:displayname' => 1, '/d:principal-search-property-set/d:principal-search-property/d:prop/s:email-address' => 1, - '/d:principal-search-property-set/d:principal-search-property/d:description' => 2, + '/d:principal-search-property-set/d:principal-search-property/d:description' => 2, ]; $xml = simplexml_load_string($server->httpResponse->body); $xml->registerXPathNamespace('d', 'DAV:'); $xml->registerXPathNamespace('s', 'http://sabredav.org/ns'); foreach ($check as $v1 => $v2) { - $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->body); + 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->body); } - } - } -- cgit v1.2.3