Lines Matching refs:comp

12         $comp = new VCalendar([], false);
14 $sub = $comp->createComponent('VEVENT');
15 $comp->add($sub);
17 $sub = $comp->createComponent('VTODO');
18 $comp->add($sub);
21 foreach ($comp->children() as $key => $subcomponent) {
34 $comp = new VCalendar([], false);
36 $sub = $comp->createComponent('VEVENT');
37 $comp->add($sub);
39 $sub = $comp->createComponent('VTODO');
40 $comp->add($sub);
42 $event = $comp->vevent;
46 $this->assertInternalType('null', $comp->vjournal);
52 $comp = new VCard();
54 $sub = $comp->createProperty('GROUP1.EMAIL', '1@1.com');
55 $comp->add($sub);
57 $sub = $comp->createProperty('GROUP2.EMAIL', '2@2.com');
58 $comp->add($sub);
60 $sub = $comp->createProperty('EMAIL', '3@3.com');
61 $comp->add($sub);
63 $emails = $comp->email;
66 $email1 = $comp->{"group1.email"};
70 $email3 = $comp->{".email"};
78 $comp = new VCalendar();
80 $sub = $comp->createComponent('VEVENT');
81 $comp->add($sub);
83 $sub = $comp->createComponent('VTODO');
84 $comp->add($sub);
86 $this->assertTrue(isset($comp->vevent));
87 $this->assertTrue(isset($comp->vtodo));
88 $this->assertFalse(isset($comp->vjournal));
94 $comp = new VCalendar();
95 $comp->myProp = 'myValue';
97 $this->assertInstanceOf('Sabre\\VObject\\Property', $comp->MYPROP);
98 $this->assertEquals('myValue', (string)$comp->MYPROP);
105 $comp = new VCalendar([], false);
106 $comp->myProp = 'myValue';
107 $comp->myProp = 'myValue';
109 $this->assertEquals(1, count($comp->children()));
110 $this->assertInstanceOf('Sabre\\VObject\\Property', $comp->MYPROP);
111 $this->assertEquals('myValue', (string)$comp->MYPROP);
117 $comp = new VCalendar();
118 $comp->ORG = ['Acme Inc', 'Section 9'];
120 $this->assertInstanceOf('Sabre\\VObject\\Property', $comp->ORG);
121 $this->assertEquals(['Acme Inc', 'Section 9'], $comp->ORG->getParts());
127 $comp = new VCalendar();
130 $comp->myProp = $comp->createComponent('VEVENT');
132 $this->assertEquals(1, count($comp));
134 $this->assertEquals('VEVENT', $comp->VEVENT->name);
140 $comp = new VCalendar([], false);
142 $comp->VEVENT = $comp->createComponent('VEVENT');
143 $comp->VEVENT = $comp->createComponent('VEVENT');
145 $this->assertEquals(1, count($comp->children()));
147 $this->assertEquals('VEVENT', $comp->VEVENT->name);
153 $comp = new VCalendar([], false);
155 $event = $comp->createComponent('VEVENT');
158 $comp->add($event);
163 $comp->add($event2);
165 $this->assertEquals(2, count($comp->children()));
166 $this->assertTrue($comp->vevent[1] instanceof Component);
167 $this->assertEquals('Event 2', (string)$comp->vevent[1]->summary);
173 $comp = new VCalendar();
175 $event = $comp->createComponent('VEVENT');
178 $comp->add($event);
183 $comp->add($event2);
185 $this->assertTrue(isset($comp->vevent[0]));
186 $this->assertTrue(isset($comp->vevent[1]));
195 $comp = new VCalendar();
196 $comp['hey'] = 'hi there';
204 $comp = new VCalendar();
205 unset($comp[0]);
211 $comp = new VCalendar([], false);
213 $comp->add('myprop', 'value');
215 $this->assertEquals(1, count($comp->children()));
217 $bla = $comp->children()[0];
227 $comp = new VCalendar([], false);
229 $comp->add('myprop', 'value', ['param1' => 'value1']);
231 $this->assertEquals(1, count($comp->children()));
233 $bla = $comp->children()[0];
249 $comp = new VCalendar([], false);
251 $comp->add($comp->createComponent('VEVENT'));
253 $this->assertEquals(1, count($comp->children()));
255 $this->assertEquals('VEVENT', $comp->VEVENT->name);
261 $comp = new VCalendar([], false);
263 $comp->add($comp->createComponent('VEVENT'));
264 $comp->add($comp->createComponent('VEVENT'));
266 $this->assertEquals(2, count($comp->children()));
268 $this->assertEquals('VEVENT', $comp->VEVENT->name);
277 $comp = new VCalendar();
278 $comp->add($comp->createComponent('VEVENT'), 'hello');
287 $comp = new VCalendar();
288 $comp->add([]);
294 $comp = new VCalendar([], false);
295 $comp->add($comp->createComponent('VEVENT'));
297 unset($comp->vevent);
299 $this->assertEquals(0, count($comp->children()));
306 $comp = new VCalendar();
307 $this->assertEquals(1, $comp->count());
313 $comp = new VCalendar([], false);
316 $comp->add($comp->createComponent('VEVENT'));
317 $comp->add($comp->createComponent('VTODO'));
319 $r = $comp->children();
326 $comp = new VCalendar();
328 $comp->add($comp->createProperty('FOO', 'BAR'));
329 $comp->add($comp->createComponent('VTODO'));
331 $r = $comp->getComponents();
339 $comp = new VCalendar([], false);
340 $this->assertEquals("BEGIN:VCALENDAR\r\nEND:VCALENDAR\r\n", $comp->serialize());
346 $comp = new VCalendar([], false);
347 $event = $comp->add($comp->createComponent('VEVENT'));
349 $todo = $comp->add($comp->createComponent('VTODO'));
352 $str = $comp->serialize();
360 $comp = new VCalendar([], false);
361 $comp->add($event = $comp->createComponent('VEVENT'));
362 $comp->add('PROP1', 'BLABLA');
363 $comp->add('VERSION', '2.0');
364 $comp->add($comp->createComponent('VTIMEZONE'));
367 $str = $comp->serialize();
377 $comp = new VCard([], false);
379 $comp->__set('SOMEPROP', 'FOO');
380 $comp->__set('ANOTHERPROP', 'FOO');
381 $comp->__set('THIRDPROP', 'FOO');
383 $comp->add('PROP4', 'FOO ' . $prop4);
385 $comp->__set('PROPNUMBERFIVE', 'FOO');
386 $comp->__set('PROPNUMBERSIX', 'FOO');
387 $comp->__set('PROPNUMBERSEVEN', 'FOO');
388 $comp->__set('PROPNUMBEREIGHT', 'FOO');
389 $comp->__set('PROPNUMBERNINE', 'FOO');
390 $comp->__set('PROPNUMBERTEN', 'FOO');
391 $comp->__set('VERSION', '2.0');
392 $comp->__set('UID', 'FOO');
394 $str = $comp->serialize();
402 $comp = new VCard([
407 $this->assertEquals(['Acme Inc.', 'Section 9'], $comp->ORG->getParts());
408 $this->assertEquals('Finn The Human', $comp->FN->getValue());
414 $comp = new VCalendar();
415 $event = $comp->createComponent('VEVENT', [
416 $comp->createProperty('UID', '12345'),
418 $comp->add($event);
420 $this->assertEquals('12345', $comp->VEVENT->UID->getValue());
426 $comp = new VCalendar([], false);
427 $comp->add('prop1', 'val1');
428 $comp->add('prop2', 'val2');
429 $comp->add('prop2', 'val2');
431 $comp->remove('prop2');
432 $this->assertFalse(isset($comp->prop2));
433 $this->assertTrue(isset($comp->prop1));
439 $comp = new VCalendar([], false);
440 $comp->add('prop1', 'val1');
441 $prop = $comp->add('prop2', 'val2');
443 $comp->remove($prop);
444 $this->assertFalse(isset($comp->prop2));
445 $this->assertTrue(isset($comp->prop1));
454 $comp = new VCalendar([], false);
455 $prop = $comp->createProperty('A', 'B');
456 $comp->remove($prop);