xref: /plugin/davcal/vendor/sabre/vobject/tests/VObject/EmptyValueIssueTest.php (revision a1a3b6794e0e143a4a8b51d3185ce2d339be61ab)
1*a1a3b679SAndreas Boehler<?php
2*a1a3b679SAndreas Boehler
3*a1a3b679SAndreas Boehlernamespace Sabre\VObject;
4*a1a3b679SAndreas Boehler
5*a1a3b679SAndreas Boehler/**
6*a1a3b679SAndreas Boehler * This test is written for Issue 68:
7*a1a3b679SAndreas Boehler *
8*a1a3b679SAndreas Boehler * https://github.com/fruux/sabre-vobject/issues/68
9*a1a3b679SAndreas Boehler */
10*a1a3b679SAndreas Boehlerclass EmptyValueIssueTest extends \PHPUnit_Framework_TestCase {
11*a1a3b679SAndreas Boehler
12*a1a3b679SAndreas Boehler    function testDecodeValue() {
13*a1a3b679SAndreas Boehler
14*a1a3b679SAndreas Boehler        $input = <<<ICS
15*a1a3b679SAndreas BoehlerBEGIN:VCALENDAR
16*a1a3b679SAndreas BoehlerVERSION:2.0
17*a1a3b679SAndreas BoehlerBEGIN:VEVENT
18*a1a3b679SAndreas BoehlerDESCRIPTION:This is a descpription\\nwith a linebreak and a \\; \\, and :
19*a1a3b679SAndreas BoehlerEND:VEVENT
20*a1a3b679SAndreas BoehlerEND:VCALENDAR
21*a1a3b679SAndreas BoehlerICS;
22*a1a3b679SAndreas Boehler
23*a1a3b679SAndreas Boehler        $vobj = Reader::read($input);
24*a1a3b679SAndreas Boehler
25*a1a3b679SAndreas Boehler        // Before this bug was fixed, getValue() would return nothing.
26*a1a3b679SAndreas Boehler        $this->assertEquals("This is a descpription\nwith a linebreak and a ; , and :", $vobj->VEVENT->DESCRIPTION->getValue());
27*a1a3b679SAndreas Boehler
28*a1a3b679SAndreas Boehler    }
29*a1a3b679SAndreas Boehler
30*a1a3b679SAndreas Boehler}
31*a1a3b679SAndreas Boehler
32