EmptyValueIssueTest.php 654 B

12345678910111213141516171819202122232425262728293031
  1. <?php
  2. namespace Sabre\VObject;
  3. /**
  4. * This test is written for Issue 68:
  5. *
  6. * https://github.com/fruux/sabre-vobject/issues/68
  7. */
  8. class EmptyValueIssueTest extends \PHPUnit_Framework_TestCase {
  9. function testDecodeValue() {
  10. $input = <<<ICS
  11. BEGIN:VCALENDAR
  12. VERSION:2.0
  13. BEGIN:VEVENT
  14. DESCRIPTION:This is a descpription\\nwith a linebreak and a \\; \\, and :
  15. END:VEVENT
  16. END:VCALENDAR
  17. ICS;
  18. $vobj = Reader::read($input);
  19. // Before this bug was fixed, getValue() would return nothing.
  20. $this->assertEquals("This is a descpription\nwith a linebreak and a ; , and :", $vobj->VEVENT->DESCRIPTION->getValue());
  21. }
  22. }