Skip to content

Commit

Permalink
Fix unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
maciejkosiarski committed Oct 9, 2020
1 parent 127e49c commit 968767b
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
10 changes: 5 additions & 5 deletions Tests/JwtFinderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand All @@ -36,7 +36,7 @@ public function testHS256()
/**
* @throws \MaciejKosiarski\JwtKeeperBundle\Exception\ScanResponseException
*/
public function testHS384()
public function testHS384(): void
{
$hs384 = 'eyJhbGciOiJIUzM4NCIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiYWRtaW4iOnRydWUsImlhdCI6MTUxNjIzOTAyMn0.bQTnz6AuMJvmXXQsVPrxeQNvzDkimo7VNXxHeSBfClLufmCVZRUuyTwJF311JHuh';

Expand All @@ -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';

Expand All @@ -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';

Expand All @@ -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';

Expand Down
8 changes: 4 additions & 4 deletions Tests/JwtKeeperTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class JwtKeeperTest extends TestCase
/**
* @throws \Psr\Cache\InvalidArgumentException
*/
protected function setUp()
protected function setUp(): void
{
$this->testHash = md5('test_hash');

Expand All @@ -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);
Expand Down Expand Up @@ -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('', '', '');
Expand All @@ -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);
Expand Down
10 changes: 5 additions & 5 deletions Tests/JwtStorageTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class JwtStorageTest extends TestCase
/**
* @throws \Psr\Cache\InvalidArgumentException
*/
protected function setUp()
protected function setUp(): void
{
$this->testHash = md5('test_hash');

Expand All @@ -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'));
Expand All @@ -42,7 +42,7 @@ public function testStorage()
$this->assertEquals($fakeToken, $storage->getToken());
}

public function testKeyException()
public function testKeyException(): void
{
$this->expectException(StorageCacheKeyException::class);

Expand All @@ -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);

Expand All @@ -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);
Expand Down

0 comments on commit 968767b

Please sign in to comment.