1<?php
2
3namespace Sabre\VObject;
4
5/**
6 * This test is created to handle the issues brought forward by issue 40.
7 *
8 * https://github.com/fruux/sabre-vobject/issues/40
9 */
10class Issue40Test extends \PHPUnit_Framework_TestCase {
11
12    function testEncode() {
13
14        $card = new Component\VCard();
15        $card->add('N', array('van der Harten', array('Rene','J.'), "", 'Sir','R.D.O.N.'), array('SORT-AS' => array('Harten','Rene')));
16
17        $expected = implode("\r\n", array(
18            "BEGIN:VCARD",
19            "VERSION:3.0",
20            "PRODID:-//Sabre//Sabre VObject " . Version::VERSION . '//EN',
21            "N;SORT-AS=Harten,Rene:van der Harten;Rene,J.;;Sir;R.D.O.N.",
22            "END:VCARD",
23            ""
24        ));
25
26        $this->assertEquals($expected, $card->serialize());
27
28    }
29
30}
31