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__deserialize_request01()
 {
     $context = new DeserializationContext();
     $context->getDocument()->load(__DIR__ . '/../../../../../../resources/sample/Request/request01.xml');
     $request = new AuthnRequest();
     $request->deserialize($context->getDocument()->firstChild, $context);
     $this->assertEquals('_8dcc6985f6d9f385f0bbd4562ef848ef3ae78d87d7', $request->getID());
     $this->assertEquals('2.0', $request->getVersion());
     $this->assertEquals('2013-10-10T15:26:20Z', $request->getIssueInstantString());
     $this->assertEquals('https://login.windows.net/554fadfe-f04f-4975-90cb-ddc8b147aaa2/saml2', $request->getDestination());
     $this->assertEquals('https://mt.evo.team/simplesaml/module.php/saml/sp/saml2-acs.php/default-sp', $request->getAssertionConsumerServiceURL());
     $this->assertEquals(SamlConstants::BINDING_SAML2_HTTP_POST, $request->getProtocolBinding());
     $this->assertNotNull($request->getIssuer());
     $this->assertEquals('https://mt.evo.team/simplesaml/module.php/saml/sp/metadata.php/default-sp', $request->getIssuer()->getValue());
     $this->assertNotNull($request->getNameIDPolicy());
     $this->assertEquals(SamlConstants::NAME_ID_FORMAT_PERSISTENT, $request->getNameIDPolicy()->getFormat());
     $this->assertTrue($request->getNameIDPolicy()->getAllowCreate());
 }