function it_should_delete_a_ldap_object(LdapConnectionInterface $connection)
{
$domainConfig = new DomainConfiguration('example.local');
$connection->getConfig()->willReturn($domainConfig);
$this->beConstructedWith(new Configuration(), $connection);
$ldapObject = new LdapObject(['dn' => 'cn=foo,dc=foo,dc=bar'], 'user');
$operation = new DeleteOperation($ldapObject->get('dn'));
$connection->execute($operation)->shouldBeCalled();
$this->delete($ldapObject);
$operation->addControl((new LdapControl(LdapControlType::SUB_TREE_DELETE))->setCriticality(true));
$connection->execute($operation)->shouldBeCalled();
$this->delete($ldapObject, true);
}