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)
 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 
)

timeRangeTestData

Definition at line 14 of file VJournalTest.php.

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

14  {
15 
16  $this->assertEquals($outcome, $vtodo->isInTimeRange($start, $end));
17 
18  }
$start
Definition: bench.php:8
+ Here is the call graph for this function:

◆ testValidate()

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

Definition at line 20 of file VJournalTest.php.

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

20  {
21 
22  $input = <<<HI
23 BEGIN:VCALENDAR
24 VERSION:2.0
25 PRODID:YoYo
26 BEGIN:VJOURNAL
27 UID:12345678
28 DTSTAMP:20140402T174100Z
29 END:VJOURNAL
30 END:VCALENDAR
31 HI;
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  }
if($argc< 3) $input
$messages
Definition: en.php:5
$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
+ Here is the call graph for this function:

◆ testValidateBroken()

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

Definition at line 45 of file VJournalTest.php.

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

45  {
46 
47  $input = <<<HI
48 BEGIN:VCALENDAR
49 VERSION:2.0
50 PRODID:YoYo
51 BEGIN:VJOURNAL
52 UID:12345678
53 DTSTAMP:20140402T174100Z
54 URL:http://example.org/
55 URL:http://example.com/
56 END:VJOURNAL
57 END:VCALENDAR
58 HI;
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"],
70  $messages
71  );
72 
73  }
if($argc< 3) $input
$messages
Definition: en.php:5
static http()
Fetches the global http state from ILIAS.
$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
+ Here is the call graph for this function:

◆ timeRangeTestData()

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

Definition at line 75 of file VJournalTest.php.

References $calendar, and $tests.

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

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