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) --- .../tests/Sabre/DAVACL/Property/PrincipalTest.php | 181 --------------------- 1 file changed, 181 deletions(-) delete mode 100644 vendor/sabre/dav/tests/Sabre/DAVACL/Property/PrincipalTest.php (limited to 'vendor/sabre/dav/tests/Sabre/DAVACL/Property/PrincipalTest.php') diff --git a/vendor/sabre/dav/tests/Sabre/DAVACL/Property/PrincipalTest.php b/vendor/sabre/dav/tests/Sabre/DAVACL/Property/PrincipalTest.php deleted file mode 100644 index be12c79ee..000000000 --- a/vendor/sabre/dav/tests/Sabre/DAVACL/Property/PrincipalTest.php +++ /dev/null @@ -1,181 +0,0 @@ -assertEquals(Principal::UNAUTHENTICATED, $principal->getType()); - $this->assertNull($principal->getHref()); - - $principal = new Principal(Principal::AUTHENTICATED); - $this->assertEquals(Principal::AUTHENTICATED, $principal->getType()); - $this->assertNull($principal->getHref()); - - $principal = new Principal(Principal::HREF,'admin'); - $this->assertEquals(Principal::HREF, $principal->getType()); - $this->assertEquals('admin',$principal->getHref()); - - } - - /** - * @depends testSimple - * @expectedException Sabre\DAV\Exception - */ - function testNoHref() { - - $principal = new Principal(Principal::HREF); - - } - - /** - * @depends testSimple - */ - function testSerializeUnAuthenticated() { - - $prin = new Principal(Principal::UNAUTHENTICATED); - - $doc = new \DOMDocument(); - $root = $doc->createElement('d:principal'); - $root->setAttribute('xmlns:d','DAV:'); - - $doc->appendChild($root); - $objectTree = new DAV\ObjectTree(new DAV\SimpleCollection('rootdir')); - $server = new DAV\Server($objectTree); - - $prin->serialize($server, $root); - - $xml = $doc->saveXML(); - - $this->assertEquals( -' -' . -'' . -' -', $xml); - - } - - - /** - * @depends testSerializeUnAuthenticated - */ - function testSerializeAuthenticated() { - - $prin = new Principal(Principal::AUTHENTICATED); - - $doc = new \DOMDocument(); - $root = $doc->createElement('d:principal'); - $root->setAttribute('xmlns:d','DAV:'); - - $doc->appendChild($root); - $objectTree = new DAV\ObjectTree(new DAV\SimpleCollection('rootdir')); - $server = new DAV\Server($objectTree); - - $prin->serialize($server, $root); - - $xml = $doc->saveXML(); - - $this->assertEquals( -' -' . -'' . -' -', $xml); - - } - - - /** - * @depends testSerializeUnAuthenticated - */ - function testSerializeHref() { - - $prin = new Principal(Principal::HREF,'principals/admin'); - - $doc = new \DOMDocument(); - $root = $doc->createElement('d:principal'); - $root->setAttribute('xmlns:d','DAV:'); - - $doc->appendChild($root); - $objectTree = new DAV\ObjectTree(new DAV\SimpleCollection('rootdir')); - $server = new DAV\Server($objectTree); - - $prin->serialize($server, $root); - - $xml = $doc->saveXML(); - - $this->assertEquals( -' -' . -'/principals/admin' . -' -', $xml); - - } - - function testUnserializeHref() { - - $xml = ' -' . -'/principals/admin' . -''; - - $dom = DAV\XMLUtil::loadDOMDocument($xml); - - $principal = Principal::unserialize($dom->firstChild); - $this->assertEquals(Principal::HREF, $principal->getType()); - $this->assertEquals('/principals/admin', $principal->getHref()); - - } - - function testUnserializeAuthenticated() { - - $xml = ' -' . -' ' . -''; - - $dom = DAV\XMLUtil::loadDOMDocument($xml); - - $principal = Principal::unserialize($dom->firstChild); - $this->assertEquals(Principal::AUTHENTICATED, $principal->getType()); - - } - - function testUnserializeUnauthenticated() { - - $xml = ' -' . -' ' . -''; - - $dom = DAV\XMLUtil::loadDOMDocument($xml); - - $principal = Principal::unserialize($dom->firstChild); - $this->assertEquals(Principal::UNAUTHENTICATED, $principal->getType()); - - } - - /** - * @expectedException Sabre\DAV\Exception\BadRequest - */ - function testUnserializeUnknown() { - - $xml = ' -' . -' ' . -''; - - $dom = DAV\XMLUtil::loadDOMDocument($xml); - - Principal::unserialize($dom->firstChild); - - } - -} -- cgit v1.2.3