diff --git a/src/Authentication/Provider/JwtAuth.php b/src/Authentication/Provider/JwtAuth.php index 55a7f53..374c3da 100644 --- a/src/Authentication/Provider/JwtAuth.php +++ b/src/Authentication/Provider/JwtAuth.php @@ -43,6 +43,13 @@ class JwtAuth implements AuthenticationProviderInterface { */ protected $transcoder; + /** + * The event dispatcher. + * + * @var \Symfony\Component\EventDispatcher\EventDispatcherInterface + */ + protected $eventDispatcher; + /** * Constructs a HTTP basic authentication provider object. * diff --git a/tests/src/Functional/AuthHeaderTest.php b/tests/src/Functional/AuthHeaderTest.php index 4b3e17f..62c03d2 100644 --- a/tests/src/Functional/AuthHeaderTest.php +++ b/tests/src/Functional/AuthHeaderTest.php @@ -7,7 +7,7 @@ use Drupal\Tests\BrowserTestBase; /** * Tests the functionality of default and custom authorization header. * - * @group field + * @group JWT */ class AuthHeaderTest extends BrowserTestBase { @@ -28,7 +28,14 @@ class AuthHeaderTest extends BrowserTestBase { /** * {@inheritdoc} */ - public static $modules = ['system', 'key', 'jwt', 'jwt_auth_issuer', 'jwt_auth_consumer', 'jwt_test']; + public static $modules = [ + 'system', + 'key', + 'jwt', + 'jwt_auth_issuer', + 'jwt_auth_consumer', + 'jwt_test', + ]; /** * {@inheritdoc} @@ -45,11 +52,11 @@ class AuthHeaderTest extends BrowserTestBase { } /** - * Tests the JWT authorization. + * Asserts the JWT authorization. * - * @param $uid + * @param int $uid * User ID to which should be authorized. - * @param $auth_header + * @param string $auth_header * The authorization header. * @param bool $negate * Optional. Negate authorization by checking user is not authorized. @@ -57,7 +64,7 @@ class AuthHeaderTest extends BrowserTestBase { protected function assertJwtAuthorization($uid, $auth_header, $negate = FALSE) { // Get the http client to have a clean request with only a single header. $client = $this->getHttpClient(); - /** @var \GuzzleHttp\Client $client*/ + /** @var \GuzzleHttp\Client $client */ $response = $client->get($this->buildUrl(''), [ 'headers' => [ $auth_header => 'Bearer ' . $this->token, @@ -83,11 +90,11 @@ class AuthHeaderTest extends BrowserTestBase { } /** - * Tests the user is JWT authorized. + * Asserts the user is JWT authorized. * - * @param $uid + * @param int $uid * User ID to which should be authorized. - * @param $auth_header + * @param string $auth_header * The authorization header. Default to authorization. */ protected function assertIsUserJwtAuthorized($uid, $auth_header = 'Authorization') { @@ -95,11 +102,11 @@ class AuthHeaderTest extends BrowserTestBase { } /** - * Tests the user is not JWT authorized. + * Asserts the user is not JWT authorized. * - * @param $uid + * @param int $uid * User ID to which should be authorized. - * @param $auth_header + * @param string $auth_header * The authorization header. Default to authorization. */ protected function assertIsNotUserJwtAuthorized($uid, $auth_header = 'Authorization') { diff --git a/tests/src/Kernel/BasicTest.php b/tests/src/Kernel/BasicTest.php index f5a0662..f9972cc 100644 --- a/tests/src/Kernel/BasicTest.php +++ b/tests/src/Kernel/BasicTest.php @@ -4,7 +4,6 @@ namespace Drupal\Tests\jwt\Kernel; use Drupal\KernelTests\KernelTestBase; - /** * Tests JWT config schema. *