-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* Removing auth from retrieveByCredentials to validateCredentials * Added StyleCI analysis
- Loading branch information
1 parent
f3f8142
commit 56c6371
Showing
5 changed files
with
34 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,32 +3,42 @@ | |
namespace spec\Dsdevbe\LdapConnector; | ||
|
||
use Dsdevbe\LdapConnector\Adapter\LdapInterface; | ||
use Illuminate\Contracts\Hashing\Hasher as HasherContract; | ||
use Illuminate\Contracts\Auth\Authenticatable; | ||
use PhpSpec\ObjectBehavior; | ||
|
||
class LdapUserProviderSpec extends ObjectBehavior | ||
{ | ||
public function let(HasherContract $hasher, LdapInterface $interface) | ||
public function let(LdapInterface $interface) | ||
{ | ||
$this->beConstructedWith($hasher, $interface); | ||
$this->beConstructedWith($interface); | ||
} | ||
|
||
public function it_is_initializable() | ||
{ | ||
$this->shouldHaveType('Dsdevbe\LdapConnector\LdapUserProvider'); | ||
} | ||
|
||
public function it_validate_user_by_credentials(LdapInterface $interface) | ||
public function it_validate_user_by_credentials() | ||
{ | ||
$user = [ | ||
'username' => '[email protected]', | ||
'password' => 'johnpassdoe', | ||
]; | ||
|
||
$interface->connect($user['username'], $user['password'])->shouldBeCalled(); | ||
$this->retrieveByCredentials($user); | ||
} | ||
|
||
public function it_validate_password_against_ldap(LdapInterface $interface, Authenticatable $user) | ||
{ | ||
$credentials = [ | ||
'username' => '[email protected]', | ||
'password' => 'johnpassdoe', | ||
]; | ||
|
||
$interface->connect($credentials['username'], $credentials['password'])->shouldBeCalled(); | ||
$this->validateCredentials($user, $credentials); | ||
} | ||
|
||
public function it_retrieves_user_by_id(LdapInterface $interface) | ||
{ | ||
$identifier = '[email protected]'; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters