Пример #1
0
 /**
  * @depends testUID
  * @group default
  */
 public function testGetUIDMagic(vCard $vcard)
 {
     // UID, when presented as a property, *always has a value* so that the
     // VCard will always have a primary key when output.
     $this->assertNull($vcard->getUID());
     /* @var $property1 Property */
     $property1 = $vcard->uid;
     $this->assertNotEmpty($property1);
     $this->assertInstanceOf(__NAMESPACE__ . '\\Property', $property1);
     $this->assertEquals('uid', $property1->getName());
     $vcard->setUID('Some UID');
     /* @var $property2 Property */
     $property2 = $vcard->uid;
     $this->assertNotEmpty($property2);
     $this->assertInstanceOf(__NAMESPACE__ . '\\Property', $property2);
     $this->assertEquals('uid', $property2->getName());
     $this->assertEquals('Some UID', $property2->getValue());
     return $vcard->clear();
 }
Пример #2
0
 /**
  * @group default
  * @depends testStoreAndRetrieveVCard
  */
 public function testStoreAndRetrieveWUID(VCardDB $vcardDB)
 {
     $this->checkRowCounts(['CONTACT' => 0]);
     $vcard = new vCard();
     $vcard->setUID('someUIDValue');
     $vcard->push(VCard::builder('fn')->setValue('nothingInteresting')->build());
     $contactID = $vcardDB->store($vcard);
     $this->checkRowCounts(['CONTACT' => 1], $vcard);
     $resultVCard = $vcardDB->fetchOne($contactID);
     $this->compareVCards($vcard, $resultVCard);
 }