<commit_before><?php

namespace SimpleSAML\Test\Module\core\Auth;

use SimpleSAML\Module\core\Auth\UserPassOrgBase;

class UserPassOrgBaseTest extends \PHPUnit_Framework_TestCase
{
    public function testRememberOrganizationEnabled()
    {
        $config = array(
            'ldap:LDAPMulti',

            'remember.organization.enabled' => true,
            'remember.organization.checked' => false,

            'my-org' => array(
                'description' => 'My organization',
                // The rest of the options are the same as those available for
                // the LDAP authentication source.
                'hostname' => 'ldap://ldap.myorg.com',
                'dnpattern' => 'uid=%username%,ou=employees,dc=example,dc=org',
                // Whether SSL/TLS should be used when contacting the LDAP server.
                'enable_tls' => false,
            )
        );

        $mockUserPassOrgBase = $this->getMockBuilder(\SimpleSAML\Module\core\Auth\UserPassOrgBase::class)
            ->setConstructorArgs(array(array('AuthId' => 'my-org'), &$config))
            ->setMethods(array())
            ->getMockForAbstractClass();

        $this->assertTrue($mockUserPassOrgBase->getRememberOrganizationEnabled());
    }
}
<commit_msg>Fix tests for PHP 5.4<commit_after><?php

namespace SimpleSAML\Test\Module\core\Auth;

use SimpleSAML\Module\core\Auth\UserPassOrgBase;

class UserPassOrgBaseTest extends \PHPUnit_Framework_TestCase
{
    public function testRememberOrganizationEnabled()
    {
        $config = array(
            'ldap:LDAPMulti',

            'remember.organization.enabled' => true,
            'remember.organization.checked' => false,

            'my-org' => array(
                'description' => 'My organization',
                // The rest of the options are the same as those available for
                // the LDAP authentication source.
                'hostname' => 'ldap://ldap.myorg.com',
                'dnpattern' => 'uid=%username%,ou=employees,dc=example,dc=org',
                // Whether SSL/TLS should be used when contacting the LDAP server.
                'enable_tls' => false,
            )
        );

        // When PHP 5.4 support is dropped, replace with:
        // $mockUserPassOrgBase = $this->getMockBuilder(\SimpleSAML\Module\core\Auth\UserPassOrgBase::class)
        $mockUserPassOrgBase = $this->getMockBuilder(get_parent_class(new \SimpleSAML\Module\ldap\Auth\Source\LDAPMulti(array('AuthId' => 'my-org'), array())))
            ->setConstructorArgs(array(array('AuthId' => 'my-org'), &$config))
            ->setMethods(array())
            ->getMockForAbstractClass();

        $this->assertTrue($mockUserPassOrgBase->getRememberOrganizationEnabled());
    }
}

{'fraction_non_alphanumeric': 0.12577020659659296, 'fraction_numerical': 0.0014498006524102935, 'mean_word_length': 2.3906633906633905, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 33, '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': '250026', 'n_tokens_mistral': 802, 'n_tokens_neox': 749, 'n_words': 145}