summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/units/Core/Ldap/ClientTest.php23
1 files changed, 20 insertions, 3 deletions
diff --git a/tests/units/Core/Ldap/ClientTest.php b/tests/units/Core/Ldap/ClientTest.php
index d149500e..9f007c28 100644
--- a/tests/units/Core/Ldap/ClientTest.php
+++ b/tests/units/Core/Ldap/ClientTest.php
@@ -13,6 +13,21 @@ function ldap_set_option()
{
}
+function ldap_get_option($link_identifier, $option, &$error)
+{
+ $error = 'some extended error';
+}
+
+function ldap_error($link_identifier)
+{
+ return 'some error';
+}
+
+function ldap_errno($link_identifier)
+{
+ return -100;
+}
+
function ldap_bind($link_identifier, $bind_rdn = null, $bind_password = null)
{
return ClientTest::$functions->ldap_bind($link_identifier, $bind_rdn, $bind_password);
@@ -26,7 +41,6 @@ function ldap_start_tls($link_identifier)
class ClientTest extends \Base
{
public static $functions;
- private $ldap;
public function setUp()
{
@@ -37,8 +51,11 @@ class ClientTest extends \Base
->setMethods(array(
'ldap_connect',
'ldap_set_option',
+ 'ldap_get_option',
'ldap_bind',
'ldap_start_tls',
+ 'ldap_error',
+ 'ldap_errno'
))
->getMock();
}
@@ -83,7 +100,7 @@ class ClientTest extends \Base
)
->will($this->returnValue(false));
- $this->setExpectedException('\Kanboard\Core\Ldap\ClientException');
+ $this->setExpectedException('\Kanboard\Core\Ldap\ConnectionException');
$ldap = new Client;
$ldap->open('my_ldap_server');
@@ -133,7 +150,7 @@ class ClientTest extends \Base
)
->will($this->returnValue(false));
- $this->setExpectedException('\Kanboard\Core\Ldap\ClientException');
+ $this->setExpectedException('\Kanboard\Core\Ldap\ConnectionException');
$ldap = new Client;
$ldap->open('my_ldap_server', 389, true);