/** * @see Comparable::equals * * Two items are considered equal if they are of the same * type and have the same value. The value does not include * the id, so entities with the same value but different id * are considered equal. * * @since 0.1 * * @param mixed $target * * @return bool */ public function equals($target) { if ($this === $target) { return true; } return $target instanceof self && $this->fingerprint->equals($target->fingerprint) && $this->siteLinks->equals($target->siteLinks) && $this->statements->equals($target->statements); }
public function testAddSiteLink() { $list = new SiteLinkList(); $list->addSiteLink(new SiteLink('enwiki', 'cats')); $list->addSiteLink(new SiteLink('dewiki', 'katzen')); $this->assertTrue($list->equals(new SiteLinkList(array(new SiteLink('enwiki', 'cats'), new SiteLink('dewiki', 'katzen'))))); }