ILIAS
release_5-4 Revision v5.4.26-12-gabc799a52e6
◀ ilDoc Overview
SupportedCalendarComponentSetTest.php
Go to the documentation of this file.
1
<?
php
2
3
namespace
Sabre\CalDAV\Xml\Property
;
4
5
use
Sabre\CalDAV
;
6
use
Sabre\DAV
;
7
8
class
SupportedCalendarComponentSetTest
extends
DAV\Xml\XmlTest
{
9
10
function
setUp
() {
11
12
$this->namespaceMap[
CalDAV\Plugin::NS_CALDAV
] =
'cal'
;
13
$this->namespaceMap[
CalDAV\Plugin::NS_CALENDARSERVER
] =
'cs'
;
14
15
}
16
17
function
testSimple
() {
18
19
$prop =
new
SupportedCalendarComponentSet
([
'VEVENT'
]);
20
$this->assertEquals(
21
[
'VEVENT'
],
22
$prop->getValue()
23
);
24
25
}
26
27
function
testMultiple
() {
28
29
$prop =
new
SupportedCalendarComponentSet
([
'VEVENT'
,
'VTODO'
]);
30
$this->assertEquals(
31
[
'VEVENT'
,
'VTODO'
],
32
$prop->getValue()
33
);
34
35
}
36
41
function
testSerialize
() {
42
43
$property =
new
SupportedCalendarComponentSet
([
'VEVENT'
,
'VTODO'
]);
44
$xml
= $this->
write
([
'{DAV:}root'
=> $property]);
45
46
$this->assertXmlStringEqualsXmlString(
47
'<?xml version="1.0"?>
48
<d:root xmlns:d="DAV:" xmlns:cal="'
. CalDAV\
Plugin::NS_CALDAV
.
'" xmlns:cs="'
. CalDAV\
Plugin::NS_CALENDARSERVER
.
'">
49
<cal:comp name="VEVENT"/>
50
<cal:comp name="VTODO"/>
51
</d:root>
52
'
,
$xml
);
53
54
}
55
56
function
testUnserialize
() {
57
58
$cal =
CalDAV\Plugin::NS_CALDAV
;
59
$cs =
CalDAV\Plugin::NS_CALENDARSERVER
;
60
61
$xml
= <<<XML
62
<?xml version=
"1.0"
?>
63
<d:root xmlns:cal=
"$cal"
xmlns:cs=
"$cs"
xmlns:d=
"DAV:"
>
64
<cal:comp name=
"VEVENT"
/>
65
<cal:comp name=
"VTODO"
/>
66
</d:root>
67
XML;
68
69
$result
= $this->
parse
(
70
$xml
,
71
[
'{DAV:}root'
=>
'Sabre\\CalDAV\\Xml\\Property\\SupportedCalendarComponentSet'
]
72
);
73
74
$this->assertEquals(
75
new
SupportedCalendarComponentSet
([
'VEVENT'
,
'VTODO'
]),
76
$result
[
'value'
]
77
);
78
79
}
80
84
function
testUnserializeEmpty
() {
85
86
$cal =
CalDAV\Plugin::NS_CALDAV
;
87
$cs =
CalDAV\Plugin::NS_CALENDARSERVER
;
88
89
$xml
= <<<XML
90
<?xml version=
"1.0"
?>
91
<d:root xmlns:cal=
"$cal"
xmlns:cs=
"$cs"
xmlns:d=
"DAV:"
>
92
</d:root>
93
XML;
94
95
$result
= $this->
parse
(
96
$xml
,
97
[
'{DAV:}root'
=>
'Sabre\\CalDAV\\Xml\\Property\\SupportedCalendarComponentSet'
]
98
);
99
100
}
101
102
}
Sabre\DAV
$result
$result
Definition:
CleanUpTest.php:463
Sabre\CalDAV\Xml\Property\SupportedCalendarComponentSet
SupportedCalendarComponentSet property.
Definition:
SupportedCalendarComponentSet.php:24
Sabre\CalDAV\Xml\Property\SupportedCalendarComponentSetTest\testSerialize
testSerialize()
testSimple testMultiple
Definition:
SupportedCalendarComponentSetTest.php:41
Sabre\DAV\Xml\XmlTest
Definition:
XmlTest.php:8
Sabre\DAV\Xml\XmlTest\parse
parse($xml, array $elementMap=[])
Definition:
XmlTest.php:26
Sabre\CalDAV\Xml\Property\SupportedCalendarComponentSetTest\testUnserializeEmpty
testUnserializeEmpty()
Definition:
SupportedCalendarComponentSetTest.php:84
Sabre\CalDAV\Plugin\NS_CALENDARSERVER
const NS_CALENDARSERVER
This is the namespace for the proprietary calendarserver extensions.
Definition:
Plugin.php:38
Sabre\CalDAV
Sabre\CalDAV\Xml\Property\SupportedCalendarComponentSetTest\testSimple
testSimple()
Definition:
SupportedCalendarComponentSetTest.php:17
Sabre\CalDAV\Xml\Property
Definition:
AllowedSharingModes.php:3
Sabre\CalDAV\Xml\Property\SupportedCalendarComponentSetTest\setUp
setUp()
Definition:
SupportedCalendarComponentSetTest.php:10
$xml
$xml
Definition:
fetch_windows_zones.php:11
Sabre\CalDAV\Xml\Property\SupportedCalendarComponentSetTest
Definition:
SupportedCalendarComponentSetTest.php:8
Sabre\CalDAV\Xml\Property\SupportedCalendarComponentSetTest\testMultiple
testMultiple()
Definition:
SupportedCalendarComponentSetTest.php:27
php
Sabre\CalDAV\Plugin\NS_CALDAV
const NS_CALDAV
This is the official CalDAV namespace.
Definition:
Plugin.php:33
Sabre\CalDAV\Xml\Property\SupportedCalendarComponentSetTest\testUnserialize
testUnserialize()
Definition:
SupportedCalendarComponentSetTest.php:56
Sabre\DAV\Xml\XmlTest\write
write($input)
Definition:
XmlTest.php:14
libs
composer
vendor
sabre
dav
tests
Sabre
CalDAV
Xml
Property
SupportedCalendarComponentSetTest.php
Generated on Thu Jan 16 2025 19:01:52 for ILIAS by
1.8.13 (using
Doxyfile
)