annotate vendor/sabre/vobject/tests/VObject/EmptyValueIssueTest.php @ 7:430dbd5346f7

vendor sabre as distributed
author Charlie Root
date Sat, 13 Jan 2018 09:06:10 -0500
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
1 <?php
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
2
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
3 namespace Sabre\VObject;
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
4
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
5 /**
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
6 * This test is written for Issue 68:
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
7 *
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
8 * https://github.com/fruux/sabre-vobject/issues/68
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
9 */
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
10 class EmptyValueIssueTest extends \PHPUnit_Framework_TestCase {
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
11
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
12 function testDecodeValue() {
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
13
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
14 $input = <<<ICS
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
15 BEGIN:VCALENDAR
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
16 VERSION:2.0
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
17 BEGIN:VEVENT
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
18 DESCRIPTION:This is a descpription\\nwith a linebreak and a \\; \\, and :
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
19 END:VEVENT
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
20 END:VCALENDAR
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
21 ICS;
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
22
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
23 $vobj = Reader::read($input);
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
24
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
25 // Before this bug was fixed, getValue() would return nothing.
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
26 $this->assertEquals("This is a descpription\nwith a linebreak and a ; , and :", $vobj->VEVENT->DESCRIPTION->getValue());
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
27
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
28 }
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
29
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
30 }
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
31