X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/f38bc75ab4f1d6980ecff7e2a1eb70eda8b42565..refs/pull/665/head:/tests/Auth/LdapTest.php diff --git a/tests/Auth/LdapTest.php b/tests/Auth/LdapTest.php index 573de4c43..8880c7b65 100644 --- a/tests/Auth/LdapTest.php +++ b/tests/Auth/LdapTest.php @@ -11,6 +11,7 @@ class LdapTest extends BrowserKitTest public function setUp() { parent::setUp(); + if (!defined('LDAP_OPT_REFERRALS')) define('LDAP_OPT_REFERRALS', 1); app('config')->set(['auth.method' => 'ldap', 'services.ldap.base_dn' => 'dc=ldap,dc=local', 'auth.providers.users.driver' => 'ldap']); $this->mockLdap = \Mockery::mock(\BookStack\Services\Ldap::class); $this->app['BookStack\Services\Ldap'] = $this->mockLdap; @@ -74,6 +75,7 @@ class LdapTest extends BrowserKitTest { $this->mockLdap->shouldReceive('connect')->once()->andReturn($this->resourceId); $this->mockLdap->shouldReceive('setVersion')->once(); + $this->mockLdap->shouldReceive('setOption')->times(2); $this->mockLdap->shouldReceive('searchAndGetEntries')->times(2) ->with($this->resourceId, config('services.ldap.base_dn'), \Mockery::type('string'), \Mockery::type('array')) ->andReturn(['count' => 1, 0 => [