diff options
author | Mario Vavti <mario@mariovavti.com> | 2020-08-22 19:31:29 +0200 |
---|---|---|
committer | Mario Vavti <mario@mariovavti.com> | 2020-08-22 19:31:29 +0200 |
commit | 2c777acb25fd5355ec02dc74c428174df80310d0 (patch) | |
tree | 8b74931f1b6c72d885cb47a451b71a565c4187d9 /vendor/sabre/dav/tests | |
parent | 49df57df45f82e2e0f1b10f2508f61b78d6d3ac0 (diff) | |
download | volse-hubzilla-2c777acb25fd5355ec02dc74c428174df80310d0.tar.gz volse-hubzilla-2c777acb25fd5355ec02dc74c428174df80310d0.tar.bz2 volse-hubzilla-2c777acb25fd5355ec02dc74c428174df80310d0.zip |
composer update sabre libs
Diffstat (limited to 'vendor/sabre/dav/tests')
-rw-r--r-- | vendor/sabre/dav/tests/Sabre/DAV/AbstractServer.php | 2 | ||||
-rw-r--r-- | vendor/sabre/dav/tests/Sabre/DAV/Locks/PluginTest.php | 26 |
2 files changed, 27 insertions, 1 deletions
diff --git a/vendor/sabre/dav/tests/Sabre/DAV/AbstractServer.php b/vendor/sabre/dav/tests/Sabre/DAV/AbstractServer.php index 807b66382..49fedf062 100644 --- a/vendor/sabre/dav/tests/Sabre/DAV/AbstractServer.php +++ b/vendor/sabre/dav/tests/Sabre/DAV/AbstractServer.php @@ -14,7 +14,7 @@ abstract class AbstractServer extends \PHPUnit\Framework\TestCase protected $response; protected $request; /** - * @var Sabre\DAV\Server + * @var \Sabre\DAV\Server */ protected $server; protected $tempDir = SABRE_TEMPDIR; diff --git a/vendor/sabre/dav/tests/Sabre/DAV/Locks/PluginTest.php b/vendor/sabre/dav/tests/Sabre/DAV/Locks/PluginTest.php index 96e3939d0..9279afb5a 100644 --- a/vendor/sabre/dav/tests/Sabre/DAV/Locks/PluginTest.php +++ b/vendor/sabre/dav/tests/Sabre/DAV/Locks/PluginTest.php @@ -110,6 +110,32 @@ class PluginTest extends DAV\AbstractServer $this->assertEquals($this->response->getHeader('Lock-Token'), '<'.(string) $token[0].'>', 'Token in response body didn\'t match token in response header.'); } + public function testLockWithContext() + { + $request = new HTTP\Request('LOCK', '/baseuri/test.txt'); + $request->setBody('<?xml version="1.0"?> +<D:lockinfo xmlns:D="DAV:"> + <D:lockscope><D:exclusive/></D:lockscope> + <D:locktype><D:write/></D:locktype> + <D:owner> + <D:href>http://example.org/~ejw/contact.html</D:href> + </D:owner> +</D:lockinfo>'); + + $this->server->setBaseUri('baseuri'); + $this->server->httpRequest = $request; + $this->server->exec(); + + $this->assertEquals(200, $this->response->status, 'Got an incorrect status back. Response body: '.$this->response->getBodyAsString()); + + $body = preg_replace("/xmlns(:[A-Za-z0-9_])?=(\"|\')DAV:(\"|\')/", 'xmlns\\1="urn:DAV"', $this->response->getBodyAsString()); + $xml = simplexml_load_string($body); + $xml->registerXPathNamespace('d', 'urn:DAV'); + + $lockRoot = $xml->xpath('/d:prop/d:lockdiscovery/d:activelock/d:lockroot/d:href'); + $this->assertEquals('baseuri/test.txt', (string) $lockRoot[0]); + } + /** * @depends testLock */ |