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

createAuthnRequest() private method

Create a SAML AuthnRequest using sspmod_saml_Auth_Source_SP
private createAuthnRequest ( array $state = [] ) : AuthnRequest
$state array The state array to use in the test. This is an array of the parameters described in section 2 of https://simplesamlphp.org/docs/development/saml:sp
return SAML2\AuthnRequest The AuthnRequest generated.
    private function createAuthnRequest($state = array())
    {
        $info = array('AuthId' => 'default-sp');
        $config = array();
        $as = new SP_Tester($info, $config);
        /** @var \SAML2\AuthnRequest $ar */
        $ar = null;
        try {
            $as->startSSO2Test($this->getIdpMetadata(), $state);
            $this->assertTrue(false, 'Expected ExitTestException');
        } catch (ExitTestException $e) {
            $r = $e->getTestResult();
            $ar = $r['ar'];
        }
        return $ar;
    }