diff --git a/examples/example1.php b/examples/example1.php index a4004419..945c0852 100644 --- a/examples/example1.php +++ b/examples/example1.php @@ -31,8 +31,8 @@ ->setDescription('Lorem Ipsum Dolor...') ->setOccurrence( new TimeSpan( - new DateTime(DateTimeImmutable::createFromFormat('Y-m-d H:i:s', '2030-12-24 13:30:00'), false), - new DateTime(DateTimeImmutable::createFromFormat('Y-m-d H:i:s', '2030-12-24 14:30:00'), false) + new DateTime(DateTimeImmutable::createFromFormat('Y-m-d H:i:s', '2030-12-24 13:30:00'), true), + new DateTime(DateTimeImmutable::createFromFormat('Y-m-d H:i:s', '2030-12-24 14:30:00'), true) ) ) ->addAlarm( diff --git a/src/Presentation/Component/Property.php b/src/Presentation/Component/Property.php index c2794a10..2a8e48c1 100644 --- a/src/Presentation/Component/Property.php +++ b/src/Presentation/Component/Property.php @@ -42,7 +42,7 @@ public function __toString(): string $string = $this->name; if (count($this->parameters) > 0) { - $string .= ':' . implode(';', array_map('strval', $this->parameters)); + $string .= ';' . implode(';', array_map('strval', $this->parameters)); } return $string . ':' . $this->value; diff --git a/tests/Unit/Presentation/Component/PropertyTest.php b/tests/Unit/Presentation/Component/PropertyTest.php index 1a85684f..2cc74d0f 100644 --- a/tests/Unit/Presentation/Component/PropertyTest.php +++ b/tests/Unit/Presentation/Component/PropertyTest.php @@ -42,7 +42,7 @@ public function provideTestData() [ new Parameter('TEST', new TextValue('value')), ], - 'LOREM:TEST=value:Ipsum', + 'LOREM;TEST=value:Ipsum', ]; yield 'property with multiple parameters' => [ @@ -52,7 +52,7 @@ public function provideTestData() new Parameter('TEST', new TextValue('value')), new Parameter('TEST2', new TextValue('value2')), ], - 'LOREM:TEST=value;TEST2=value2:Ipsum', + 'LOREM;TEST=value;TEST2=value2:Ipsum', ]; } } diff --git a/tests/Unit/Presentation/Factory/AlarmFactoryTest.php b/tests/Unit/Presentation/Factory/AlarmFactoryTest.php index c804e3f0..f7173ac4 100644 --- a/tests/Unit/Presentation/Factory/AlarmFactoryTest.php +++ b/tests/Unit/Presentation/Factory/AlarmFactoryTest.php @@ -34,7 +34,7 @@ public function testAudioAlarm() $expected = implode(ContentLine::LINE_SEPARATOR, [ 'BEGIN:VALARM', 'ACTION:AUDIO', - 'TRIGGER:VALUE=DATE-TIME:20200930T000000', + 'TRIGGER;VALUE=DATE-TIME:20200930T000000', 'END:VALARM', ]); @@ -58,7 +58,7 @@ public function testEmailAlarm() 'ACTION:EMAIL', 'SUMMARY:Summary Text', 'DESCRIPTION:Description Text', - 'TRIGGER:VALUE=DATE-TIME:20200930T000000', + 'TRIGGER;VALUE=DATE-TIME:20200930T000000', 'END:VALARM', ]); @@ -81,7 +81,7 @@ public function testDisplayAlarm() 'BEGIN:VALARM', 'ACTION:DISPLAY', 'DESCRIPTION:Description Text', - 'TRIGGER:VALUE=DATE-TIME:20200930T000000', + 'TRIGGER;VALUE=DATE-TIME:20200930T000000', 'END:VALARM', ]); @@ -125,7 +125,7 @@ public function testRepeat() $expected = implode(ContentLine::LINE_SEPARATOR, [ 'BEGIN:VALARM', 'ACTION:AUDIO', - 'TRIGGER:VALUE=DATE-TIME:20200930T000000', + 'TRIGGER;VALUE=DATE-TIME:20200930T000000', 'REPEAT:3', 'DURATION:P1D', 'END:VALARM', diff --git a/tests/Unit/Presentation/Factory/DateTimeFactoryTest.php b/tests/Unit/Presentation/Factory/DateTimeFactoryTest.php index be67ca14..c261cace 100644 --- a/tests/Unit/Presentation/Factory/DateTimeFactoryTest.php +++ b/tests/Unit/Presentation/Factory/DateTimeFactoryTest.php @@ -25,6 +25,6 @@ public function testCreateProperty(): void $property = (new DateTimeFactory())->createProperty('DTSTART', $dateTime); - self::assertSame('DTSTART:TZID=Europe/Berlin:20210122T111213', $property->__toString()); + self::assertSame('DTSTART;TZID=Europe/Berlin:20210122T111213', $property->__toString()); } } diff --git a/tests/Unit/Presentation/Factory/EventFactoryTest.php b/tests/Unit/Presentation/Factory/EventFactoryTest.php index b7de76aa..edbbc945 100644 --- a/tests/Unit/Presentation/Factory/EventFactoryTest.php +++ b/tests/Unit/Presentation/Factory/EventFactoryTest.php @@ -127,7 +127,7 @@ public function testUrlAttachments() ); self::assertEventRendersCorrect($event, [ - 'ATTACH:FMTTYPE=text/plain:http://example.com/document.txt', + 'ATTACH;FMTTYPE=text/plain:http://example.com/document.txt', ]); } @@ -142,7 +142,7 @@ public function testFileAttachments() ); self::assertEventRendersCorrect($event, [ - 'ATTACH:FMTTYPE=text/plain;ENCODING=BASE64;VALUE=BINARY:SGVsbG8gV29ybGQh', + 'ATTACH;FMTTYPE=text/plain;ENCODING=BASE64;VALUE=BINARY:SGVsbG8gV29ybGQh', ]); }