public function test_sets_name_id_to_outbound_logout_request()
 {
     $context = new ProfileContext(Profiles::SSO_IDP_RECEIVE_AUTHN_REQUEST, ProfileContext::ROLE_IDP);
     $context->getOutboundContext()->setMessage($logoutRequest = new LogoutRequest());
     $context->getLogoutContext()->setSsoSessionState((new SsoSessionState())->setNameId($nameId = 'name.id')->setNameIdFormat($nameIdFormat = 'name.id.format'));
     $action = new SetNameIdAction($this->getLoggerMock());
     $action->execute($context);
     $this->assertNotNull($logoutRequest->getNameID());
     $this->assertEquals($nameId, $logoutRequest->getNameID()->getValue());
     $this->assertEquals($nameIdFormat, $logoutRequest->getNameID()->getFormat());
 }
예제 #2
0
 public function test__get_logout_sso_session_state_returns_from_context()
 {
     $profileContext = new ProfileContext(Profiles::METADATA, ProfileContext::ROLE_IDP);
     $profileContext->getLogoutContext()->setSsoSessionState($expectedValue = new SsoSessionState());
     $this->assertSame($expectedValue, $profileContext->getLogoutSsoSessionState());
 }