VCard21Test.php 753 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <?php
  2. namespace Sabre\VObject;
  3. /**
  4. * Assorted vcard 2.1 tests.
  5. */
  6. class VCard21Test extends \PHPUnit_Framework_TestCase {
  7. function testPropertyWithNoName() {
  8. $input = <<<VCF
  9. BEGIN:VCARD\r
  10. VERSION:2.1\r
  11. EMAIL;HOME;WORK:evert@fruux.com\r
  12. END:VCARD\r
  13. VCF;
  14. $vobj = Reader::read($input);
  15. $output = $vobj->serialize($input);
  16. $this->assertEquals($input, $output);
  17. }
  18. function testPropertyPadValueCount() {
  19. $input = <<<VCF
  20. BEGIN:VCARD
  21. VERSION:2.1
  22. N:Foo
  23. END:VCARD
  24. VCF;
  25. $vobj = Reader::read($input);
  26. $output = $vobj->serialize($input);
  27. $expected = <<<VCF
  28. BEGIN:VCARD\r
  29. VERSION:2.1\r
  30. N:Foo;;;;\r
  31. END:VCARD\r
  32. VCF;
  33. $this->assertEquals($expected, $output);
  34. }
  35. }