getSchemaFormat() public method

Get the schema definition format.
public getSchemaFormat ( ) : string
return string
 function let(LdapConnectionInterface $connection)
 {
     $config = (new DomainConfiguration('example.com'))->setSchemaName('example');
     $connection->getConfig()->willReturn($config);
     $config = new Configuration();
     $parserTest = SchemaParserFactory::get($config->getSchemaFormat(), __DIR__ . '/../resources/schema');
     $parser = SchemaParserFactory::get($config->getSchemaFormat(), __DIR__ . '/../../resources/schema');
     $cache = CacheFactory::get('none', []);
     $this->dispatcherTest = new SymfonyEventDispatcher();
     $this->dispatcher = new SymfonyEventDispatcher();
     $this->objectSchemaFactoryTest = new LdapObjectSchemaFactory($cache, $parserTest, $this->dispatcherTest);
     $this->objectSchemaFactory = new LdapObjectSchemaFactory($cache, $parser, $this->dispatcher);
     $this->beConstructedWith($connection, $this->objectSchemaFactory, $this->dispatcher);
 }
 public function let(LdapConnectionInterface $connection)
 {
     $this->config = (new DomainConfiguration('example.com'))->setSchemaName('example');
     $this->config->setUseTls(true);
     $ldapObject = new LdapObject(['defaultNamingContext' => 'dc=example,dc=com'], ['*'], '', 'ad');
     $connection->getConfig()->willReturn($this->config);
     $connection->getRootDse()->willReturn($ldapObject);
     $config = new Configuration();
     $parser = SchemaParserFactory::get($config->getSchemaFormat(), $config->getSchemaFolder());
     $parserTest = SchemaParserFactory::get($config->getSchemaFormat(), __DIR__ . '/../../resources/schema');
     $cache = CacheFactory::get('none', []);
     $this->dispatcher = new SymfonyEventDispatcher();
     $this->schemaFactoryTest = new LdapObjectSchemaFactory($cache, $parserTest, $this->dispatcher);
     $this->schemaFactory = new LdapObjectSchemaFactory($cache, $parser, $this->dispatcher);
     $this->attributes['unicodePwd'] = (new EncodeWindowsPassword())->toLdap('12345');
     $this->addOperation = (new AddOperation('foo'))->setDn("cn=somedude,dc=foo,dc=bar")->setAttributes($this->attributes);
     $this->beConstructedWith($connection, $this->schemaFactoryTest, $this->dispatcher);
 }
 public function let(LdapConnectionInterface $connection)
 {
     $config = new Configuration();
     $config->setCacheType('none');
     $connection->execute(Argument::any())->willReturn($this->ldapEntries);
     $connection->getConfig()->willReturn(new DomainConfiguration('example.local'));
     $cache = CacheFactory::get($config->getCacheType(), $config->getCacheOptions());
     $parser = SchemaParserFactory::get($config->getSchemaFormat(), $config->getSchemaFolder());
     $dispatcher = new SymfonyEventDispatcher();
     $schemaFactory = new LdapObjectSchemaFactory($cache, $parser, $dispatcher);
     $this->beConstructedWith($schemaFactory->get('ad', 'user'), $connection);
 }
 function let(LdapConnectionInterface $connection)
 {
     $config = new Configuration();
     $domain = new DomainConfiguration('example.com');
     $domain->setServers(['example'])->setBaseDn('dc=example,dc=com')->setLazyBind(true)->setPageSize(500);
     $connection->getConfig()->willReturn($domain);
     $config->setCacheType('none');
     $parser = SchemaParserFactory::get($config->getSchemaFormat(), $config->getSchemaFolder());
     $cache = CacheFactory::get($config->getCacheType(), []);
     $dispatcher = new SymfonyEventDispatcher();
     $schemaFactory = new LdapObjectSchemaFactory($cache, $parser, $dispatcher);
     $this->fb = new FilterBuilder();
     $this->schema = $schemaFactory;
     $this->objectSchema = $schema = new LdapObjectSchema('ad', 'user');
     $this->objectSchema->setFilter($this->fb->bAnd($this->fb->eq('objectCategory', 'person'), $this->fb->eq('objectClass', 'user')));
     $this->beConstructedWith($connection, $schemaFactory);
 }
Example #5
0
 function it_should_sort_results_for_multiple_aliases($connection)
 {
     $config = new Configuration();
     $domain = new DomainConfiguration('example.com');
     $domain->setServers(['example'])->setBaseDn('dc=example,dc=com')->setLazyBind(true)->setPageSize(500);
     $connection->getConfig()->willReturn($domain);
     $config->setCacheType('none');
     $parser = SchemaParserFactory::get($config->getSchemaFormat(), $config->getSchemaFolder());
     $cache = CacheFactory::get($config->getCacheType(), []);
     $dispatcher = new SymfonyEventDispatcher();
     $schemaFactory = new LdapObjectSchemaFactory($cache, $parser, $dispatcher);
     $ou = $schemaFactory->get('ad', 'ou');
     $container = $schemaFactory->get('ad', 'container');
     $filter = new OperatorCollection();
     $filter->addLdapObjectSchema($ou);
     $filter->addLdapObjectSchema($container);
     $this->operation->setFilter($filter);
     $this->operation->setAttributes([]);
     $connection->execute(Argument::that(function ($op) {
         return $op->getFilter() == '(objectClass=organizationalUnit)';
     }))->shouldBeCalled()->willReturn($this->ous);
     $connection->execute(Argument::that(function ($op) {
         return $op->getFilter() == '(&(objectCategory=container))';
     }))->shouldBeCalled()->willReturn($this->containers);
     $this->setOrderBy(['Name' => LdapQuery::ORDER['ASC'], 'ou.Description' => LdapQuery::ORDER['DESC']]);
     $this->getResult()->shouldHavePlaceKeyAndValue(0, 'name', 'Computers');
     $this->getResult()->shouldHavePlaceKeyAndValue(1, 'name', 'Employees');
     $this->getResult()->shouldHavePlaceKeyAndValue(2, 'name', 'Users');
     $this->getResult()->shouldHavePlaceKeyAndValue(3, 'name', 'West');
 }