Skip to content

Commit c949c89

Browse files
committed
Fix tests
1 parent f0b4ee0 commit c949c89

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

tests/ConnectionTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,6 @@ public function test_setting_ldap_connection_initializes_it()
9494
public function test_is_connected()
9595
{
9696
$ldap = $this->newConnectedLdapMock();
97-
$ldap->shouldReceive('isBound')->once()->withNoArgs()->andReturnTrue();
9897
$conn = new Connection([], $ldap);
9998
$this->assertTrue($conn->isConnected());
10099
}

tests/CreatesConnectedLdapMocks.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ trait CreatesConnectedLdapMocks
1010
protected function newConnectedLdapMock()
1111
{
1212
$ldap = m::mock(Ldap::class);
13-
$ldap->shouldReceive('connect')->once();
13+
$ldap->shouldReceive('connect')->andReturnTrue();
14+
$ldap->shouldReceive('isBound')->andReturnTrue();
1415
$ldap->shouldReceive('setOptions')->once();
1516

1617
return $ldap;

tests/Query/BuilderTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -949,6 +949,7 @@ public function test_getting_results_sets_ldap_controls()
949949
$b = $this->newBuilder();
950950

951951
$ldap = $b->getConnection()->getLdapConnection();
952+
$ldap->shouldReceive('isBound')->andReturnTrue();
952953
$ldap->shouldReceive('setOption')->once()->withArgs([LDAP_OPT_SERVER_CONTROLS, []]);
953954
$ldap->shouldReceive('search')->once()->andReturnNull();
954955
$ldap->shouldReceive('getEntries')->once()->andReturnNull();

0 commit comments

Comments
 (0)