mirror of
https://git.friendi.ca/friendica/friendica-addons.git
synced 2025-07-11 10:58:48 +00:00
Initial Release of the calendar plugin
This commit is contained in:
parent
45cc9885fc
commit
7115197a33
561 changed files with 189494 additions and 0 deletions
|
@ -0,0 +1,30 @@
|
|||
<?php
|
||||
|
||||
class Sabre_DAVACL_Property_ACLRestrictionsTest extends PHPUnit_Framework_TestCase {
|
||||
|
||||
function testConstruct() {
|
||||
|
||||
$prop = new Sabre_DAVACL_Property_AclRestrictions();
|
||||
|
||||
}
|
||||
|
||||
function testSerializeEmpty() {
|
||||
|
||||
$dom = new DOMDocument('1.0');
|
||||
$root = $dom->createElementNS('DAV:','d:root');
|
||||
|
||||
$dom->appendChild($root);
|
||||
|
||||
$acl = new Sabre_DAVACL_Property_AclRestrictions();
|
||||
$acl->serialize(new Sabre_DAV_Server(), $root);
|
||||
|
||||
$xml = $dom->saveXML();
|
||||
$expected = '<?xml version="1.0"?>
|
||||
<d:root xmlns:d="DAV:"><d:grant-only/><d:no-invert/></d:root>
|
||||
';
|
||||
$this->assertEquals($expected, $xml);
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
329
dav/SabreDAV/tests/Sabre/DAVACL/Property/ACLTest.php
Normal file
329
dav/SabreDAV/tests/Sabre/DAVACL/Property/ACLTest.php
Normal file
|
@ -0,0 +1,329 @@
|
|||
<?php
|
||||
|
||||
class Sabre_DAVACL_Property_ACLTest extends PHPUnit_Framework_TestCase {
|
||||
|
||||
function testConstruct() {
|
||||
|
||||
$acl = new Sabre_DAVACL_Property_Acl(array());
|
||||
|
||||
}
|
||||
|
||||
function testSerializeEmpty() {
|
||||
|
||||
$dom = new DOMDocument('1.0');
|
||||
$root = $dom->createElementNS('DAV:','d:root');
|
||||
|
||||
$dom->appendChild($root);
|
||||
|
||||
$acl = new Sabre_DAVACL_Property_Acl(array());
|
||||
$acl->serialize(new Sabre_DAV_Server(), $root);
|
||||
|
||||
$xml = $dom->saveXML();
|
||||
$expected = '<?xml version="1.0"?>
|
||||
<d:root xmlns:d="DAV:"/>
|
||||
';
|
||||
$this->assertEquals($expected, $xml);
|
||||
|
||||
}
|
||||
|
||||
function testSerialize() {
|
||||
|
||||
$dom = new DOMDocument('1.0');
|
||||
$root = $dom->createElementNS('DAV:','d:root');
|
||||
|
||||
$dom->appendChild($root);
|
||||
|
||||
$privileges = array(
|
||||
array(
|
||||
'principal' => 'principals/evert',
|
||||
'privilege' => '{DAV:}write',
|
||||
'uri' => 'articles',
|
||||
),
|
||||
array(
|
||||
'principal' => 'principals/foo',
|
||||
'privilege' => '{DAV:}read',
|
||||
'uri' => 'articles',
|
||||
'protected' => true,
|
||||
),
|
||||
);
|
||||
|
||||
$acl = new Sabre_DAVACL_Property_Acl($privileges);
|
||||
$acl->serialize(new Sabre_DAV_Server(), $root);
|
||||
|
||||
$dom->formatOutput = true;
|
||||
|
||||
$xml = $dom->saveXML();
|
||||
$expected = '<?xml version="1.0"?>
|
||||
<d:root xmlns:d="DAV:">
|
||||
<d:ace>
|
||||
<d:principal>
|
||||
<d:href>/principals/evert/</d:href>
|
||||
</d:principal>
|
||||
<d:grant>
|
||||
<d:privilege>
|
||||
<d:write/>
|
||||
</d:privilege>
|
||||
</d:grant>
|
||||
</d:ace>
|
||||
<d:ace>
|
||||
<d:principal>
|
||||
<d:href>/principals/foo/</d:href>
|
||||
</d:principal>
|
||||
<d:grant>
|
||||
<d:privilege>
|
||||
<d:read/>
|
||||
</d:privilege>
|
||||
</d:grant>
|
||||
<d:protected/>
|
||||
</d:ace>
|
||||
</d:root>
|
||||
';
|
||||
$this->assertEquals($expected, $xml);
|
||||
|
||||
}
|
||||
|
||||
function testSerializeSpecialPrincipals() {
|
||||
|
||||
$dom = new DOMDocument('1.0');
|
||||
$root = $dom->createElementNS('DAV:','d:root');
|
||||
|
||||
$dom->appendChild($root);
|
||||
|
||||
$privileges = array(
|
||||
array(
|
||||
'principal' => '{DAV:}authenticated',
|
||||
'privilege' => '{DAV:}write',
|
||||
'uri' => 'articles',
|
||||
),
|
||||
array(
|
||||
'principal' => '{DAV:}unauthenticated',
|
||||
'privilege' => '{DAV:}write',
|
||||
'uri' => 'articles',
|
||||
),
|
||||
array(
|
||||
'principal' => '{DAV:}all',
|
||||
'privilege' => '{DAV:}write',
|
||||
'uri' => 'articles',
|
||||
),
|
||||
|
||||
);
|
||||
|
||||
$acl = new Sabre_DAVACL_Property_Acl($privileges);
|
||||
$acl->serialize(new Sabre_DAV_Server(), $root);
|
||||
|
||||
$dom->formatOutput = true;
|
||||
|
||||
$xml = $dom->saveXML();
|
||||
$expected = '<?xml version="1.0"?>
|
||||
<d:root xmlns:d="DAV:">
|
||||
<d:ace>
|
||||
<d:principal>
|
||||
<d:authenticated/>
|
||||
</d:principal>
|
||||
<d:grant>
|
||||
<d:privilege>
|
||||
<d:write/>
|
||||
</d:privilege>
|
||||
</d:grant>
|
||||
</d:ace>
|
||||
<d:ace>
|
||||
<d:principal>
|
||||
<d:unauthenticated/>
|
||||
</d:principal>
|
||||
<d:grant>
|
||||
<d:privilege>
|
||||
<d:write/>
|
||||
</d:privilege>
|
||||
</d:grant>
|
||||
</d:ace>
|
||||
<d:ace>
|
||||
<d:principal>
|
||||
<d:all/>
|
||||
</d:principal>
|
||||
<d:grant>
|
||||
<d:privilege>
|
||||
<d:write/>
|
||||
</d:privilege>
|
||||
</d:grant>
|
||||
</d:ace>
|
||||
</d:root>
|
||||
';
|
||||
$this->assertEquals($expected, $xml);
|
||||
|
||||
}
|
||||
|
||||
function testUnserialize() {
|
||||
|
||||
$source = '<?xml version="1.0"?>
|
||||
<d:root xmlns:d="DAV:">
|
||||
<d:ace>
|
||||
<d:principal>
|
||||
<d:href>/principals/evert/</d:href>
|
||||
</d:principal>
|
||||
<d:grant>
|
||||
<d:privilege>
|
||||
<d:write/>
|
||||
</d:privilege>
|
||||
</d:grant>
|
||||
</d:ace>
|
||||
<d:ace>
|
||||
<d:principal>
|
||||
<d:href>/principals/foo/</d:href>
|
||||
</d:principal>
|
||||
<d:grant>
|
||||
<d:privilege>
|
||||
<d:read/>
|
||||
</d:privilege>
|
||||
</d:grant>
|
||||
<d:protected/>
|
||||
</d:ace>
|
||||
</d:root>
|
||||
';
|
||||
|
||||
$dom = Sabre_DAV_XMLUtil::loadDOMDocument($source);
|
||||
$result = Sabre_DAVACL_Property_Acl::unserialize($dom->firstChild);
|
||||
|
||||
$this->assertInstanceOf('Sabre_DAVACL_Property_Acl', $result);
|
||||
|
||||
$expected = array(
|
||||
array(
|
||||
'principal' => '/principals/evert/',
|
||||
'protected' => false,
|
||||
'privilege' => '{DAV:}write',
|
||||
),
|
||||
array(
|
||||
'principal' => '/principals/foo/',
|
||||
'protected' => true,
|
||||
'privilege' => '{DAV:}read',
|
||||
),
|
||||
);
|
||||
|
||||
$this->assertEquals($expected, $result->getPrivileges());
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException Sabre_DAV_Exception_BadRequest
|
||||
*/
|
||||
function testUnserializeNoPrincipal() {
|
||||
|
||||
$source = '<?xml version="1.0"?>
|
||||
<d:root xmlns:d="DAV:">
|
||||
<d:ace>
|
||||
<d:grant>
|
||||
<d:privilege>
|
||||
<d:write/>
|
||||
</d:privilege>
|
||||
</d:grant>
|
||||
</d:ace>
|
||||
</d:root>
|
||||
';
|
||||
|
||||
$dom = Sabre_DAV_XMLUtil::loadDOMDocument($source);
|
||||
Sabre_DAVACL_Property_Acl::unserialize($dom->firstChild);
|
||||
|
||||
}
|
||||
|
||||
function testUnserializeOtherPrincipal() {
|
||||
|
||||
$source = '<?xml version="1.0"?>
|
||||
<d:root xmlns:d="DAV:">
|
||||
<d:ace>
|
||||
<d:grant>
|
||||
<d:privilege>
|
||||
<d:write/>
|
||||
</d:privilege>
|
||||
</d:grant>
|
||||
<d:principal><d:authenticated /></d:principal>
|
||||
</d:ace>
|
||||
<d:ace>
|
||||
<d:grant>
|
||||
<d:privilege>
|
||||
<d:write/>
|
||||
</d:privilege>
|
||||
</d:grant>
|
||||
<d:principal><d:unauthenticated /></d:principal>
|
||||
</d:ace>
|
||||
<d:ace>
|
||||
<d:grant>
|
||||
<d:privilege>
|
||||
<d:write/>
|
||||
</d:privilege>
|
||||
</d:grant>
|
||||
<d:principal><d:all /></d:principal>
|
||||
</d:ace>
|
||||
</d:root>
|
||||
';
|
||||
|
||||
$dom = Sabre_DAV_XMLUtil::loadDOMDocument($source);
|
||||
$result = Sabre_DAVACL_Property_Acl::unserialize($dom->firstChild);
|
||||
|
||||
$this->assertInstanceOf('Sabre_DAVACL_Property_Acl', $result);
|
||||
|
||||
$expected = array(
|
||||
array(
|
||||
'principal' => '{DAV:}authenticated',
|
||||
'protected' => false,
|
||||
'privilege' => '{DAV:}write',
|
||||
),
|
||||
array(
|
||||
'principal' => '{DAV:}unauthenticated',
|
||||
'protected' => false,
|
||||
'privilege' => '{DAV:}write',
|
||||
),
|
||||
array(
|
||||
'principal' => '{DAV:}all',
|
||||
'protected' => false,
|
||||
'privilege' => '{DAV:}write',
|
||||
),
|
||||
);
|
||||
|
||||
$this->assertEquals($expected, $result->getPrivileges());
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException Sabre_DAV_Exception_NotImplemented
|
||||
*/
|
||||
function testUnserializeDeny() {
|
||||
|
||||
$source = '<?xml version="1.0"?>
|
||||
<d:root xmlns:d="DAV:">
|
||||
<d:ace>
|
||||
<d:deny>
|
||||
<d:privilege>
|
||||
<d:write/>
|
||||
</d:privilege>
|
||||
</d:deny>
|
||||
<d:principal><d:href>/principals/evert</d:href></d:principal>
|
||||
</d:ace>
|
||||
</d:root>
|
||||
';
|
||||
|
||||
$dom = Sabre_DAV_XMLUtil::loadDOMDocument($source);
|
||||
Sabre_DAVACL_Property_Acl::unserialize($dom->firstChild);
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException Sabre_DAV_Exception_BadRequest
|
||||
*/
|
||||
function testUnserializeMissingPriv() {
|
||||
|
||||
$source = '<?xml version="1.0"?>
|
||||
<d:root xmlns:d="DAV:">
|
||||
<d:ace>
|
||||
<d:grant>
|
||||
<d:privilege />
|
||||
</d:grant>
|
||||
<d:principal><d:href>/principals/evert</d:href></d:principal>
|
||||
</d:ace>
|
||||
</d:root>
|
||||
';
|
||||
|
||||
$dom = Sabre_DAV_XMLUtil::loadDOMDocument($source);
|
||||
Sabre_DAVACL_Property_Acl::unserialize($dom->firstChild);
|
||||
|
||||
}
|
||||
}
|
|
@ -0,0 +1,41 @@
|
|||
<?php
|
||||
|
||||
class Sabre_DAVACL_Property_CurrentUserPrivilegeSetTest extends PHPUnit_Framework_TestCase {
|
||||
|
||||
function testSerialize() {
|
||||
|
||||
$privileges = array(
|
||||
'{DAV:}read',
|
||||
'{DAV:}write',
|
||||
);
|
||||
$prop = new Sabre_DAVACL_Property_CurrentUserPrivilegeSet($privileges);
|
||||
|
||||
$server = new Sabre_DAV_Server();
|
||||
$dom = new DOMDocument('1.0','utf-8');
|
||||
$root = $dom->createElementNS('DAV:','d:root');
|
||||
$dom->appendChild($root);
|
||||
|
||||
$prop->serialize($server, $root);
|
||||
|
||||
$xpaths = array(
|
||||
'/d:root' => 1,
|
||||
'/d:root/d:privilege' => 2,
|
||||
'/d:root/d:privilege/d:read' => 1,
|
||||
'/d:root/d:privilege/d:write' => 1,
|
||||
);
|
||||
|
||||
// Reloading because PHP DOM sucks
|
||||
$dom2 = new DOMDocument('1.0', 'utf-8');
|
||||
$dom2->loadXML($dom->saveXML());
|
||||
|
||||
$dxpath = new DOMXPath($dom2);
|
||||
$dxpath->registerNamespace('d','DAV:');
|
||||
foreach($xpaths as $xpath=>$count) {
|
||||
|
||||
$this->assertEquals($count, $dxpath->query($xpath)->length, 'Looking for : ' . $xpath . ', we could only find ' . $dxpath->query($xpath)->length . ' elements, while we expected ' . $count);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
176
dav/SabreDAV/tests/Sabre/DAVACL/Property/PrincipalTest.php
Normal file
176
dav/SabreDAV/tests/Sabre/DAVACL/Property/PrincipalTest.php
Normal file
|
@ -0,0 +1,176 @@
|
|||
<?php
|
||||
|
||||
class Sabre_DAVACL_Property_PrincipalTest extends PHPUnit_Framework_TestCase {
|
||||
|
||||
function testSimple() {
|
||||
|
||||
$principal = new Sabre_DAVACL_Property_Principal(Sabre_DAVACL_Property_Principal::UNAUTHENTICATED);
|
||||
$this->assertEquals(Sabre_DAVACL_Property_Principal::UNAUTHENTICATED, $principal->getType());
|
||||
$this->assertNull($principal->getHref());
|
||||
|
||||
$principal = new Sabre_DAVACL_Property_Principal(Sabre_DAVACL_Property_Principal::AUTHENTICATED);
|
||||
$this->assertEquals(Sabre_DAVACL_Property_Principal::AUTHENTICATED, $principal->getType());
|
||||
$this->assertNull($principal->getHref());
|
||||
|
||||
$principal = new Sabre_DAVACL_Property_Principal(Sabre_DAVACL_Property_Principal::HREF,'admin');
|
||||
$this->assertEquals(Sabre_DAVACL_Property_Principal::HREF, $principal->getType());
|
||||
$this->assertEquals('admin',$principal->getHref());
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @depends testSimple
|
||||
* @expectedException Sabre_DAV_Exception
|
||||
*/
|
||||
function testNoHref() {
|
||||
|
||||
$principal = new Sabre_DAVACL_Property_Principal(Sabre_DAVACL_Property_Principal::HREF);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @depends testSimple
|
||||
*/
|
||||
function testSerializeUnAuthenticated() {
|
||||
|
||||
$prin = new Sabre_DAVACL_Property_Principal(Sabre_DAVACL_Property_Principal::UNAUTHENTICATED);
|
||||
|
||||
$doc = new DOMDocument();
|
||||
$root = $doc->createElement('d:principal');
|
||||
$root->setAttribute('xmlns:d','DAV:');
|
||||
|
||||
$doc->appendChild($root);
|
||||
$objectTree = new Sabre_DAV_ObjectTree(new Sabre_DAV_SimpleCollection('rootdir'));
|
||||
$server = new Sabre_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 Sabre_DAVACL_Property_Principal(Sabre_DAVACL_Property_Principal::AUTHENTICATED);
|
||||
|
||||
$doc = new DOMDocument();
|
||||
$root = $doc->createElement('d:principal');
|
||||
$root->setAttribute('xmlns:d','DAV:');
|
||||
|
||||
$doc->appendChild($root);
|
||||
$objectTree = new Sabre_DAV_ObjectTree(new Sabre_DAV_SimpleCollection('rootdir'));
|
||||
$server = new Sabre_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 Sabre_DAVACL_Property_Principal(Sabre_DAVACL_Property_Principal::HREF,'principals/admin');
|
||||
|
||||
$doc = new DOMDocument();
|
||||
$root = $doc->createElement('d:principal');
|
||||
$root->setAttribute('xmlns:d','DAV:');
|
||||
|
||||
$doc->appendChild($root);
|
||||
$objectTree = new Sabre_DAV_ObjectTree(new Sabre_DAV_SimpleCollection('rootdir'));
|
||||
$server = new Sabre_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 = Sabre_DAV_XMLUtil::loadDOMDocument($xml);
|
||||
|
||||
$principal = Sabre_DAVACL_Property_Principal::unserialize($dom->firstChild);
|
||||
$this->assertEquals(Sabre_DAVACL_Property_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 = Sabre_DAV_XMLUtil::loadDOMDocument($xml);
|
||||
|
||||
$principal = Sabre_DAVACL_Property_Principal::unserialize($dom->firstChild);
|
||||
$this->assertEquals(Sabre_DAVACL_Property_Principal::AUTHENTICATED, $principal->getType());
|
||||
|
||||
}
|
||||
|
||||
function testUnserializeUnauthenticated() {
|
||||
|
||||
$xml = '<?xml version="1.0"?>
|
||||
<d:principal xmlns:d="DAV:">' .
|
||||
' <d:unauthenticated />' .
|
||||
'</d:principal>';
|
||||
|
||||
$dom = Sabre_DAV_XMLUtil::loadDOMDocument($xml);
|
||||
|
||||
$principal = Sabre_DAVACL_Property_Principal::unserialize($dom->firstChild);
|
||||
$this->assertEquals(Sabre_DAVACL_Property_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 = Sabre_DAV_XMLUtil::loadDOMDocument($xml);
|
||||
|
||||
Sabre_DAVACL_Property_Principal::unserialize($dom->firstChild);
|
||||
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,99 @@
|
|||
<?php
|
||||
|
||||
class Sabre_DAVACL_Property_SupportedPrivilegeSetTest extends PHPUnit_Framework_TestCase {
|
||||
|
||||
function testSimple() {
|
||||
|
||||
$prop = new Sabre_DAVACL_Property_SupportedPrivilegeSet(array(
|
||||
'privilege' => '{DAV:}all',
|
||||
));
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @depends testSimple
|
||||
*/
|
||||
function testSerializeSimple() {
|
||||
|
||||
$prop = new Sabre_DAVACL_Property_SupportedPrivilegeSet(array(
|
||||
'privilege' => '{DAV:}all',
|
||||
));
|
||||
|
||||
$doc = new DOMDocument();
|
||||
$root = $doc->createElementNS('DAV:', 'd:supported-privilege-set');
|
||||
|
||||
$doc->appendChild($root);
|
||||
|
||||
$server = new Sabre_DAV_Server();
|
||||
$prop->serialize($server, $root);
|
||||
|
||||
$xml = $doc->saveXML();
|
||||
|
||||
$this->assertEquals(
|
||||
'<?xml version="1.0"?>
|
||||
<d:supported-privilege-set xmlns:d="DAV:">' .
|
||||
'<d:supported-privilege>' .
|
||||
'<d:privilege>' .
|
||||
'<d:all/>' .
|
||||
'</d:privilege>' .
|
||||
'</d:supported-privilege>' .
|
||||
'</d:supported-privilege-set>
|
||||
', $xml);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @depends testSimple
|
||||
*/
|
||||
function testSerializeAggregate() {
|
||||
|
||||
$prop = new Sabre_DAVACL_Property_SupportedPrivilegeSet(array(
|
||||
'privilege' => '{DAV:}all',
|
||||
'abstract' => true,
|
||||
'aggregates' => array(
|
||||
array(
|
||||
'privilege' => '{DAV:}read',
|
||||
),
|
||||
array(
|
||||
'privilege' => '{DAV:}write',
|
||||
'description' => 'booh',
|
||||
),
|
||||
),
|
||||
));
|
||||
|
||||
$doc = new DOMDocument();
|
||||
$root = $doc->createElementNS('DAV:', 'd:supported-privilege-set');
|
||||
|
||||
$doc->appendChild($root);
|
||||
|
||||
$server = new Sabre_DAV_Server();
|
||||
$prop->serialize($server, $root);
|
||||
|
||||
$xml = $doc->saveXML();
|
||||
|
||||
$this->assertEquals(
|
||||
'<?xml version="1.0"?>
|
||||
<d:supported-privilege-set xmlns:d="DAV:">' .
|
||||
'<d:supported-privilege>' .
|
||||
'<d:privilege>' .
|
||||
'<d:all/>' .
|
||||
'</d:privilege>' .
|
||||
'<d:abstract/>' .
|
||||
'<d:supported-privilege>' .
|
||||
'<d:privilege>' .
|
||||
'<d:read/>' .
|
||||
'</d:privilege>' .
|
||||
'</d:supported-privilege>' .
|
||||
'<d:supported-privilege>' .
|
||||
'<d:privilege>' .
|
||||
'<d:write/>' .
|
||||
'</d:privilege>' .
|
||||
'<d:description>booh</d:description>' .
|
||||
'</d:supported-privilege>' .
|
||||
'</d:supported-privilege>' .
|
||||
'</d:supported-privilege-set>
|
||||
', $xml);
|
||||
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue