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

Public Member Functions

 testInTimeRange (VJournal $vtodo, $start, $end, $outcome)
 @dataProvider timeRangeTestData More...
 
 testValidate ()
 
 testValidateBroken ()
 
 timeRangeTestData ()
 

Detailed Description

Definition at line 9 of file VJournalTest.php.

Member Function Documentation

◆ testInTimeRange()

Sabre\VObject\Component\VJournalTest::testInTimeRange ( VJournal  $vtodo,
  $start,
  $end,
  $outcome 
)

@dataProvider timeRangeTestData

Definition at line 14 of file VJournalTest.php.

14 {
15
16 $this->assertEquals($outcome, $vtodo->isInTimeRange($start, $end));
17
18 }
$start
Definition: bench.php:8

References $end, $start, and Sabre\VObject\Component\VJournal\isInTimeRange().

+ Here is the call graph for this function:

◆ testValidate()

Sabre\VObject\Component\VJournalTest::testValidate ( )

Definition at line 20 of file VJournalTest.php.

20 {
21
22 $input = <<<HI
23BEGIN:VCALENDAR
24VERSION:2.0
25PRODID:YoYo
26BEGIN:VJOURNAL
27UID:12345678
28DTSTAMP:20140402T174100Z
29END:VJOURNAL
30END:VCALENDAR
31HI;
32
33 $obj = Reader::read($input);
34
35 $warnings = $obj->validate();
36 $messages = [];
37 foreach ($warnings as $warning) {
38 $messages[] = $warning['message'];
39 }
40
41 $this->assertEquals([], $messages);
42
43 }
$warning
Definition: X509warning.php:13
static read($data, $options=0, $charset='UTF-8')
Parses a vCard or iCalendar object, and returns the top component.
Definition: Reader.php:42
$messages
Definition: en.php:5
foreach($paths as $path) if($argc< 3) $input

References Sabre\VObject\$input, $messages, $warning, $warnings, and Sabre\VObject\Reader\read().

+ Here is the call graph for this function:

◆ testValidateBroken()

Sabre\VObject\Component\VJournalTest::testValidateBroken ( )

Definition at line 45 of file VJournalTest.php.

45 {
46
47 $input = <<<HI
48BEGIN:VCALENDAR
49VERSION:2.0
50PRODID:YoYo
51BEGIN:VJOURNAL
52UID:12345678
53DTSTAMP:20140402T174100Z
54URL:http://example.org/
55URL:http://example.com/
56END:VJOURNAL
57END:VCALENDAR
58HI;
59
60 $obj = Reader::read($input);
61
62 $warnings = $obj->validate();
63 $messages = [];
64 foreach ($warnings as $warning) {
65 $messages[] = $warning['message'];
66 }
67
68 $this->assertEquals(
69 ["URL MUST NOT appear more than once in a VJOURNAL component"],
71 );
72
73 }
static http()
Fetches the global http state from ILIAS.

References Sabre\VObject\$input, $messages, $warning, $warnings, ILIAS\FileDelivery\http(), and Sabre\VObject\Reader\read().

+ Here is the call graph for this function:

◆ timeRangeTestData()

Sabre\VObject\Component\VJournalTest::timeRangeTestData ( )

Definition at line 75 of file VJournalTest.php.

75 {
76
77 $calendar = new VCalendar();
78
79 $tests = [];
80
81 $vjournal = $calendar->createComponent('VJOURNAL');
82 $vjournal->DTSTART = '20111223T120000Z';
83 $tests[] = [$vjournal, new \DateTime('2011-01-01'), new \DateTime('2012-01-01'), true];
84 $tests[] = [$vjournal, new \DateTime('2011-01-01'), new \DateTime('2011-11-01'), false];
85
86 $vjournal2 = $calendar->createComponent('VJOURNAL');
87 $vjournal2->DTSTART = '20111223';
88 $vjournal2->DTSTART['VALUE'] = 'DATE';
89 $tests[] = [$vjournal2, new \DateTime('2011-01-01'), new \DateTime('2012-01-01'), true];
90 $tests[] = [$vjournal2, new \DateTime('2011-01-01'), new \DateTime('2011-11-01'), false];
91
92 $vjournal3 = $calendar->createComponent('VJOURNAL');
93 $tests[] = [$vjournal3, new \DateTime('2011-01-01'), new \DateTime('2012-01-01'), false];
94 $tests[] = [$vjournal3, new \DateTime('2011-01-01'), new \DateTime('2011-11-01'), false];
95
96 return $tests;
97 }
$tests
Definition: bench.php:104

References $calendar, and $tests.


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