<commit_before><?php

namespace OpenConext\Component\EngineTestStand;

use OpenConext\Component\EngineTestStand\Saml2\AuthnRequest;

class MockServiceProvider extends AbstractMockEntityRole
{
    public function loginUrl()
    {
        return $this->loginUrlRedirect();
    }

    public function loginUrlRedirect()
    {
        return $this->descriptor->Extensions['LoginRedirectUrl'];
    }

    public function loginUrlPost()
    {
        return $this->descriptor->Extensions['LoginPostUrl'];
    }

    public function assertionConsumerServiceLocation()
    {
        /** @var \SAML2_XML_md_SPSSODescriptor $role */
        $role = $this->getSsoRole();
        return $role->AssertionConsumerService[0]->Location;
    }

    /**
     * @return AuthnRequest
     */
    public function getAuthnRequest()
    {
        return $this->descriptor->Extensions['SAMLRequest'];
    }

    public function setAuthnRequest(\SAML2_AuthnRequest $authnRequest)
    {
        $this->descriptor->Extensions['SAMLRequest'] = $authnRequest;
        return $this;
    }

    public function useIdpTransparently($entityId)
    {
        $this->descriptor->Extensions['TransparentIdp'] = $entityId;
        return $this;
    }

    public function useUnsolicited()
    {
        $this->descriptor->Extensions['Unsolicited'] = true;
        return $this;
    }

    public function mustUseUnsolicited()
    {
        return isset($this->descriptor->Extensions['Unsolicited']) && $this->descriptor->Extensions['Unsolicited'];
    }

    public function signAuthnRequests()
    {
        /** @var \SAML2_XML_md_SPSSODescriptor $role */
        $role = $this->getSsoRole();
        $role->AuthnRequestsSigned = true;
        return $this;
    }

    public function useHttpPost()
    {
        $this->descriptor->Extensions['UsePost'] = true;
        return $this;
    }

    public function useHttpRedirect()
    {
        unset($this->descriptor->Extensions['UsePost']);
        return $this;
    }

    public function mustUsePost()
    {
        return isset($this->descriptor->Extensions['UsePost']);
    }

    protected function getRoleClass()
    {
        return '\SAML2_XML_md_SPSSODescriptor';
    }
}
<commit_msg>Introduced gettter for getTransparentIdp<commit_after><?php

namespace OpenConext\Component\EngineTestStand;

use OpenConext\Component\EngineTestStand\Saml2\AuthnRequest;

class MockServiceProvider extends AbstractMockEntityRole
{
    public function loginUrl()
    {
        return $this->loginUrlRedirect();
    }

    public function loginUrlRedirect()
    {
        return $this->descriptor->Extensions['LoginRedirectUrl'];
    }

    public function loginUrlPost()
    {
        return $this->descriptor->Extensions['LoginPostUrl'];
    }

    public function assertionConsumerServiceLocation()
    {
        /** @var \SAML2_XML_md_SPSSODescriptor $role */
        $role = $this->getSsoRole();
        return $role->AssertionConsumerService[0]->Location;
    }

    /**
     * @return AuthnRequest
     */
    public function getAuthnRequest()
    {
        return $this->descriptor->Extensions['SAMLRequest'];
    }

    public function setAuthnRequest(\SAML2_AuthnRequest $authnRequest)
    {
        $this->descriptor->Extensions['SAMLRequest'] = $authnRequest;
        return $this;
    }

    public function useIdpTransparently($entityId)
    {
        $this->descriptor->Extensions['TransparentIdp'] = $entityId;
        return $this;
    }

    public function getTransparentIdp()
    {
        return isset($this->descriptor->Extensions['TransparentIdp']) ?
            $this->descriptor->Extensions['TransparentIdp'] :
            '';
    }

    public function useUnsolicited()
    {
        $this->descriptor->Extensions['Unsolicited'] = true;
        return $this;
    }

    public function mustUseUnsolicited()
    {
        return isset($this->descriptor->Extensions['Unsolicited']) && $this->descriptor->Extensions['Unsolicited'];
    }

    public function signAuthnRequests()
    {
        /** @var \SAML2_XML_md_SPSSODescriptor $role */
        $role = $this->getSsoRole();
        $role->AuthnRequestsSigned = true;
        return $this;
    }

    public function useHttpPost()
    {
        $this->descriptor->Extensions['UsePost'] = true;
        return $this;
    }

    public function useHttpRedirect()
    {
        unset($this->descriptor->Extensions['UsePost']);
        return $this;
    }

    public function mustUsePost()
    {
        return isset($this->descriptor->Extensions['UsePost']);
    }

    protected function getRoleClass()
    {
        return '\SAML2_XML_md_SPSSODescriptor';
    }
}

{'fraction_non_alphanumeric': 0.1229014205768403, 'fraction_numerical': 0.002582866982350409, 'mean_word_length': 2.7780487804878047, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 63, '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': '6987083', 'n_tokens_mistral': 1352, 'n_tokens_neox': 1320, 'n_words': 217}