/**
  * @param ProfileContext $context
  *
  * @return string|null
  */
 protected function getDescriptorType(ProfileContext $context)
 {
     return $context->getOwnRole() == ProfileContext::ROLE_IDP ? SpSsoDescriptor::class : IdpSsoDescriptor::class;
 }
 /**
  * @param ProfileContext $context
  * @param string         $location
  *
  * @return CriteriaSet
  */
 protected function getCriteriaSet(ProfileContext $context, $location)
 {
     $criteriaSet = new CriteriaSet([new DescriptorTypeCriteria($context->getOwnRole() === ProfileContext::ROLE_IDP ? IdpSsoDescriptor::class : SpSsoDescriptor::class), new LocationCriteria($location)]);
     return $criteriaSet;
 }
Exemplo n.º 3
0
 public function test__profile_id_and_own_role_set_in_constructor()
 {
     $profileContext = new ProfileContext(Profiles::METADATA, ProfileContext::ROLE_IDP);
     $this->assertEquals(Profiles::METADATA, $profileContext->getProfileId());
     $this->assertEquals(ProfileContext::ROLE_IDP, $profileContext->getOwnRole());
 }