aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/sabre/dav/tests/Sabre/DAVACL
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/sabre/dav/tests/Sabre/DAVACL')
-rw-r--r--vendor/sabre/dav/tests/Sabre/DAVACL/ExpandPropertiesTest.php14
-rw-r--r--vendor/sabre/dav/tests/Sabre/DAVACL/PrincipalBackend/AbstractPDOTest.php19
-rw-r--r--vendor/sabre/dav/tests/Sabre/DAVACL/PrincipalPropertySearchTest.php28
-rw-r--r--vendor/sabre/dav/tests/Sabre/DAVACL/PrincipalSearchPropertySetTest.php9
4 files changed, 46 insertions, 24 deletions
diff --git a/vendor/sabre/dav/tests/Sabre/DAVACL/ExpandPropertiesTest.php b/vendor/sabre/dav/tests/Sabre/DAVACL/ExpandPropertiesTest.php
index 28e328ea6..d0b67cfae 100644
--- a/vendor/sabre/dav/tests/Sabre/DAVACL/ExpandPropertiesTest.php
+++ b/vendor/sabre/dav/tests/Sabre/DAVACL/ExpandPropertiesTest.php
@@ -75,7 +75,7 @@ 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(207, $server->httpResponse->status, 'Incorrect status code received. Full body: '.$server->httpResponse->getBodyAsString());
$this->assertEquals([
'X-Sabre-Version' => [DAV\Version::VERSION],
'Content-Type' => ['application/xml; charset=utf-8'],
@@ -93,7 +93,7 @@ class ExpandPropertiesTest extends \PHPUnit\Framework\TestCase
'/d:multistatus/d:response/d:propstat/d:prop/s:href/d:href' => 1,
];
- $xml = simplexml_load_string($server->httpResponse->body);
+ $xml = simplexml_load_string($server->httpResponse->getBodyAsString());
$xml->registerXPathNamespace('d', 'DAV:');
$xml->registerXPathNamespace('s', 'http://sabredav.org/ns');
foreach ($check as $v1 => $v2) {
@@ -106,7 +106,7 @@ class ExpandPropertiesTest extends \PHPUnit\Framework\TestCase
$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->getBodyAsString());
}
}
@@ -136,7 +136,7 @@ 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(207, $server->httpResponse->status, 'Incorrect response status received. Full response body: '.$server->httpResponse->getBodyAsString());
$this->assertEquals([
'X-Sabre-Version' => [DAV\Version::VERSION],
'Content-Type' => ['application/xml; charset=utf-8'],
@@ -156,7 +156,7 @@ class ExpandPropertiesTest extends \PHPUnit\Framework\TestCase
'/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 = simplexml_load_string($server->httpResponse->getBodyAsString());
$xml->registerXPathNamespace('d', 'DAV:');
$xml->registerXPathNamespace('s', 'http://sabredav.org/ns');
foreach ($check as $v1 => $v2) {
@@ -219,7 +219,7 @@ class ExpandPropertiesTest extends \PHPUnit\Framework\TestCase
'/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 = simplexml_load_string($server->httpResponse->getBodyAsString());
$xml->registerXPathNamespace('d', 'DAV:');
$xml->registerXPathNamespace('s', 'http://sabredav.org/ns');
foreach ($check as $v1 => $v2) {
@@ -291,7 +291,7 @@ class ExpandPropertiesTest extends \PHPUnit\Framework\TestCase
'/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 = simplexml_load_string($server->httpResponse->getBodyAsString());
$xml->registerXPathNamespace('d', 'DAV:');
$xml->registerXPathNamespace('s', 'http://sabredav.org/ns');
foreach ($check as $v1 => $v2) {
diff --git a/vendor/sabre/dav/tests/Sabre/DAVACL/PrincipalBackend/AbstractPDOTest.php b/vendor/sabre/dav/tests/Sabre/DAVACL/PrincipalBackend/AbstractPDOTest.php
index 89f69b10a..95775d8fe 100644
--- a/vendor/sabre/dav/tests/Sabre/DAVACL/PrincipalBackend/AbstractPDOTest.php
+++ b/vendor/sabre/dav/tests/Sabre/DAVACL/PrincipalBackend/AbstractPDOTest.php
@@ -190,7 +190,7 @@ abstract class AbstractPDOTest extends \PHPUnit\Framework\TestCase
$this->assertNull($backend->findByUri('http://foo', 'principals'));
}
- public function testFindByUri()
+ public function testFindByUriWithMailtoAddress()
{
$pdo = $this->getPDO();
$backend = new PDO($pdo);
@@ -199,4 +199,21 @@ abstract class AbstractPDOTest extends \PHPUnit\Framework\TestCase
$backend->findByUri('mailto:user@example.org', 'principals')
);
}
+
+ public function testFindByUriWithUri()
+ {
+ $pdo = $this->getPDO();
+ $backend = new PDO($pdo);
+ $this->assertEquals(
+ 'principals/user',
+ $backend->findByUri('principals/user', 'principals')
+ );
+ }
+
+ public function testFindByUriWithUnknownUri()
+ {
+ $pdo = $this->getPDO();
+ $backend = new PDO($pdo);
+ $this->assertNull($backend->findByUri('principals/other', 'principals'));
+ }
}
diff --git a/vendor/sabre/dav/tests/Sabre/DAVACL/PrincipalPropertySearchTest.php b/vendor/sabre/dav/tests/Sabre/DAVACL/PrincipalPropertySearchTest.php
index 3bdcfbbbd..55c64721e 100644
--- a/vendor/sabre/dav/tests/Sabre/DAVACL/PrincipalPropertySearchTest.php
+++ b/vendor/sabre/dav/tests/Sabre/DAVACL/PrincipalPropertySearchTest.php
@@ -140,7 +140,8 @@ class PrincipalPropertySearchTest extends \PHPUnit\Framework\TestCase
$server->exec();
- $this->assertEquals(207, $server->httpResponse->status, $server->httpResponse->body);
+ $bodyAsString = $server->httpResponse->getBodyAsString();
+ $this->assertEquals(207, $server->httpResponse->status, $bodyAsString);
$this->assertEquals([
'X-Sabre-Version' => [DAV\Version::VERSION],
'Content-Type' => ['application/xml; charset=utf-8'],
@@ -158,7 +159,7 @@ class PrincipalPropertySearchTest extends \PHPUnit\Framework\TestCase
'/d:multistatus/d:response/d:propstat/d:status' => 4,
];
- $xml = simplexml_load_string($server->httpResponse->body);
+ $xml = simplexml_load_string($bodyAsString);
$xml->registerXPathNamespace('d', 'DAV:');
foreach ($check as $v1 => $v2) {
$xpath = is_int($v1) ? $v2 : $v1;
@@ -170,7 +171,7 @@ class PrincipalPropertySearchTest extends \PHPUnit\Framework\TestCase
$count = $v2;
}
- $this->assertEquals($count, count($result), 'we expected '.$count.' appearances of '.$xpath.' . We found '.count($result).'. Full response body: '.$server->httpResponse->body);
+ $this->assertEquals($count, count($result), 'we expected '.$count.' appearances of '.$xpath.' . We found '.count($result).'. Full response body: '.$server->httpResponse->getBodyAsString());
}
}
@@ -211,7 +212,8 @@ class PrincipalPropertySearchTest extends \PHPUnit\Framework\TestCase
$server->exec();
- $this->assertEquals(207, $server->httpResponse->status, $server->httpResponse->body);
+ $bodyAsString = $server->httpResponse->getBodyAsString();
+ $this->assertEquals(207, $server->httpResponse->status, $bodyAsString);
$this->assertEquals([
'X-Sabre-Version' => [DAV\Version::VERSION],
'Content-Type' => ['application/xml; charset=utf-8'],
@@ -229,7 +231,7 @@ class PrincipalPropertySearchTest extends \PHPUnit\Framework\TestCase
'/d:multistatus/d:response/d:propstat/d:status' => 0,
];
- $xml = simplexml_load_string($server->httpResponse->body);
+ $xml = simplexml_load_string($bodyAsString);
$xml->registerXPathNamespace('d', 'DAV:');
foreach ($check as $v1 => $v2) {
$xpath = is_int($v1) ? $v2 : $v1;
@@ -241,7 +243,7 @@ class PrincipalPropertySearchTest extends \PHPUnit\Framework\TestCase
$count = $v2;
}
- $this->assertEquals($count, count($result), 'we expected '.$count.' appearances of '.$xpath.' . We found '.count($result).'. Full response body: '.$server->httpResponse->body);
+ $this->assertEquals($count, count($result), 'we expected '.$count.' appearances of '.$xpath.' . We found '.count($result).'. Full response body: '.$server->httpResponse->getBodyAsString());
}
}
@@ -282,7 +284,8 @@ class PrincipalPropertySearchTest extends \PHPUnit\Framework\TestCase
$server->exec();
- $this->assertEquals(207, $server->httpResponse->status, $server->httpResponse->body);
+ $bodyAsString = $server->httpResponse->getBodyAsString();
+ $this->assertEquals(207, $server->httpResponse->status, $bodyAsString);
$this->assertEquals([
'X-Sabre-Version' => [DAV\Version::VERSION],
'Content-Type' => ['application/xml; charset=utf-8'],
@@ -300,7 +303,7 @@ class PrincipalPropertySearchTest extends \PHPUnit\Framework\TestCase
'/d:multistatus/d:response/d:propstat/d:status' => 4,
];
- $xml = simplexml_load_string($server->httpResponse->body);
+ $xml = simplexml_load_string($bodyAsString);
$xml->registerXPathNamespace('d', 'DAV:');
foreach ($check as $v1 => $v2) {
$xpath = is_int($v1) ? $v2 : $v1;
@@ -312,7 +315,7 @@ class PrincipalPropertySearchTest extends \PHPUnit\Framework\TestCase
$count = $v2;
}
- $this->assertEquals($count, count($result), 'we expected '.$count.' appearances of '.$xpath.' . We found '.count($result).'. Full response body: '.$server->httpResponse->body);
+ $this->assertEquals($count, count($result), 'we expected '.$count.' appearances of '.$xpath.' . We found '.count($result).'. Full response body: '.$server->httpResponse->getBodyAsString());
}
}
@@ -346,7 +349,8 @@ class PrincipalPropertySearchTest extends \PHPUnit\Framework\TestCase
$server->exec();
- $this->assertEquals(207, $server->httpResponse->status, $server->httpResponse->body);
+ $bodyAsString = $server->httpResponse->getBodyAsString();
+ $this->assertEquals(207, $server->httpResponse->status, $bodyAsString);
$this->assertEquals([
'X-Sabre-Version' => [DAV\Version::VERSION],
'Content-Type' => ['application/xml; charset=utf-8'],
@@ -358,7 +362,7 @@ class PrincipalPropertySearchTest extends \PHPUnit\Framework\TestCase
'/d:multistatus/d:response' => 0,
];
- $xml = simplexml_load_string($server->httpResponse->body);
+ $xml = simplexml_load_string($bodyAsString);
$xml->registerXPathNamespace('d', 'DAV:');
foreach ($check as $v1 => $v2) {
$xpath = is_int($v1) ? $v2 : $v1;
@@ -370,7 +374,7 @@ class PrincipalPropertySearchTest extends \PHPUnit\Framework\TestCase
$count = $v2;
}
- $this->assertEquals($count, count($result), 'we expected '.$count.' appearances of '.$xpath.' . We found '.count($result).'. Full response body: '.$server->httpResponse->body);
+ $this->assertEquals($count, count($result), 'we expected '.$count.' appearances of '.$xpath.' . We found '.count($result).'. Full response body: '.$server->httpResponse->getBodyAsString());
}
}
}
diff --git a/vendor/sabre/dav/tests/Sabre/DAVACL/PrincipalSearchPropertySetTest.php b/vendor/sabre/dav/tests/Sabre/DAVACL/PrincipalSearchPropertySetTest.php
index 04f168f92..b44b46fc5 100644
--- a/vendor/sabre/dav/tests/Sabre/DAVACL/PrincipalSearchPropertySetTest.php
+++ b/vendor/sabre/dav/tests/Sabre/DAVACL/PrincipalSearchPropertySetTest.php
@@ -76,7 +76,7 @@ class PrincipalSearchPropertySetTest extends \PHPUnit\Framework\TestCase
$server->exec();
- $this->assertEquals(400, $server->httpResponse->status, $server->httpResponse->body);
+ $this->assertEquals(400, $server->httpResponse->status, $server->httpResponse->getBodyAsString());
$this->assertEquals([
'X-Sabre-Version' => [DAV\Version::VERSION],
'Content-Type' => ['application/xml; charset=utf-8'],
@@ -102,7 +102,8 @@ class PrincipalSearchPropertySetTest extends \PHPUnit\Framework\TestCase
$server->exec();
- $this->assertEquals(200, $server->httpResponse->status, $server->httpResponse->body);
+ $bodyAsString = $server->httpResponse->getBodyAsString();
+ $this->assertEquals(200, $server->httpResponse->status, $bodyAsString);
$this->assertEquals([
'X-Sabre-Version' => [DAV\Version::VERSION],
'Content-Type' => ['application/xml; charset=utf-8'],
@@ -117,7 +118,7 @@ class PrincipalSearchPropertySetTest extends \PHPUnit\Framework\TestCase
'/d:principal-search-property-set/d:principal-search-property/d:description' => 2,
];
- $xml = simplexml_load_string($server->httpResponse->body);
+ $xml = simplexml_load_string($bodyAsString);
$xml->registerXPathNamespace('d', 'DAV:');
$xml->registerXPathNamespace('s', 'http://sabredav.org/ns');
foreach ($check as $v1 => $v2) {
@@ -130,7 +131,7 @@ class PrincipalSearchPropertySetTest extends \PHPUnit\Framework\TestCase
$count = $v2;
}
- $this->assertEquals($count, count($result), 'we expected '.$count.' appearances of '.$xpath.' . We found '.count($result).'. Full response body: '.$server->httpResponse->body);
+ $this->assertEquals($count, count($result), 'we expected '.$count.' appearances of '.$xpath.' . We found '.count($result).'. Full response body: '.$bodyAsString);
}
}
}