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

Public Member Functions

 testGetDocumentType ()
 
 testConstruct ()
 
 testCreateComponent ()
 
 testCreate ()
 
 testGetClassNameForPropertyValue ()
 
 testDestroy ()
 

Detailed Description

Definition at line 7 of file DocumentTest.php.

Member Function Documentation

◆ testConstruct()

Sabre\VObject\DocumentTest::testConstruct ( )

Definition at line 16 of file DocumentTest.php.

16  {
17 
18  $doc = new MockDocument('VLIST');
19  $this->assertEquals('VLIST', $doc->name);
20 
21  }

◆ testCreate()

Sabre\VObject\DocumentTest::testCreate ( )

Definition at line 47 of file DocumentTest.php.

References $vcal.

47  {
48 
49  $vcal = new Component\VCalendar([], false);
50 
51  $event = $vcal->create('VEVENT');
52  $this->assertInstanceOf('Sabre\VObject\Component\VEvent', $event);
53 
54  $prop = $vcal->create('CALSCALE');
55  $this->assertInstanceOf('Sabre\VObject\Property\Text', $prop);
56 
57  }

◆ testCreateComponent()

Sabre\VObject\DocumentTest::testCreateComponent ( )

Definition at line 23 of file DocumentTest.php.

References $out, and $vcal.

23  {
24 
25  $vcal = new Component\VCalendar([], false);
26 
27  $event = $vcal->createComponent('VEVENT');
28 
29  $this->assertInstanceOf('Sabre\VObject\Component\VEvent', $event);
30  $vcal->add($event);
31 
32  $prop = $vcal->createProperty('X-PROP', '1234256', ['X-PARAM' => '3']);
33  $this->assertInstanceOf('Sabre\VObject\Property', $prop);
34 
35  $event->add($prop);
36 
37  unset(
38  $event->DTSTAMP,
39  $event->UID
40  );
41 
42  $out = $vcal->serialize();
43  $this->assertEquals("BEGIN:VCALENDAR\r\nBEGIN:VEVENT\r\nX-PROP;X-PARAM=3:1234256\r\nEND:VEVENT\r\nEND:VCALENDAR\r\n", $out);
44 
45  }

◆ testDestroy()

Sabre\VObject\DocumentTest::testDestroy ( )

Definition at line 67 of file DocumentTest.php.

References $vcal.

67  {
68 
69  $vcal = new Component\VCalendar([], false);
70  $event = $vcal->createComponent('VEVENT');
71 
72  $this->assertInstanceOf('Sabre\VObject\Component\VEvent', $event);
73  $vcal->add($event);
74 
75  $prop = $vcal->createProperty('X-PROP', '1234256', ['X-PARAM' => '3']);
76 
77  $event->add($prop);
78 
79  $this->assertEquals($event, $prop->parent);
80 
81  $vcal->destroy();
82 
83  $this->assertNull($prop->parent);
84 
85 
86  }

◆ testGetClassNameForPropertyValue()

Sabre\VObject\DocumentTest::testGetClassNameForPropertyValue ( )

Definition at line 59 of file DocumentTest.php.

References $vcal.

59  {
60 
61  $vcal = new Component\VCalendar([], false);
62  $this->assertEquals('Sabre\\VObject\\Property\\Text', $vcal->getClassNameForPropertyValue('TEXT'));
63  $this->assertNull($vcal->getClassNameForPropertyValue('FOO'));
64 
65  }

◆ testGetDocumentType()

Sabre\VObject\DocumentTest::testGetDocumentType ( )

Definition at line 9 of file DocumentTest.php.

References Sabre\VObject\Document\UNKNOWN.

9  {
10 
11  $doc = new MockDocument();
12  $this->assertEquals(Document::UNKNOWN, $doc->getDocumentType());
13 
14  }
const UNKNOWN
Unknown document type.
Definition: Document.php:24

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