Skip to content
This repository was archived by the owner on Jul 24, 2023. It is now read-only.

Commit 6ff4384

Browse files
committed
Added another persistent test
1 parent 1382f13 commit 6ff4384

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

tests/AdldapTest.php

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ public function testAuthPasses()
5555

5656
$this->assertEquals('[email protected]', $user->email);
5757
$this->assertTrue(\Hash::check('12345', $user->password));
58-
$this->assertEquals($adUser, $user->adldapUser);
5958
}
6059

6160
public function testAuthPassesWithPersistentAdldapUser()
@@ -66,6 +65,16 @@ public function testAuthPassesWithPersistentAdldapUser()
6665
$this->assertInstanceOf('Adldap\Models\User', auth()->user()->adldapUser);
6766
}
6867

68+
public function testAuthPassesWithoutPersistentAdldapUser()
69+
{
70+
$this->app['config']->set('adldap_auth.bind_user_to_model', false);
71+
72+
$this->testAuthPasses();
73+
74+
$this->assertNull(\Auth::user()->adldapUser);
75+
$this->assertNull(auth()->user()->adldapUser);
76+
}
77+
6978
public function testAuthFails()
7079
{
7180
$mockedBuilder = Mockery::mock('Adldap\Query\Builder');

0 commit comments

Comments
 (0)