ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
Sabre\VObject\Splitter\VCardTest Class Reference
+ Inheritance diagram for Sabre\VObject\Splitter\VCardTest:
+ Collaboration diagram for Sabre\VObject\Splitter\VCardTest:

Public Member Functions

 createStream ($data)
 
 testVCardImportValidVCard ()
 
 testVCardImportWrongType ()
 @expectedException Sabre\VObject\ParseException More...
 
 testVCardImportValidVCardsWithCategories ()
 
 testVCardImportEndOfData ()
 
 testVCardImportCheckInvalidArgumentException ()
 @expectedException \Sabre\VObject\ParseException More...
 
 testVCardImportMultipleValidVCards ()
 
 testImportMultipleSeparatedWithNewLines ()
 
 testVCardImportVCardWithoutUID ()
 

Detailed Description

Definition at line 7 of file VCardTest.php.

Member Function Documentation

◆ createStream()

◆ testImportMultipleSeparatedWithNewLines()

Sabre\VObject\Splitter\VCardTest::testImportMultipleSeparatedWithNewLines ( )

Definition at line 155 of file VCardTest.php.

155 {
156 $data = <<<EOT
157BEGIN:VCARD
158UID:foo
159END:VCARD
160
161
162BEGIN:VCARD
163UID:foo
164END:VCARD
165
166
167EOT;
168 $tempFile = $this->createStream($data);
169 $objects = new VCard($tempFile);
170
171 $count = 0;
172 while ($objects->getNext()) {
173 $count++;
174 }
175 $this->assertEquals(2, $count);
176 }

References $data, and Sabre\VObject\Splitter\VCardTest\createStream().

+ Here is the call graph for this function:

◆ testVCardImportCheckInvalidArgumentException()

Sabre\VObject\Splitter\VCardTest::testVCardImportCheckInvalidArgumentException ( )

@expectedException \Sabre\VObject\ParseException

Definition at line 122 of file VCardTest.php.

122 {
123 $data = <<<EOT
124BEGIN:FOO
125END:FOO
126EOT;
127 $tempFile = $this->createStream($data);
128
129 $objects = new VCard($tempFile);
130 while ($objects->getNext()) { }
131
132 }

References $data, and Sabre\VObject\Splitter\VCardTest\createStream().

+ Here is the call graph for this function:

◆ testVCardImportEndOfData()

Sabre\VObject\Splitter\VCardTest::testVCardImportEndOfData ( )

Definition at line 103 of file VCardTest.php.

103 {
104 $data = <<<EOT
105BEGIN:VCARD
106UID:foo
107END:VCARD
108EOT;
109 $tempFile = $this->createStream($data);
110
111 $objects = new VCard($tempFile);
112 $object = $objects->getNext();
113
114 $this->assertNull($objects->getNext());
115
116
117 }

References $data, and Sabre\VObject\Splitter\VCardTest\createStream().

+ Here is the call graph for this function:

◆ testVCardImportMultipleValidVCards()

Sabre\VObject\Splitter\VCardTest::testVCardImportMultipleValidVCards ( )

Definition at line 134 of file VCardTest.php.

134 {
135 $data = <<<EOT
136BEGIN:VCARD
137UID:foo
138END:VCARD
139BEGIN:VCARD
140UID:foo
141END:VCARD
142EOT;
143 $tempFile = $this->createStream($data);
144
145 $objects = new VCard($tempFile);
146
147 $count = 0;
148 while ($objects->getNext()) {
149 $count++;
150 }
151 $this->assertEquals(2, $count);
152
153 }

References $data, and Sabre\VObject\Splitter\VCardTest\createStream().

+ Here is the call graph for this function:

◆ testVCardImportValidVCard()

Sabre\VObject\Splitter\VCardTest::testVCardImportValidVCard ( )

Definition at line 18 of file VCardTest.php.

18 {
19 $data = <<<EOT
20BEGIN:VCARD
21UID:foo
22END:VCARD
23EOT;
24 $tempFile = $this->createStream($data);
25
26 $objects = new VCard($tempFile);
27
28 $count = 0;
29 while ($objects->getNext()) {
30 $count++;
31 }
32 $this->assertEquals(1, $count);
33
34 }

References $data, and Sabre\VObject\Splitter\VCardTest\createStream().

+ Here is the call graph for this function:

◆ testVCardImportValidVCardsWithCategories()

Sabre\VObject\Splitter\VCardTest::testVCardImportValidVCardsWithCategories ( )

Definition at line 72 of file VCardTest.php.

72 {
73 $data = <<<EOT
74BEGIN:VCARD
75UID:card-in-foo1-and-foo2
76CATEGORIES:foo1,foo2
77END:VCARD
78BEGIN:VCARD
79UID:card-in-foo1
80CATEGORIES:foo1
81END:VCARD
82BEGIN:VCARD
83UID:card-in-foo3
84CATEGORIES:foo3
85END:VCARD
86BEGIN:VCARD
87UID:card-in-foo1-and-foo3
88CATEGORIES:foo1\,foo3
89END:VCARD
90EOT;
91 $tempFile = $this->createStream($data);
92
93 $splitter = new VCard($tempFile);
94
95 $count = 0;
96 while ($object = $splitter->getNext()) {
97 $count++;
98 }
99 $this->assertEquals(4, $count);
100
101 }

References $data, Sabre\VObject\$splitter, and Sabre\VObject\Splitter\VCardTest\createStream().

+ Here is the call graph for this function:

◆ testVCardImportVCardWithoutUID()

Sabre\VObject\Splitter\VCardTest::testVCardImportVCardWithoutUID ( )

Definition at line 178 of file VCardTest.php.

178 {
179 $data = <<<EOT
180BEGIN:VCARD
181END:VCARD
182EOT;
183 $tempFile = $this->createStream($data);
184
185 $objects = new VCard($tempFile);
186
187 $count = 0;
188 while ($objects->getNext()) {
189 $count++;
190 }
191
192 $this->assertEquals(1, $count);
193 }

References $data, and Sabre\VObject\Splitter\VCardTest\createStream().

+ Here is the call graph for this function:

◆ testVCardImportWrongType()

Sabre\VObject\Splitter\VCardTest::testVCardImportWrongType ( )

@expectedException Sabre\VObject\ParseException

Definition at line 39 of file VCardTest.php.

39 {
40 $event[] = <<<EOT
41BEGIN:VEVENT
42UID:foo1
43DTSTAMP:20140122T233226Z
44DTSTART:20140101T050000Z
45END:VEVENT
46EOT;
47
48$event[] = <<<EOT
49BEGIN:VEVENT
50UID:foo2
51DTSTAMP:20140122T233226Z
52DTSTART:20140101T060000Z
53END:VEVENT
54EOT;
55
56 $data = <<<EOT
57BEGIN:VCALENDAR
58$event[0]
59$event[1]
60END:VCALENDAR
61
62EOT;
63 $tempFile = $this->createStream($data);
64
65 $splitter = new VCard($tempFile);
66
67 while ($object = $splitter->getNext()) {
68 }
69
70 }

References $data, Sabre\VObject\$splitter, and Sabre\VObject\Splitter\VCardTest\createStream().

+ Here is the call graph for this function:

The documentation for this class was generated from the following file: