]> git.mxchange.org Git - friendica-addons.git/blob - dav/SabreDAV/tests/Sabre/VObject/Component/VJournalTest.php
Move friendica-specific parts into an own subdirectory
[friendica-addons.git] / dav / SabreDAV / tests / Sabre / VObject / Component / VJournalTest.php
1 <?php
2
3 class Sabre_VObject_Component_VJournalTest extends PHPUnit_Framework_TestCase {
4
5     /**
6      * @dataProvider timeRangeTestData
7      */
8     public function testInTimeRange(Sabre_VObject_Component_VJournal $vtodo,$start,$end,$outcome) {
9
10         $this->assertEquals($outcome, $vtodo->isInTimeRange($start, $end));
11
12     }
13
14     public function timeRangeTestData() {
15
16         $tests = array();
17
18         $vjournal = Sabre_VObject_Component::create('VJOURNAL');
19         $vjournal->DTSTART = '20111223T120000Z';
20         $tests[] = array($vjournal, new DateTime('2011-01-01'), new DateTime('2012-01-01'), true);
21         $tests[] = array($vjournal, new DateTime('2011-01-01'), new DateTime('2011-11-01'), false);
22
23         $vjournal2 = Sabre_VObject_Component::create('VJOURNAL');
24         $vjournal2->DTSTART = '20111223';
25         $vjournal2->DTSTART['VALUE'] = 'DATE';
26         $tests[] = array($vjournal2, new DateTime('2011-01-01'), new DateTime('2012-01-01'), true);
27         $tests[] = array($vjournal2, new DateTime('2011-01-01'), new DateTime('2011-11-01'), false);
28
29         $vjournal3 = Sabre_VObject_Component::create('VJOURNAL');
30         $tests[] = array($vjournal3, new DateTime('2011-01-01'), new DateTime('2012-01-01'), false);
31         $tests[] = array($vjournal3, new DateTime('2011-01-01'), new DateTime('2011-11-01'), false);
32
33         return $tests;
34     }
35
36 }
37