| Server IP : 213.186.33.4 / Your IP : 216.73.216.193 Web Server : Apache System : Linux webm006.cluster103.gra.hosting.ovh.net 5.15.206-ovh-vps-grsec-zfs-classid #1 SMP Fri May 15 02:41:25 UTC 2026 x86_64 User : awebpaca ( 35430) PHP Version : 8.5.0 Disable Function : _dyuweyrj4,_dyuweyrj4r,dl MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/awebpaca/Dolibarr/htdocs/includes/sabre/sabre/dav/tests/Sabre/DAV/Xml/Property/ |
Upload File : |
<?php
namespace Sabre\DAV\Xml\Property;
use Sabre\DAV\Sharing\Plugin;
use Sabre\DAV\Xml\Element\Sharee;
use Sabre\DAV\Xml\XmlTest;
class InviteTest extends XmlTest {
function testSerialize() {
$sharees = [
new Sharee(),
new Sharee(),
new Sharee(),
new Sharee()
];
$sharees[0]->href = 'mailto:foo@example.org';
$sharees[0]->properties['{DAV:}displayname'] = 'Foo Bar';
$sharees[0]->access = Plugin::ACCESS_SHAREDOWNER;
$sharees[0]->inviteStatus = Plugin::INVITE_ACCEPTED;
$sharees[1]->href = 'mailto:bar@example.org';
$sharees[1]->access = Plugin::ACCESS_READ;
$sharees[1]->inviteStatus = Plugin::INVITE_DECLINED;
$sharees[2]->href = 'mailto:baz@example.org';
$sharees[2]->access = Plugin::ACCESS_READWRITE;
$sharees[2]->inviteStatus = Plugin::INVITE_NORESPONSE;
$sharees[3]->href = 'mailto:zim@example.org';
$sharees[3]->access = Plugin::ACCESS_READWRITE;
$sharees[3]->inviteStatus = Plugin::INVITE_INVALID;
$invite = new Invite($sharees);
$xml = $this->write(['{DAV:}root' => $invite]);
$expected = <<<XML
<?xml version="1.0"?>
<d:root xmlns:d="DAV:">
<d:sharee>
<d:href>mailto:foo@example.org</d:href>
<d:prop>
<d:displayname>Foo Bar</d:displayname>
</d:prop>
<d:share-access><d:shared-owner /></d:share-access>
<d:invite-accepted/>
</d:sharee>
<d:sharee>
<d:href>mailto:bar@example.org</d:href>
<d:prop />
<d:share-access><d:read /></d:share-access>
<d:invite-declined/>
</d:sharee>
<d:sharee>
<d:href>mailto:baz@example.org</d:href>
<d:prop />
<d:share-access><d:read-write /></d:share-access>
<d:invite-noresponse/>
</d:sharee>
<d:sharee>
<d:href>mailto:zim@example.org</d:href>
<d:prop />
<d:share-access><d:read-write /></d:share-access>
<d:invite-invalid/>
</d:sharee>
</d:root>
XML;
$this->assertXmlStringEqualsXmlString($expected, $xml);
}
}