16 $this->assertNull($principal->getHref());
20 $this->assertNull($principal->getHref());
24 $this->assertEquals(
'admin/', $principal->getHref());
47 $this->assertXmlStringEqualsXmlString(
'
48<d:principal xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns">
50</d:principal>',
$xml);
63 $this->assertXmlStringEqualsXmlString(
'
64<d:principal xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns">
66</d:principal>',
$xml);
77 $xml = (
new DAV\Server())->xml->write(
'{DAV:}principal', $prin,
'/');
79 $this->assertXmlStringEqualsXmlString(
'
80<d:principal xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns">
81<d:href>/principals/admin/</d:href>
82</d:principal>',
$xml);
88 $xml =
'<?xml version="1.0"?>
89<d:principal xmlns:d="DAV:">' .
90'<d:href>/principals/admin</d:href>' .
95 $this->assertEquals(
'/principals/admin/', $principal->getHref());
101 $xml =
'<?xml version="1.0"?>
102<d:principal xmlns:d="DAV:">' .
103' <d:authenticated />' .
113 $xml =
'<?xml version="1.0"?>
114<d:principal xmlns:d="DAV:">' .
115' <d:unauthenticated />' .
128 $xml =
'<?xml version="1.0"?>
129<d:principal xmlns:d="DAV:">' .
140 $reader->elementMap[
'{DAV:}principal'] =
'Sabre\\DAVACL\\Xml\\Property\\Principal';
155 $this->assertXmlStringEqualsXmlString(
172 '<em>unauthenticated</em>',
176 '<em>authenticated</em>',
184 '<a href="/principals/admin/">/principals/admin/</a>',
An exception for terminatinating execution or to throw for unit testing.
testSerializeAuthenticated()
@depends testSerializeUnAuthenticated
testUnserializeUnknown()
@expectedException Sabre\DAV\Exception\BadRequest
testNoHref()
@depends testSimple @expectedException Sabre\DAV\Exception
testSerializeHref()
@depends testSerializeUnAuthenticated
testSerializeUnAuthenticated()
@depends testSimple
testToHtml($principal, $output)
@depends testSimple @dataProvider htmlProvider
htmlProvider()
Provides data for the html tests.
testUnserializeAuthenticated()
testUnserializeUnauthenticated()
const UNAUTHENTICATED
To specify a not-logged-in user, use the UNAUTHENTICATED principal.
const ALL
Everybody, basically.
const HREF
Specific principals can be specified with the HREF.
const AUTHENTICATED
To specify any principal that is logged in, use AUTHENTICATED.
This class provides a few utility functions for easily generating HTML for the browser plugin.
The Reader class expands upon PHP's built-in XMLReader.