function it_should_get_an_operator_filter_for_a_schema_adding_the_objectClass_objectCategory_and_filter_array() { $schema = new LdapObjectSchema('ad', 'user'); $schema->setObjectClass(['user']); $schema->setObjectCategory('person'); $this->getOperatorForSchema($schema, [])->toLdapFilter()->shouldBeEqualTo('(&(objectCategory=person)(objectClass=user))'); $this->getOperatorForSchema($schema, ['starts_with' => ['username', 'admin']])->toLdapFilter()->shouldBeEqualTo('(&(&(objectCategory=person)(objectClass=user))(&(username=admin*)))'); }