AttachParseTest.php 635 B

12345678910111213141516171819202122232425262728293031
  1. <?php
  2. namespace Sabre\VObject\ICalendar;
  3. use Sabre\VObject\Reader;
  4. class AttachParseTest extends \PHPUnit_Framework_TestCase {
  5. /**
  6. * See issue #128 for more info.
  7. */
  8. function testParseAttach() {
  9. $vcal = <<<ICS
  10. BEGIN:VCALENDAR
  11. BEGIN:VEVENT
  12. ATTACH;FMTTYPE=application/postscript:ftp://example.com/pub/reports/r-960812.ps
  13. END:VEVENT
  14. END:VCALENDAR
  15. ICS;
  16. $vcal = Reader::read($vcal);
  17. $prop = $vcal->VEVENT->ATTACH;
  18. $this->assertInstanceOf('Sabre\\VObject\\Property\\URI', $prop);
  19. $this->assertEquals('ftp://example.com/pub/reports/r-960812.ps', $prop->getValue());
  20. }
  21. }