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

Public Member Functions

 testSimple ()
 
 testTimezone ()
 
 testFastForward ()
 

Detailed Description

Definition at line 9 of file RDateIteratorTest.php.

Member Function Documentation

◆ testFastForward()

Sabre\VObject\Recur\RDateIteratorTest::testFastForward ( )

Definition at line 53 of file RDateIteratorTest.php.

References $result.

53  {
54 
55  $utc = new DateTimeZone('UTC');
56  $it = new RDateIterator('20140901T000000Z,20141001T000000Z', new DateTimeImmutable('2014-08-01 00:00:00', $utc));
57 
58  $it->fastForward(new DateTimeImmutable('2014-08-15 00:00:00'));
59 
60  $result = [];
61  while ($it->valid()) {
62  $result[] = $it->current();
63  $it->next();
64  }
65 
66  $expected = [
67  new DateTimeImmutable('2014-09-01 00:00:00', $utc),
68  new DateTimeImmutable('2014-10-01 00:00:00', $utc),
69  ];
70 
71  $this->assertEquals(
72  $expected,
73  $result
74  );
75 
76  $this->assertFalse($it->isInfinite());
77 
78  }
$result

◆ testSimple()

Sabre\VObject\Recur\RDateIteratorTest::testSimple ( )

Definition at line 11 of file RDateIteratorTest.php.

11  {
12 
13  $utc = new DateTimeZone('UTC');
14  $it = new RDateIterator('20140901T000000Z,20141001T000000Z', new DateTimeImmutable('2014-08-01 00:00:00', $utc));
15 
16  $expected = [
17  new DateTimeImmutable('2014-08-01 00:00:00', $utc),
18  new DateTimeImmutable('2014-09-01 00:00:00', $utc),
19  new DateTimeImmutable('2014-10-01 00:00:00', $utc),
20  ];
21 
22  $this->assertEquals(
23  $expected,
24  iterator_to_array($it)
25  );
26 
27  $this->assertFalse($it->isInfinite());
28 
29  }

◆ testTimezone()

Sabre\VObject\Recur\RDateIteratorTest::testTimezone ( )

Definition at line 31 of file RDateIteratorTest.php.

References $tz.

31  {
32 
33  $tz = new DateTimeZone('Europe/Berlin');
34  $it = new RDateIterator('20140901T000000,20141001T000000', new DateTimeImmutable('2014-08-01 00:00:00', $tz));
35 
36  $expected = [
37  new DateTimeImmutable('2014-08-01 00:00:00', $tz),
38  new DateTimeImmutable('2014-09-01 00:00:00', $tz),
39  new DateTimeImmutable('2014-10-01 00:00:00', $tz),
40  ];
41 
42  $this->assertEquals(
43  $expected,
44  iterator_to_array($it)
45  );
46 
47 
48  $this->assertFalse($it->isInfinite());
49 
50  }

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