function it_should_throw_an_exception_if_ssl_or_tls_is_not_enabled(\LdapTools\Connection\LdapConnectionInterface $connection)
{
$this->toLdap('test')->shouldNotThrow('\\LdapTools\\Exception\\LdapConnectionException');
$config = new DomainConfiguration('example.local');
$config->setUseTls(true);
$connection->getConfig()->willReturn($config);
$this->setLdapConnection($connection);
$this->toLdap('test')->shouldNotThrow('\\LdapTools\\Exception\\LdapConnectionException');
$config->setUseTls(false);
$this->shouldThrow('\\LdapTools\\Exception\\LdapConnectionException')->duringToLdap('test');
$config->setUseSsl(true);
$this->toLdap('test')->shouldNotThrow('\\LdapTools\\Exception\\LdapConnectionException');
}