8use PHPUnit\Framework\TestCase;
26 $expected =
new DateInterval(
'P7D');
30 $expected =
new DateInterval(
'PT3M');
31 $expected->invert =
true;
49 $compare =
new DateTimeImmutable(
'2010-03-16 14:14:05',
new DateTimeZone(
'UTC'));
51 $this->assertEquals($compare, $dateTime);
82 $compare =
new DateTimeImmutable(
'2010-03-16 14:14:05',
new DateTimeZone(
'UTC'));
83 $this->assertEquals($compare, $dateTime);
94 $compare =
new DateTimeImmutable(
'2010-12-11 16:00:00',
new DateTimeZone(
'UTC'));
95 $this->assertEquals($compare, $dateTime);
106 $compare =
new DateTimeImmutable(
'2010-03-16 14:14:05',
new DateTimeZone(
'Europe/Amsterdam'));
107 $this->assertEquals($compare, $dateTime);
115 $expected =
new DateTimeImmutable(
'2010-03-16 00:00:00',
new DateTimeZone(
'UTC'));
117 $this->assertEquals($expected, $dateTime);
120 $this->assertEquals($expected, $dateTime);
131 $expected =
new DateTimeImmutable(
'4500-12-31 00:00:00',
new DateTimeZone(
'UTC'));
133 $this->assertEquals($expected, $dateTime);
136 $this->assertEquals($expected, $dateTime);
147 $expected =
new DateTimeImmutable(
'4500-12-31 23:59:59',
new DateTimeZone(
'UTC'));
149 $this->assertEquals($expected, $dateTime);
152 $this->assertEquals($expected, $dateTime);
386 "timezone" =>
'-0800'
392 "2012-11-29T15:10:53Z",
406 "20121129T151053.123Z",
420 "2012-11-29T15:10:53.123Z",
556 $this->assertTrue(
true);
582 'timezone' =>
'+1234'
674 'timezone' =>
'+1234'
An exception for terminatinating execution or to throw for unit testing.
testDateAndOrTime_DateWithMonthDay()
testDateAndOrTime_TimeWithHourSecond()
testDateAndOrTime_DateTimeWithYearMonthDayHour()
testDateAndOrTime_DateWithYearMonth()
testDateAndOrTime_DateWithYearMonthDay()
testDateAndOrTime_TimeWithSecond()
testDateAndOrTime_DateTimeWithDayHourMinuteSecond()
testParseICalendarDuration()
testBadVCardTime()
@expectedException \Sabre\VObject\InvalidDataException
testDateAndOrTime_DateTimeWithMonthDayHour()
testDateAndOrTime_DateTimeWithDayHourZ()
testDateAndOrTime_DateTimeWithDayHourTZ()
testDateAndOrTime_TimeWithHour()
testDateAndOrTime_TimeWithMinuteSecond()
testDateAndOrTime_DateWithMonth()
testParseICalendarDateTimeGreaterThan4000()
Check if a datetime with year > 4000 will not throw an exception.
testParseICalendarDateInvalidDate()
@depends testParseICalendarDate @expectedException \Sabre\VObject\InvalidDataException
testParseICalendarDateGreaterThan4000()
TCheck if a date with year > 4000 will not throw an exception.
testDateAndOrTime_DateWithDay()
testParseICalendarDateTimeBadFormat()
@depends testParseICalendarDateTime @expectedException \Sabre\VObject\InvalidDataException
testParseICalendarDateTime()
testParseICalendarDateTimeUTC()
@depends testParseICalendarDateTime
testParseICalendarDateTimeUTC2()
@depends testParseICalendarDateTime
testBadVCardDate()
@expectedException \Sabre\VObject\InvalidDataException
testParseICalendarDurationFail()
@expectedException \Sabre\VObject\InvalidDataException
testDateAndOrTime_TimeWithMinute()
testVCardDate($input, $output)
@dataProvider vcardDates
testParseICalendarDurationDateInterval()
testDateAndOrTime_DateTimeWithDayHour()
testParseICalendarDateTimeInvalidTime()
@depends testParseICalendarDateTime @expectedException \Sabre\VObject\InvalidDataException
assertDateAndOrTimeEqualsTo($date, $parts)
testParseICalendarDateBadFormat()
@depends testParseICalendarDate @expectedException \Sabre\VObject\InvalidDataException
testDateAndOrTime_TimeWithHourMinute()
testDateAndOrTime_TimeWithSecondZ()
testDateAndOrTime_DateTimeWithDayHourMinute()
testDateAndOrTime_TimeWithSecondTZ()
testParseICalendarDateTimeCustomTimeZone()
@depends testParseICalendarDateTime
static parseVCardDateTime($date)
This method parses a vCard date and or time value.
static parseVCardDateAndOrTime($date)
This method parses a vCard date and or time value.
static parse($date, $referenceTz=null)
Parses either a Date or DateTime, or Duration value.
static parseDuration($duration, $asString=false)
Parses an iCalendar (RFC5545) formatted duration value.
static parseDateTime($dt, DateTimeZone $tz=null)
Parses an iCalendar (rfc5545) formatted datetime and returns a DateTimeImmutable object.
static parseVCardTime($date)
This method parses a vCard TIME value.
static parseDate($date, DateTimeZone $tz=null)
Parses an iCalendar (rfc5545) formatted date and returns a DateTimeImmutable object.
foreach($paths as $path) if($argc< 3) $input