/**
  * @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));
 }
Пример #2
0
 /**
  * @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 EntityId $entityId
  * @return ContactPersonList
  */
 public function findAllForIdp(EntityId $entityId)
 {
     $identityProviderJson = $this->apiClient->read('metadata/idp?entity-id=%s', [$entityId->getEntityId()]);
     return ContactPersonListFactory::createListFromMetadata($identityProviderJson);
 }
Пример #4
0
 /**
  * @param Entity $other
  * @return bool
  */
 public function equals(Entity $other)
 {
     return $this->entityId->equals($other->entityId) && $this->entityType->equals($other->entityType);
 }