From 968767b5bb08f712e2eaf9d8ee38ab7d82a5ccbd Mon Sep 17 00:00:00 2001 From: maciejkosiarski Date: Fri, 9 Oct 2020 11:18:02 +0200 Subject: [PATCH] Fix unit tests --- Tests/JwtFinderTest.php | 10 +++++----- Tests/JwtKeeperTest.php | 8 ++++---- Tests/JwtStorageTest.php | 10 +++++----- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/Tests/JwtFinderTest.php b/Tests/JwtFinderTest.php index 860b6f7..eecb72a 100644 --- a/Tests/JwtFinderTest.php +++ b/Tests/JwtFinderTest.php @@ -15,7 +15,7 @@ class JwtFinderTest extends TestCase /** * @throws \MaciejKosiarski\JwtKeeperBundle\Exception\ScanResponseException */ - public function testHS256() + public function testHS256(): void { $hs256 = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c'; @@ -36,7 +36,7 @@ public function testHS256() /** * @throws \MaciejKosiarski\JwtKeeperBundle\Exception\ScanResponseException */ - public function testHS384() + public function testHS384(): void { $hs384 = 'eyJhbGciOiJIUzM4NCIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiYWRtaW4iOnRydWUsImlhdCI6MTUxNjIzOTAyMn0.bQTnz6AuMJvmXXQsVPrxeQNvzDkimo7VNXxHeSBfClLufmCVZRUuyTwJF311JHuh'; @@ -59,7 +59,7 @@ public function testHS384() /** * @throws \MaciejKosiarski\JwtKeeperBundle\Exception\ScanResponseException */ - public function testRS256() + public function testRS256(): void { $rs256 = 'eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiYWRtaW4iOnRydWUsImlhdCI6MTUxNjIzOTAyMn0.POstGetfAytaZS82wHcjoTyoqhMyxXiWdR7Nn7A29DNSl0EiXLdwJ6xC6AfgZWF1bOsS_TuYI3OG85AmiExREkrS6tDfTQ2B3WXlrr-wp5AokiRbz3_oB4OxG-W9KcEEbDRcZc0nH3L7LzYptiy1PtAylQGxHTWZXtGz4ht0bAecBgmpdgXMguEIcoqPJ1n3pIWk_dUZegpqx0Lka21H6XxUTxiy8OcaarA8zdnPUnV6AmNP3ecFawIFYdvJB_cm-GvpCSbr8G8y_Mllj8f4x9nBH8pQux89_6gUY618iYv7tuPWBFfEbLxtF2pZS6YC1aSfLQxeNe8djT9YjpvRZA'; @@ -82,7 +82,7 @@ public function testRS256() /** * @throws \MaciejKosiarski\JwtKeeperBundle\Exception\ScanResponseException */ - public function testES256() + public function testES256(): void { $es256 = 'eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiYWRtaW4iOnRydWUsImlhdCI6MTUxNjIzOTAyMn0.tyh-VfuzIxCyGYDlkBA7DfyjrqmSHu6pQ2hoZuFqUSLPNY2N0mpHb3nk5K17HWP_3cYHBw7AhHale5wky6-sVA'; @@ -105,7 +105,7 @@ public function testES256() /** * @throws \MaciejKosiarski\JwtKeeperBundle\Exception\ScanResponseException */ - public function testPS256() + public function testPS256(): void { $ps256 = 'eyJhbGciOiJQUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiYWRtaW4iOnRydWUsImlhdCI6MTUxNjIzOTAyMn0.hZnl5amPk_I3tb4O-Otci_5XZdVWhPlFyVRvcqSwnDo_srcysDvhhKOD01DigPK1lJvTSTolyUgKGtpLqMfRDXQlekRsF4XhAjYZTmcynf-C-6wO5EI4wYewLNKFGGJzHAknMgotJFjDi_NCVSjHsW3a10nTao1lB82FRS305T226Q0VqNVJVWhE4G0JQvi2TssRtCxYTqzXVt22iDKkXeZJARZ1paXHGV5Kd1CljcZtkNZYIGcwnj65gvuCwohbkIxAnhZMJXCLaVvHqv9l-AAUV7esZvkQR1IpwBAiDQJh4qxPjFGylyXrHMqh5NlT_pWL2ZoULWTg_TJjMO9TuQ'; diff --git a/Tests/JwtKeeperTest.php b/Tests/JwtKeeperTest.php index 9103476..5fcf59c 100755 --- a/Tests/JwtKeeperTest.php +++ b/Tests/JwtKeeperTest.php @@ -26,7 +26,7 @@ class JwtKeeperTest extends TestCase /** * @throws \Psr\Cache\InvalidArgumentException */ - protected function setUp() + protected function setUp(): void { $this->testHash = md5('test_hash'); @@ -43,7 +43,7 @@ protected function setUp() * @throws UnexpectedTokenTypeException * @throws \MaciejKosiarski\JwtKeeperBundle\Exception\RetrieveTokenException */ - public function testJWT() + public function testJWT(): void { $testJWT = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c'; $storage = new JwtStorage($this->testHash); @@ -71,7 +71,7 @@ public function testJWT() * @throws UnexpectedTokenTypeException * @throws \MaciejKosiarski\JwtKeeperBundle\Exception\RetrieveTokenException */ - public function testGuzzleRequestException() + public function testGuzzleRequestException(): void { $this->expectException(RequestException::class); $jwtKeeper = new JwtKeeper('', '', ''); @@ -81,7 +81,7 @@ public function testGuzzleRequestException() /** * @throws \Psr\Cache\InvalidArgumentException */ - protected function tearDown() + protected function tearDown(): void { $cache = new FilesystemAdapter(); $cache->delete(JwtStorage::STORAGE .'.'. $this->testHash); diff --git a/Tests/JwtStorageTest.php b/Tests/JwtStorageTest.php index b72a88c..c0797d5 100644 --- a/Tests/JwtStorageTest.php +++ b/Tests/JwtStorageTest.php @@ -19,7 +19,7 @@ class JwtStorageTest extends TestCase /** * @throws \Psr\Cache\InvalidArgumentException */ - protected function setUp() + protected function setUp(): void { $this->testHash = md5('test_hash'); @@ -33,7 +33,7 @@ protected function setUp() * @throws \MaciejKosiarski\JwtKeeperBundle\Exception\StoreTokenException * @throws \MaciejKosiarski\JwtKeeperBundle\Exception\UnexpectedTokenTypeException */ - public function testStorage() + public function testStorage(): void { $fakeToken = 'fake_token'; $storage = new JwtStorage(md5('test_hash')); @@ -42,7 +42,7 @@ public function testStorage() $this->assertEquals($fakeToken, $storage->getToken()); } - public function testKeyException() + public function testKeyException(): void { $this->expectException(StorageCacheKeyException::class); @@ -54,7 +54,7 @@ public function testKeyException() * @throws \MaciejKosiarski\JwtKeeperBundle\Exception\RetrieveTokenException * @throws \MaciejKosiarski\JwtKeeperBundle\Exception\UnexpectedTokenTypeException */ - public function testFindException() + public function testFindException(): void { $this->expectException(RetrieveTokenException::class); @@ -65,7 +65,7 @@ public function testFindException() /** * @throws \Psr\Cache\InvalidArgumentException */ - protected function tearDown() + protected function tearDown(): void { $cache = new FilesystemAdapter(); $cache->delete(JwtStorage::STORAGE .'.'. $this->testHash);