/** * @see Comparable::equals * * @since 0.7.4 * * @param mixed $target * * @return bool */ public function equals($target) { if ($this === $target) { return true; } return $target instanceof self && $this->descriptions->equals($target->getDescriptions()) && $this->labels->equals($target->getLabels()) && $this->aliasGroups->equals($target->getAliasGroups()); }
public function testGivenListsThatOnlyDifferInOrder_equalsReturnsTrue() { $list = new AliasGroupList(array(new AliasGroup('en', array('foo')), new AliasGroup('de', array('bar')))); $this->assertTrue($list->equals(new AliasGroupList(array(new AliasGroup('de', array('bar')), new AliasGroup('en', array('foo')))))); }