JeroenDesloovere\VCard\tests\VCardParserTest::testUrl PHP Метод

testUrl() публичный Метод

public testUrl ( )
    public function testUrl()
    {
        $vcard = new VCard();
        $vcard->addUrl('http://example.com');
        $vcard->addUrl('http://home.example.com', 'HOME');
        $vcard->addUrl('http://work1.example.com', 'PREF;WORK');
        $vcard->addUrl('http://work2.example.com', 'PREF;WORK');
        $parser = new VCardParser($vcard->buildVCard());
        $this->assertEquals($parser->getCardAtIndex(0)->url['default'][0], 'http://example.com');
        $this->assertEquals($parser->getCardAtIndex(0)->url['HOME'][0], 'http://home.example.com');
        $this->assertEquals($parser->getCardAtIndex(0)->url['PREF;WORK'][0], 'http://work1.example.com');
        $this->assertEquals($parser->getCardAtIndex(0)->url['PREF;WORK'][1], 'http://work2.example.com');
    }