public function SimpleOauthAuthenticationTest::testHasTokenValue in Simple OAuth (OAuth2) & OpenID Connect 8.4
Same name and namespace in other branches
- 8.2 tests/src/Unit/Authentication/Provider/SimpleOauthAuthenticationTest.php \Drupal\Tests\simple_oauth\Unit\Authentication\Provider\SimpleOauthAuthenticationTest::testHasTokenValue()
- 8.3 tests/src/Unit/Authentication/Provider/SimpleOauthAuthenticationTest.php \Drupal\Tests\simple_oauth\Unit\Authentication\Provider\SimpleOauthAuthenticationTest::testHasTokenValue()
- 5.x tests/src/Unit/Authentication/Provider/SimpleOauthAuthenticationTest.php \Drupal\Tests\simple_oauth\Unit\Authentication\Provider\SimpleOauthAuthenticationTest::testHasTokenValue()
@covers ::applies
@dataProvider hasTokenValueProvider
File
- tests/
src/ Unit/ Authentication/ Provider/ SimpleOauthAuthenticationTest.php, line 53
Class
- SimpleOauthAuthenticationTest
- @coversDefaultClass \Drupal\simple_oauth\Authentication\Provider\SimpleOauthAuthenticationProvider @group simple_oauth
Namespace
Drupal\Tests\simple_oauth\Unit\Authentication\ProviderCode
public function testHasTokenValue($authorization, $has_token) {
$request = new Request();
if ($authorization !== NULL) {
$request->headers
->set('Authorization', $authorization);
}
$this
->assertSame($has_token, $this->provider
->applies($request));
$this
->assertSame($has_token ? RequestPolicyInterface::DENY : NULL, $this->oauthPageCacheRequestPolicy
->check($request));
}