Skip to content
This repository has been archived by the owner on Jan 15, 2024. It is now read-only.

Commit

Permalink
Added test
Browse files Browse the repository at this point in the history
  • Loading branch information
kleijnweb committed Jul 2, 2016
1 parent 6bc83ae commit 8827ee8
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/Tests/Authenticator/AuthenticatorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,22 @@ public function authenticateTokenWillSetUserFetchedFromUserProviderOnToken()
$authenticator->authenticateToken($anonToken, $userProvider, 'myprovider');
}

/**
* @test
* @expectedException \UnexpectedValueException
*/
public function authenticateTokenWillFailIfCredentialsAreNotJwtToken()
{
$authenticator = new Authenticator($this->keys);
$anonToken = new PreAuthenticatedToken('foo', ['sub' => 'john'], 'myprovider');

$userProvider = $this->getMockBuilder(
'Symfony\Component\Security\Core\User\UserProviderInterface'
)->getMockForAbstractClass();

$authenticator->authenticateToken($anonToken, $userProvider, 'myprovider');
}

/**
* @test
*/
Expand Down

0 comments on commit 8827ee8

Please sign in to comment.