From 9899aa1f99f3943beeb01fa9cdc5f980a2eb11d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Unger?= Date: Fri, 8 Jul 2016 15:30:59 +0200 Subject: [PATCH] tests: ImplicitGrantTest additional tests --- tests/Grant/ImplicitGrantTest.php | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/tests/Grant/ImplicitGrantTest.php b/tests/Grant/ImplicitGrantTest.php index 08cb24df..f5f1feb2 100644 --- a/tests/Grant/ImplicitGrantTest.php +++ b/tests/Grant/ImplicitGrantTest.php @@ -370,4 +370,32 @@ class ImplicitGrantTest extends \PHPUnit_Framework_TestCase $grant->completeAuthorizationRequest($authRequest); } + + /** + * @expectedException \LogicException + */ + public function testSetRefreshTokenTTL() + { + $grant = new ImplicitGrant(new \DateInterval('PT10M')); + $grant->setRefreshTokenTTL(new \DateInterval('PT10M')); + } + + /** + * @expectedException \LogicException + */ + public function testSetRefreshTokenRepository() + { + $grant = new ImplicitGrant(new \DateInterval('PT10M')); + $refreshTokenRepositoryMock = $this->getMockBuilder(RefreshTokenRepositoryInterface::class)->getMock(); + $grant->setRefreshTokenRepository($refreshTokenRepositoryMock); + } + + /** + * @expectedException \LogicException + */ + public function testCompleteAuthorizationRequestNoUser() + { + $grant = new ImplicitGrant(new \DateInterval('PT10M')); + $grant->completeAuthorizationRequest(new AuthorizationRequest()); + } }