aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/sabre/dav/tests/Sabre/DAVACL/Property/PrincipalTest.php
diff options
context:
space:
mode:
authorredmatrix <git@macgirvin.com>2016-05-10 17:26:44 -0700
committerredmatrix <git@macgirvin.com>2016-05-10 17:26:44 -0700
commit0b02a6d123b2014705998c94ddf3d460948d3eac (patch)
tree78ff2cab9944a4f5ab3f80ec93cbe1120de90bb2 /vendor/sabre/dav/tests/Sabre/DAVACL/Property/PrincipalTest.php
parent40b5b6e9d2da7ab65c8b4d38cdceac83a4d78deb (diff)
downloadvolse-hubzilla-0b02a6d123b2014705998c94ddf3d460948d3eac.tar.gz
volse-hubzilla-0b02a6d123b2014705998c94ddf3d460948d3eac.tar.bz2
volse-hubzilla-0b02a6d123b2014705998c94ddf3d460948d3eac.zip
initial sabre upgrade (needs lots of work - to wit: authentication, redo the browser interface, and rework event export/import)
Diffstat (limited to 'vendor/sabre/dav/tests/Sabre/DAVACL/Property/PrincipalTest.php')
-rw-r--r--vendor/sabre/dav/tests/Sabre/DAVACL/Property/PrincipalTest.php181
1 files changed, 0 insertions, 181 deletions
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 @@
-<?php
-
-namespace Sabre\DAVACL\Property;
-
-use Sabre\DAV;
-use Sabre\HTTP;
-
-class PrincipalTest extends \PHPUnit_Framework_TestCase {
-
- function testSimple() {
-
- $principal = new Principal(Principal::UNAUTHENTICATED);
- $this->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 version="1.0"?>
-<d:principal xmlns:d="DAV:">' .
-'<d:unauthenticated/>' .
-'</d:principal>
-', $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 version="1.0"?>
-<d:principal xmlns:d="DAV:">' .
-'<d:authenticated/>' .
-'</d:principal>
-', $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(
-'<?xml version="1.0"?>
-<d:principal xmlns:d="DAV:">' .
-'<d:href>/principals/admin</d:href>' .
-'</d:principal>
-', $xml);
-
- }
-
- function testUnserializeHref() {
-
- $xml = '<?xml version="1.0"?>
-<d:principal xmlns:d="DAV:">' .
-'<d:href>/principals/admin</d:href>' .
-'</d:principal>';
-
- $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 = '<?xml version="1.0"?>
-<d:principal xmlns:d="DAV:">' .
-' <d:authenticated />' .
-'</d:principal>';
-
- $dom = DAV\XMLUtil::loadDOMDocument($xml);
-
- $principal = Principal::unserialize($dom->firstChild);
- $this->assertEquals(Principal::AUTHENTICATED, $principal->getType());
-
- }
-
- function testUnserializeUnauthenticated() {
-
- $xml = '<?xml version="1.0"?>
-<d:principal xmlns:d="DAV:">' .
-' <d:unauthenticated />' .
-'</d:principal>';
-
- $dom = DAV\XMLUtil::loadDOMDocument($xml);
-
- $principal = Principal::unserialize($dom->firstChild);
- $this->assertEquals(Principal::UNAUTHENTICATED, $principal->getType());
-
- }
-
- /**
- * @expectedException Sabre\DAV\Exception\BadRequest
- */
- function testUnserializeUnknown() {
-
- $xml = '<?xml version="1.0"?>
-<d:principal xmlns:d="DAV:">' .
-' <d:foo />' .
-'</d:principal>';
-
- $dom = DAV\XMLUtil::loadDOMDocument($xml);
-
- Principal::unserialize($dom->firstChild);
-
- }
-
-}