<commit_before><?php
/**
 * Creates mocked versions of dependencies for functional testing
 */
class EngineBlock_Application_FunctionalTestDiContainer extends EngineBlock_Application_DiContainer
{
    protected function registerServiceRegistryClient()
    {
        $this[self::SERVICE_REGISTRY_CLIENT] = $this->share(function (EngineBlock_Application_DiContainer $container) {
            $serviceRegistryClient = Phake::mock('Janus_Client_CacheProxy');

            $resourcesDir = realpath(ENGINEBLOCK_FOLDER_ROOT . 'tests/resources/serviceregistry');
            Phake::when($serviceRegistryClient)->getIdpList()->thenReturn(require_once $resourcesDir . '/idpList.php');
            Phake::when($serviceRegistryClient)->getSPList()->thenReturn(require_once $resourcesDir . '/spList.php');
            $allowedIdpsConfig = require_once $resourcesDir . '/allowedIdps.php';
            foreach($allowedIdpsConfig as $spEntityId => $idps) {
                Phake::when($serviceRegistryClient)->getAllowedIdps($spEntityId)->thenReturn($idps);
            }

            Phake::when($serviceRegistryClient)->isConnectionAllowed(Phake::anyParameters())->thenReturn(array(true));
            Phake::when($serviceRegistryClient)->getArp(Phake::anyParameters())->thenReturn(array());

            return $serviceRegistryClient;
        });
    }

    protected function registerSaml2TimestampProvider()
    {
        $this[self::SAML2_TIMESTAMP] = $this->share(function ()
        {
            return new EngineBlock_Saml2_TimestampProvider_Fixture();
        });
    }
<commit_msg>Don’t return a mocked / special ServiceRegistry client, but return the Janus Fixture loader<commit_after><?php
/**
 * Creates mocked versions of dependencies for functional testing
 */
class EngineBlock_Application_FunctionalTestDiContainer extends EngineBlock_Application_DiContainer
{
    protected function registerServiceRegistryClient()
    {
        $this[self::SERVICE_REGISTRY_CLIENT] = $this->share(function ()
        {
            return new Janus_FixtureClient();
        });
    }

    protected function registerSaml2TimestampProvider()
    {
        $this[self::SAML2_TIMESTAMP] = $this->share(function ()
        {
            return new EngineBlock_Saml2_TimestampProvider_Fixture();
        });
    }

{'fraction_non_alphanumeric': 0.10975609756097561, 'fraction_numerical': 0.002613240418118467, 'mean_word_length': 3.7458677685950414, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 18, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6814769', 'n_tokens_mistral': 605, 'n_tokens_neox': 600, 'n_words': 93}