SimpleSAML\Test\Module\saml\Auth\Source\SP_Test::testForcedAuthn PHP Method

testForcedAuthn() public method

Test setting ForcedAuthn
public testForcedAuthn ( )
    public function testForcedAuthn()
    {
        $state = array('ForceAuthn' => true);
        /** @var \SAML2\AuthnRequest $ar */
        $ar = $this->createAuthnRequest($state);
        $this->assertEquals($state['ForceAuthn'], $ar->getForceAuthn());
        /** @var $xml \DOMElement */
        $xml = $ar->toSignedXML();
        $q = \SAML2\Utils::xpQuery($xml, '/samlp:AuthnRequest/@ForceAuthn');
        $this->assertEquals($state['ForceAuthn'] ? 'true' : 'false', $q[0]->value);
    }