spec\LdapTools\Hydrator\OperationHydratorSpec::it_should_attempt_to_resolve_parameters_for_the_base_dn PHP Метод

it_should_attempt_to_resolve_parameters_for_the_base_dn() публичный Метод

    function it_should_attempt_to_resolve_parameters_for_the_base_dn($connection, $rootdse)
    {
        $this->setLdapObjectSchema($this->schema);
        $this->setOperationType(AttributeConverterInterface::TYPE_SEARCH_TO);
        $this->setLdapConnection($connection);
        $rootDseAttr = ['defaultNamingContext' => 'dc=foo,dc=bar', 'configurationNamingContext' => 'cn=config,dc=foo,dc=bar'];
        foreach ($rootDseAttr as $name => $value) {
            $rootdse->has($name)->willReturn(true);
            $rootdse->get($name)->willReturn($value);
        }
        $operation = new QueryOperation('(foo=bar)');
        $operation->setBaseDn('%_defaultNamingContext_%');
        $this->hydrateToLdap($operation)->getBaseDn()->shouldBeEqualTo($rootDseAttr['defaultNamingContext']);
    }