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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
|
<?php
/**
* @category Horde
* @package Icalendar
* @subpackage UnitTests
*/
/**
* @category Horde
* @package Icalendar
* @subpackage UnitTests
*/
class Horde_Icalendar_AttributeTest extends Horde_Test_Case
{
public function testDates()
{
$ical = new Horde_Icalendar();
$ical->parsevCalendar(file_get_contents(__DIR__ . '/fixtures/date.ics'));
$this->assertEquals(
0,
$ical->getComponent(0)->getAttribute('DTSTART')
);
$this->assertEquals(
'BORKED',
$ical->getComponent(0)->getAttribute('DTEND')
);
}
public function testOrg()
{
$ical = new Horde_Icalendar();
$ical->parsevCalendar(file_get_contents(__DIR__ . '/fixtures/org.vcf'));
$this->assertEquals(
array(
'My Organization',
'My Unit'
),
$ical->getComponent(0)->getAttributeValues('ORG')
);
}
public function testGeo()
{
$ical = new Horde_Icalendar();
$ical->parsevCalendar(file_get_contents(__DIR__ . '/fixtures/geo1.vcf'));
$this->assertEquals(
array(
'latitude' => -17.87,
'longitude' => 37.24,
),
$ical->getComponent(0)->getAttribute('GEO')
);
$ical->parsevCalendar(file_get_contents(__DIR__ . '/fixtures/geo2.vcf'));
$this->assertEquals(
array(
'latitude' => 37.386013,
'longitude' => -122.082932,
),
$ical->getComponent(0)->getAttribute('GEO')
);
}
}
|