convert(Document::VCARD40); $this->assertVObjectEqualsVObject( $output, $vcard ); } public function testConvert40to40() { $input = <<convert(Document::VCARD40); $this->assertVObjectEqualsVObject( $output, $vcard ); } public function testConvert21to40() { $input = <<convert(Document::VCARD40); $this->assertVObjectEqualsVObject( $output, $vcard ); } public function testConvert30to30() { $input = <<convert(Document::VCARD30); $this->assertVObjectEqualsVObject( $output, $vcard ); } public function testConvert40to30() { $input = <<convert(Document::VCARD30); $this->assertVObjectEqualsVObject( $output, $vcard ); } public function testConvertGroupCard() { $input = <<convert(Document::VCARD40); $this->assertVObjectEqualsVObject( $output, $vcard ); $input = $output; $output = <<convert(Document::VCARD30); $this->assertVObjectEqualsVObject( $output, $vcard ); } public function testBDAYConversion() { $input = <<convert(Document::VCARD40); $this->assertVObjectEqualsVObject( $output, $vcard ); $input = $output; $output = <<convert(Document::VCARD30); $this->assertVObjectEqualsVObject( $output, $vcard ); } /** * @expectedException \InvalidArgumentException */ public function testUnknownSourceVCardVersion() { $input = <<convert(Document::VCARD40); } /** * @expectedException \InvalidArgumentException */ public function testUnknownTargetVCardVersion() { $input = <<convert(Document::VCARD21); } public function testConvertIndividualCard() { $input = <<convert(Document::VCARD30); $this->assertVObjectEqualsVObject( $output, $vcard ); $input = $output; $output = <<convert(Document::VCARD40); $this->assertVObjectEqualsVObject( $output, $vcard ); } public function testAnniversary() { $input = <<!$_ ITEM1.X-ANNIVERSARY;VALUE=DATE-AND-OR-TIME:20081210 END:VCARD OUT; $vcard = Reader::read($input); $vcard = $vcard->convert(Document::VCARD30); $this->assertVObjectEqualsVObject( $output, $vcard ); // Swapping input and output list( $input, $output ) = [ $output, $input, ]; $vcard = Reader::read($input); $vcard = $vcard->convert(Document::VCARD40); $this->assertVObjectEqualsVObject( $output, $vcard ); } public function testMultipleAnniversaries() { $input = <<!$_ ITEM1.X-ANNIVERSARY;VALUE=DATE-AND-OR-TIME:20081210 ITEM2.X-ABDATE;VALUE=DATE-AND-OR-TIME:20091210 ITEM2.X-ABLABEL:_$!!$_ ITEM2.X-ANNIVERSARY;VALUE=DATE-AND-OR-TIME:20091210 ITEM3.X-ABDATE;VALUE=DATE-AND-OR-TIME:20101210 ITEM3.X-ABLABEL:_$!!$_ ITEM3.X-ANNIVERSARY;VALUE=DATE-AND-OR-TIME:20101210 END:VCARD OUT; $vcard = Reader::read($input); $vcard = $vcard->convert(Document::VCARD30); $this->assertVObjectEqualsVObject( $output, $vcard ); // Swapping input and output list( $input, $output ) = [ $output, $input, ]; $vcard = Reader::read($input); $vcard = $vcard->convert(Document::VCARD40); $this->assertVObjectEqualsVObject( $output, $vcard ); } public function testNoLabel() { $input = <<assertInstanceOf('Sabre\\VObject\\Component\\VCard', $vcard); $vcard = $vcard->convert(Document::VCARD40); $vcard = $vcard->serialize(); $converted = Reader::read($vcard); $converted->validate(); $version = Version::VERSION; $expected = <<assertEquals($expected, str_replace("\r", '', $vcard)); } }