public function SimpleOauthAuthenticationTest::hasTokenValueProvider in Simple OAuth (OAuth2) & OpenID Connect 5.x
Same name and namespace in other branches
- 8.4 tests/src/Unit/Authentication/Provider/SimpleOauthAuthenticationTest.php \Drupal\Tests\simple_oauth\Unit\Authentication\Provider\SimpleOauthAuthenticationTest::hasTokenValueProvider()
- 8.2 tests/src/Unit/Authentication/Provider/SimpleOauthAuthenticationTest.php \Drupal\Tests\simple_oauth\Unit\Authentication\Provider\SimpleOauthAuthenticationTest::hasTokenValueProvider()
- 8.3 tests/src/Unit/Authentication/Provider/SimpleOauthAuthenticationTest.php \Drupal\Tests\simple_oauth\Unit\Authentication\Provider\SimpleOauthAuthenticationTest::hasTokenValueProvider()
File
- tests/
src/ Unit/ Authentication/ Provider/ SimpleOauthAuthenticationTest.php, line 67
Class
- SimpleOauthAuthenticationTest
- @coversDefaultClass \Drupal\simple_oauth\Authentication\Provider\SimpleOauthAuthenticationProvider @group simple_oauth
Namespace
Drupal\Tests\simple_oauth\Unit\Authentication\ProviderCode
public function hasTokenValueProvider() {
$token = $this
->getRandomGenerator()
->name();
$data = [];
// 1. Authentication header.
$data[] = [
'Bearer ' . $token,
TRUE,
];
// 2. Authentication header. Trailing white spaces.
$data[] = [
' Bearer ' . $token,
TRUE,
];
// 3. Authentication header. No white spaces.
$data[] = [
'Foo' . $token,
FALSE,
];
// 4. Authentication header. Empty value.
$data[] = [
'',
FALSE,
];
// 5. Authentication header. Fail: no token.
$data[] = [
NULL,
FALSE,
];
return $data;
}