spec\LdapTools\AttributeConverter\EncodeWindowsPasswordSpec::it_should_throw_an_exception_if_ssl_or_tls_is_not_enabled PHP Метод

it_should_throw_an_exception_if_ssl_or_tls_is_not_enabled() публичный Метод

public it_should_throw_an_exception_if_ssl_or_tls_is_not_enabled ( LdapTools\Connection\LdapConnectionInterface $connection )
$connection LdapTools\Connection\LdapConnectionInterface
    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');
    }