<commit_before><?php
class LDAPServiceTest extends SapphireTest
{
    protected $service;

    public function setUp()
    {
        parent::setUp();

        $gateway = new LDAPFakeGateway();
        Injector::inst()->registerService($gateway, 'LDAPGateway');

        $service = Injector::inst()->create('LDAPService');
        $service->setGateway($gateway);
        $this->service = $service;

        Config::inst()->nest();
        Config::inst()->update('LDAPGateway', 'options', array('host' => '1.2.3.4'));
        Config::inst()->update('LDAPService', 'groups_search_locations', array(
            'CN=Users,DC=playpen,DC=local',
            'CN=Others,DC=playpen,DC=local'
        ));
    }
<commit_msg>During testing ensure that no other Member and Group extension hooks are executed<commit_after><?php
class LDAPServiceTest extends SapphireTest
{
    protected $service;

    public function setUp()
    {
        parent::setUp();

        $gateway = new LDAPFakeGateway();
        Injector::inst()->registerService($gateway, 'LDAPGateway');

        $service = Injector::inst()->create('LDAPService');
        $service->setGateway($gateway);
        $this->service = $service;

        Config::inst()->nest();
        Config::inst()->update('LDAPGateway', 'options', array('host' => '1.2.3.4'));
        Config::inst()->update('LDAPService', 'groups_search_locations', array(
            'CN=Users,DC=playpen,DC=local',
            'CN=Others,DC=playpen,DC=local'
        ));
        // Prevent other module extension hooks from executing during write() etc.
        Config::inst()->remove('Member', 'extensions');
        Config::inst()->remove('Group', 'extensions');
        Config::inst()->update('Group', 'extensions', array('LDAPGroupExtension'));
        Config::inst()->update('Member', 'extensions', array('LDAPMemberExtension'));
    }

{'fraction_non_alphanumeric': 0.17580645161290323, 'fraction_numerical': 0.004301075268817204, 'mean_word_length': 3.358313817330211, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 23, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, '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': '88696', 'n_tokens_mistral': 535, 'n_tokens_neox': 525, 'n_words': 94}