File: Issue154Test.php

package info (click to toggle)
php-sabre-vobject 2.1.7-6.1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, sid
  • size: 1,172 kB
  • sloc: php: 6,487; makefile: 17; xml: 16
file content (29 lines) | stat: -rw-r--r-- 662 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<?php

namespace Sabre\VObject;

class Issue154Test extends \PHPUnit\Framework\TestCase {

    function testStuff() {

        $vcard = new Component('VCARD');
        $vcard->VERSION = '3.0';
        $vcard->PHOTO = base64_encode('random_stuff');
        $vcard->PHOTO->add('BASE64',null);
        $vcard->UID = 'foo-bar';

        $result = $vcard->serialize();
        $expected = array(
            "BEGIN:VCARD",
            "VERSION:3.0",
            "PHOTO;BASE64:" . base64_encode('random_stuff'),
            "UID:foo-bar",
            "END:VCARD",
            "",
        );

        $this->assertEquals(implode("\r\n", $expected), $result);

    }

}