Skip to content

Commit

Permalink
tests: make data providers static
Browse files Browse the repository at this point in the history
Fixes:
```
1) PHPOpenSourceSaver\JWTAuth\Test\BlacklistTest::itShouldCheckWhetherATokenHasNotBeenBlacklisted
Data Provider method PHPOpenSourceSaver\JWTAuth\Test\BlacklistTest::blacklist_provider() is not static

/home/runner/work/jwt-auth/jwt-auth/tests/BlacklistTest.php:198

2) PHPOpenSourceSaver\JWTAuth\Test\Http\ParserTest::itShouldHandleExcessWhitespaceFromTheAuthorizationHeader
Data Provider method PHPOpenSourceSaver\JWTAuth\Test\Http\ParserTest::whitespaceProvider() is not static

/home/runner/work/jwt-auth/jwt-auth/tests/Http/ParserTest.php:137

3) PHPOpenSourceSaver\JWTAuth\Test\Validators\TokenValidatorTest::itShouldReturnFalseWhenProvidingAMalformedToken
Data Provider method \PHPOpenSourceSaver\JWTAuth\Test\Validators\TokenValidatorTest::dataProviderMalformedTokens() is not static

/home/runner/work/jwt-auth/jwt-auth/tests/Validators/TokenValidatorTest.php:46

4) PHPOpenSourceSaver\JWTAuth\Test\Validators\TokenValidatorTest::itShouldThrowAnExceptionWhenProvidingAMalformedToken
Data Provider method \PHPOpenSourceSaver\JWTAuth\Test\Validators\TokenValidatorTest::dataProviderMalformedTokens() is not static

/home/runner/work/jwt-auth/jwt-auth/tests/Validators/TokenValidatorTest.php:56

5) PHPOpenSourceSaver\JWTAuth\Test\Validators\TokenValidatorTest::itShouldReturnFalseWhenProvidingATokenWithWrongSegmentsNumber
Data Provider method \PHPOpenSourceSaver\JWTAuth\Test\Validators\TokenValidatorTest::dataProviderTokensWithWrongSegmentsNumber() is not static

/home/runner/work/jwt-auth/jwt-auth/tests/Validators/TokenValidatorTest.php:69

6) PHPOpenSourceSaver\JWTAuth\Test\Validators\TokenValidatorTest::itShouldThrowAnExceptionWhenProvidingAMalformedTokenWithWrongSegmentsNumber
Data Provider method \PHPOpenSourceSaver\JWTAuth\Test\Validators\TokenValidatorTest::dataProviderTokensWithWrongSegmentsNumber() is not static
```
  • Loading branch information
mfn committed Feb 21, 2024
1 parent e6b10a0 commit 6725da1
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion tests/BlacklistTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ public function itShouldCheckWhetherATokenHasBeenBlacklisted()
$this->assertTrue($this->blacklist->has($payload));
}

public function blacklist_provider()
public static function blacklist_provider()
{
return [
[null],
Expand Down
2 changes: 1 addition & 1 deletion tests/Http/ParserTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ public function itShouldHandleExcessWhitespaceFromTheAuthorizationHeader($whites
$this->assertTrue($parser->hasToken());
}

public function whitespaceProvider()
public static function whitespaceProvider()
{
return [
'space' => [' '],
Expand Down
4 changes: 2 additions & 2 deletions tests/Validators/TokenValidatorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public function itShouldThrowAnExceptionWhenProvidingAMalformedTokenWithWrongSeg
$this->validator->check($token);
}

public function dataProviderMalformedTokens()
public static function dataProviderMalformedTokens()
{
return [
['one.two.'],
Expand All @@ -97,7 +97,7 @@ public function dataProviderMalformedTokens()
];
}

public function dataProviderTokensWithWrongSegmentsNumber()
public static function dataProviderTokensWithWrongSegmentsNumber()
{
return [
['one.two'],
Expand Down

0 comments on commit 6725da1

Please sign in to comment.