Blame view

sources/3rdparty/sabre/vobject/tests/Sabre/VObject/DocumentTest.php 686 Bytes
6d9380f96   Cédric Dupont   Update sources OC...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
  <?php
  
  namespace Sabre\VObject;
  
  class DocumentTest extends \PHPUnit_Framework_TestCase {
  
      function testCreateComponent() {
  
          $vcal = new Component\VCalendar();
  
          $event = $vcal->createComponent('VEVENT');
  
          $this->assertInstanceOf('Sabre\VObject\Component\VEvent', $event);
          $vcal->add($event);
  
          $prop = $vcal->createProperty('X-PROP','1234256',array('X-PARAM' => '3'));
          $this->assertInstanceOf('Sabre\VObject\Property', $prop);
  
          $event->add($prop);
  
          $out = $vcal->serialize();
          $this->assertEquals("BEGIN:VCALENDAR\r
  BEGIN:VEVENT\r
  X-PROP;X-PARAM=3:1234256\r
  END:VEVENT\r
  END:VCALENDAR\r
  ", $out);
  
      }
  
  }