Server IP : 10.111.20.6  /  Your IP : 216.73.217.121
Web Server : Apache
System : Linux webm006.cluster111.gra.hosting.ovh.net 5.15.206-ovh-vps-grsec-zfs-classid #1 SMP Fri May 15 02:41:25 UTC 2026 x86_64
User : edizioni ( 7252)
PHP Version : 8.3.23
Disable Function : _dyuweyrj4,_dyuweyrj4r,dl
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON
Directory (2705) :  /home/edizioni/stampaeweb/../.config/../gulfanatura/saml1190/tests/Utils/../Utils/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : /home/edizioni/stampaeweb/../.config/../gulfanatura/saml1190/tests/Utils/../Utils/SpTester.php
<?php

declare(strict_types=1);

namespace SimpleSAML\Test\Utils;

use ReflectionObject;
use SAML2\AuthnRequest;
use SAML2\Binding;
use SimpleSAML\Configuration;
use SimpleSAML\Module\saml\Auth\Source\SP;

/**
 * Wrap the SSP \SimpleSAML\Module\saml\Auth\Source\SP class
 * - Use introspection to make startSSO2Test available
 * - Override sendSAML2AuthnRequest() to catch the AuthnRequest being sent
 */
class SpTester extends SP
{
    /**
     * @param array $info
     * @param array $config
     * @return void
     */
    public function __construct($info, $config)
    {
        parent::__construct($info, $config);
    }


    /**
     * @return void
     */
    public function startSSO2Test(Configuration $idpMetadata, array $state)
    {
        $reflector = new ReflectionObject($this);
        $method = $reflector->getMethod('startSSO2');
        $method->setAccessible(true);
        $method->invoke($this, $idpMetadata, $state);
    }


    /**
     * override the method that sends the request to avoid sending anything
     * @return void
     */
    public function sendSAML2AuthnRequest(array &$state, Binding $binding, AuthnRequest $ar)
    {
        // Exit test. Continuing would mean running into a assert(FALSE)
        throw new ExitTestException(
            [
                'state'   => $state,
                'binding' => $binding,
                'ar'      => $ar,
            ]
        );
    }
}