/** * @see Comparable::equals * * Two properties 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->dataTypeId === $target->dataTypeId && $this->fingerprint->equals($target->fingerprint) && $this->statements->equals($target->statements); }
/** * @see EntityDocument::equals * * @param mixed $target * * @return bool */ public function equals($target) { if ($this === $target) { return true; } return $target instanceof self && $this->labels->equals($target->labels) && $this->descriptions->equals($target->descriptions) && $this->statements->equals($target->statements); }
public function testNonEmptyListDoesNotEqualEmptyList() { $firstStatements = new StatementList($this->getStatementWithSnak(1, 'foo'), $this->getStatementWithSnak(3, 'baz'), $this->getStatementWithSnak(2, 'bar')); $secondStatements = new StatementList(); $this->assertFalse($firstStatements->equals($secondStatements)); }