Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
Christopher Szu authored and Christopher Szu committed Jun 16, 2023
1 parent d7c313f commit c019f21
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/Document.php
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,9 @@ public function createProperty($name, $value = null, array $parameters = null, $
if (isset($parameters['VALUE'])) {
$class = $this->getClassNameForPropertyValue($parameters['VALUE']);
if (is_null($class)) {
throw new InvalidDataException('Unsupported VALUE parameter for '.$name.' property. You supplied "'.$parameters['VALUE'].'"');
unset($parameters['VALUE']);
$class = $this->getClassNameForPropertyName($name);
// throw new InvalidDataException('Unsupported VALUE parameter for '.$name.' property. You supplied "'.$parameters['VALUE'].'"');
}
} else {
$class = $this->getClassNameForPropertyName($name);
Expand Down
31 changes: 31 additions & 0 deletions tests/VObject/InvalidValueParamTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?php

namespace Sabre\VObject;

use PHPUnit\Framework\TestCase;

class InvalidValueParamTest extends TestCase
{
public function testWorkaround()
{
$event = <<<ICS
BEGIN:VCALENDAR
VERSION:2.0
BEGIN:VEVENT
DTEND;TZID=Europe/Paris:20170530T220000
DTSTAMP:20230317T130521Z
DTSTART;TZID=Europe/Paris:20170530T200000
LAST-MODIFIED:20230316T155811Z
LOCATION;VALUE=ERROR:ERROR
SEQUENCE:0
STATUS:CONFIRMED
SUMMARY:AG MP3
UID:0171706E-00F4-4846-8B5F-7FBD474A90AC
END:VEVENT
END:VCALENDAR
ICS;

$doc = Reader::read($event);
$this->assertEquals("LOCATION:ERROR\r\n", $doc->VEVENT->LOCATION->serialize());
}
}

0 comments on commit c019f21

Please sign in to comment.