public function test_sets_outbounding_message_destination_to_endpoint_context_value()
 {
     $action = new DestinationAction(TestHelper::getLoggerMock($this));
     $context = new ProfileContext(Profiles::SSO_IDP_RECEIVE_AUTHN_REQUEST, ProfileContext::ROLE_IDP);
     $context->getOutboundContext()->setMessage($message = new AuthnRequest());
     $context->getEndpointContext()->setEndpoint($endpoint = new SingleSignOnService());
     $endpoint->setLocation($location = 'http://idp.com/login');
     $action->execute($context);
     $this->assertEquals($location, $message->getDestination());
 }
 public function test_does_nothing_if_endpoint_already_set()
 {
     $context = TestHelper::getProfileContext();
     $context->getEndpointContext()->setEndpoint($endpoint = new SingleSignOnService());
     $endpoint->setLocation('http://location.com');
     $endpoint->setBinding(SamlConstants::BINDING_SAML2_HTTP_POST);
     $this->logger->expects($this->once())->method('debug')->with('Endpoint already set with location "http://location.com" and binding "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST"', $this->isType('array'));
     $this->setEndpointResolver(false, null);
     $this->action->execute($context);
 }
 /**
  * @return IdpSsoDescriptor
  */
 protected function getIdpSsoDescriptor()
 {
     if (null === $this->ssoUrl) {
         return null;
     }
     $idpSso = new IdpSsoDescriptor();
     foreach ($this->ssoBindings as $index => $binding) {
         $sso = new SingleSignOnService();
         $sso->setLocation($this->ssoUrl)->setBinding($binding);
         $idpSso->addSingleSignOnService($sso);
     }
     $this->addKeyDescriptors($idpSso);
     return $idpSso;
 }