/** * @test * @group Entity * @group Value */ public function the_same_entity_ids_are_considered_equal() { $base = new EntityId('a'); $theSame = new EntityId('a'); $different = new EntityId('A'); $this->assertTrue($base->equals($theSame)); $this->assertFalse($base->equals($different)); }
/** * @param EntityId[] $entityIds * @return null|EntityId */ private function getNearestAuthenticatingAuthorityEntityId(array $entityIds) { $lastEntityId = array_pop($entityIds); if ($lastEntityId === null) { return null; } if (!$this->engineBlockEntityId->equals($lastEntityId)) { return $lastEntityId; } return array_pop($entityIds); }
/** * @param Entity $other * @return bool */ public function equals(Entity $other) { return $this->entityId->equals($other->entityId) && $this->entityType->equals($other->entityType); }