function it_should_throw_a_SchemaParserException_when_the_schema_file_is_not_readable() { $fakePath = '/this/path/should/never/really/exist/I/would/hope'; $this->beConstructedWith($fakePath); $domain = new DomainConfiguration('example.com'); $domain->setLdapType('ad'); $this->shouldThrow(new SchemaParserException('Cannot find schema for "ad" in "' . $fakePath . '"'))->duringParse($domain->getLdapType(), 'user'); }
function it_should_use_a_custom_format_definition() { $config = new DomainConfiguration('example.local'); $config->setLdapType(LdapConnection::TYPE_OPENLDAP); $config->setBindFormat('CN=%username%,DC=foo,DC=bar'); $this->beConstructedThrough('getInstance', [$config]); $this->getUsername('foo')->shouldBeEqualTo('CN=foo,DC=foo,DC=bar'); }