cvs: pear /Contact_Vcard_Build/tests build-johndoe.phpt

From: Date: Tue, 30 Jun 2009 21:49:28 +0000
Subject: cvs: pear /Contact_Vcard_Build/tests build-johndoe.phpt
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-56492@lists.php.net to get a copy of this message
till Tue Jun 30 21:49:28 2009 UTC Added files: /pear/Contact_Vcard_Build/tests build-johndoe.phpt Log: new test http://cvs.php.net/viewvc.cgi/pear/Contact_Vcard_Build/tests/build-johndoe.phpt?view=markup&rev=1.1 Index: pear/Contact_Vcard_Build/tests/build-johndoe.phpt +++ pear/Contact_Vcard_Build/tests/build-johndoe.phpt --TEST-- A test to build a john doe vcard included in examples. --FILE-- <?php require_once 'Contact/Vcard/Build.php'; $vcard = new Contact_Vcard_Build(); $vcard->setFormattedName('John Doe'); $vcard->setName('John', '', 'Doe', '', ''); $vcard->addEmail('johnDoe@example.org'); $vcard->addParam('TYPE', 'WORK'); $vcard->addTelephone('+1 617 555 1212'); $vcard->addParam('TYPE', 'WORK'); $vcard->addParam('TYPE', 'PREF'); $vcard->addTelephone('+1 (617) 555-1234'); $vcard->addParam('TYPE', 'WORK'); $vcard->addTelephone('+1 781 555 1212'); $vcard->addParam('TYPE', 'CELL'); $vcard->addTelephone('+1 202 555 1212'); $vcard->addParam('TYPE', 'HOME'); $pob = ''; $extend = ''; $street = '2 Enterprise Avenue'; $locality = ''; $region = 'NY'; $postcode = '01111'; $country = 'USA'; $vcard->addAddress($pob, $extend, $street, $locality, $region, $postcode, $country); $vcard->addParam('TYPE', 'WORK'); $pob = ''; $extend = ''; $street = '3 Acacia Avenue'; $locality = 'Hoemtown'; $region = 'MA'; $postcode = '02222'; $country = 'USA'; $vcard->addAddress($pob, $extend, $street, $locality, $region, $postcode, $country); $vcard->addParam('TYPE', 'HOME'); $note = 'John Doe has a long and varied history, being documented on more police'; $note .= ' files that anyone else. Reports of his death are alas numerous.'; $vcard->setNote($note); $vcard->setUrl('http://www.example/com/doe'); $vcard->addCategories('Work'); $vcard->addCategories('Test group'); $text = $vcard->fetch(); var_dump($text); --EXPECT-- string(543) "BEGIN:VCARD VERSION:3.0 PROFILE:VCARD FN:John Doe N:John;;Doe;; ADR;TYPE=WORK:;;2 Enterprise Avenue;;NY;01111;USA ADR;TYPE=HOME:;;3 Acacia Avenue;Hoemtown;MA;02222;USA TEL;TYPE=WORK,PREF:+1 617 555 1212 TEL;TYPE=WORK:+1 (617) 555-1234 TEL;TYPE=CELL:+1 781 555 1212 TEL;TYPE=HOME:+1 202 555 1212 EMAIL;TYPE=WORK:johnDoe@example.org CATEGORIES:Work,Test group NOTE:John Doe has a long and varied history\, being documented on more poli ce files that anyone else. Reports of his death are alas numerous. URL:http://www.example/com/doe END:VCARD "

« previous php.pear.cvs (#56492) next »