/** * @group default * @depends testOutputEmptyVCard * @depends testPushSpeccedSingle * @dataProvider stringEscapeProvider */ public function testOutputFN($unescaped, $escaped, VCard $vcard) { $vcard->push(VCard::builder('fn')->setValue($unescaped)->build()); $output = $vcard->output(); $this->assertNotEmpty($output); $expected = ['FN:' . $escaped, 'UID:' . VCard::escape($vcard->getUID())]; $lines = $this->checkAndRemoveSkeleton($output); $this->assertEquals($expected, $lines); return $vcard->clear(); }
/** * @group default * @depends testStoreAndRetrieveVCard */ public function testStoreAndRetrieveWCategory(VCardDB $vcardDB) { $this->checkRowCounts(['CONTACT' => 0]); $expected = ['fn' => 'Sigmund Freud', 'category' => 'mental health']; $vcard = new VCard(); $vcard->push(VCard::builder('fn')->setValue($expected['fn'])->build()); $vcard->push(VCard::builder('categories')->setValue($expected['category'])->build()); $contactID = $vcardDB->store($vcard); $this->checkRowCounts(['CONTACT' => 1, 'CONTACT_CATEGORIES' => 1], $vcard); $resultVCard = $vcardDB->fetchOne($contactID); $this->compareVCards($vcard, $resultVCard); }