diff --git a/simplesamlphp_auth.api.php b/simplesamlphp_auth.api.php
index 60a6555e..f85453ec 100644
--- a/simplesamlphp_auth.api.php
+++ b/simplesamlphp_auth.api.php
@@ -1,5 +1,6 @@
 <?php

+use Drupal\user\UserInterface;
 /**
  * @file
  * Hooks for simpleSAMLphp Authentication module.
@@ -77,7 +78,7 @@ function hook_simplesamlphp_auth_allow_login($attributes) {
  * @param \Drupal\user\UserInterface $account
  *   The pre-existing Drupal user to be SAML-enabled.
  */
-function hook_simplesamlphp_auth_account_authname_alter(&$authname, \Drupal\user\UserInterface $account) {
+function hook_simplesamlphp_auth_account_authname_alter(&$authname, UserInterface $account) {
   $authname = $account->mail;
 }

@@ -127,7 +128,7 @@ function hook_simplesamlphp_auth_existing_user($attributes) {
  * @return \Drupal\user\UserInterface|bool
  *   The altered Drupal account or FALSE if nothing was changed.
  */
-function hook_simplesamlphp_auth_user_attributes(\Drupal\user\UserInterface $account, $attributes) {
+function hook_simplesamlphp_auth_user_attributes(UserInterface $account, $attributes) {
   $saml_first_name = $attributes['first_name'];
   if ($saml_first_name) {
     $account->set('field_first_name', $saml_first_name);
diff --git a/simplesamlphp_auth.info.yml b/simplesamlphp_auth.info.yml
index a8066751..baea8f9d 100644
--- a/simplesamlphp_auth.info.yml
+++ b/simplesamlphp_auth.info.yml
@@ -2,7 +2,7 @@ name: SimpleSAMLphp Authentication
 type: module
 description: Allows users to authenticate to a remote SAML identity provider (IdP) via a locally configured SimpleSAMLphp service point (SP).
 core: 8.x
-core_version_requirement: ^8 || ^9
+core_version_requirement: ^8 || ^9 || ^10
 configure: simplesamlphp_auth.admin_settings
 dependencies:
  - drupal:user
diff --git a/src/EventSubscriber/SimplesamlSubscriber.php b/src/EventSubscriber/SimplesamlSubscriber.php
index 0e296473..a4c6a801 100644
--- a/src/EventSubscriber/SimplesamlSubscriber.php
+++ b/src/EventSubscriber/SimplesamlSubscriber.php
@@ -9,7 +9,7 @@
 use Drupal\simplesamlphp_auth\Service\SimplesamlphpAuthManager;
 use Symfony\Component\HttpFoundation\RedirectResponse;
 use Symfony\Component\HttpKernel\KernelEvents;
-use Symfony\Component\HttpKernel\Event\GetResponseEvent;
+use Symfony\Component\HttpKernel\Event\RequestEvent;
 use Symfony\Component\EventDispatcher\EventSubscriberInterface;
 use Psr\Log\LoggerInterface;

@@ -78,10 +78,10 @@ public function __construct(SimplesamlphpAuthManager $simplesaml, AccountInterfa
   /**
    * Logs out user if not SAML authenticated and local logins are disabled.
    *
-   * @param \Symfony\Component\HttpKernel\Event\GetResponseEvent $event
+   * @param \Symfony\Component\HttpKernel\Event\RequestEvent $event
    *   The subscribed event.
    */
-  public function checkAuthStatus(GetResponseEvent $event) {
+  public function checkAuthStatus(RequestEvent $event) {
     if ($this->account->isAnonymous()) {
       return;
     }
@@ -114,17 +114,16 @@ public function checkAuthStatus(GetResponseEvent $event) {

     $response = new RedirectResponse('/', RedirectResponse::HTTP_FOUND);
     $event->setResponse($response);
-    $event->stopPropagation();

   }

   /**
    * Redirect anonymous users to the external IdP from the Drupal login page.
    *
-   * @param \Symfony\Component\HttpKernel\Event\GetResponseEvent $event
+   * @param \Symfony\Component\HttpKernel\Event\RequestEvent $event
    *   The subscribed event.
    */
-  public function login_directly_with_external_IdP(GetResponseEvent $event) {
+  public function login_directly_with_external_IdP(RequestEvent $event) {

     if ($this->config->get('allow.default_login')) {
       return;
@@ -139,7 +138,6 @@ public function login_directly_with_external_IdP(GetResponseEvent $event) {
       // Redirect directly to the external IdP.
       $response = new RedirectResponse($saml_login_path, RedirectResponse::HTTP_FOUND);
       $event->setResponse($response);
-      $event->stopPropagation();

     }
   }
diff --git a/tests/simplesamlphp_auth_test/simplesamlphp_auth_test.info.yml b/tests/simplesamlphp_auth_test/simplesamlphp_auth_test.info.yml
index 97327ff3..d537d53c 100644
--- a/tests/simplesamlphp_auth_test/simplesamlphp_auth_test.info.yml
+++ b/tests/simplesamlphp_auth_test/simplesamlphp_auth_test.info.yml
@@ -2,7 +2,7 @@ name: 'SimpleSAMLPHP Authentication Test module'
 type: module
 description: 'Support module for SimpleSAMLPHP Authentication tests'
 core: 8.x
-core_version_requirement: ^8 || ^9
+core_version_requirement: ^8 || ^9 || ^10
 dependencies:
   - drupal:user
 hidden: true
diff --git a/tests/src/Functional/SimplesamlphpAuthTest.php b/tests/src/Functional/SimplesamlphpAuthTest.php
index ef5dece1..3957d7a3 100644
--- a/tests/src/Functional/SimplesamlphpAuthTest.php
+++ b/tests/src/Functional/SimplesamlphpAuthTest.php
@@ -21,7 +21,7 @@ class SimplesamlphpAuthTest extends BrowserTestBase {
    *
    * @var string[]
    */
-  public static $modules = [
+  protected static $modules = [
     'block',
     'simplesamlphp_auth',
     'simplesamlphp_auth_test',
@@ -44,7 +44,7 @@ class SimplesamlphpAuthTest extends BrowserTestBase {
   /**
    * {@inheritdoc}
    */
-  public function setUp() {
+  public function setUp(): void {
     parent::setUp();
     $this->adminUser = $this->drupalCreateUser([
       'access administration pages',
@@ -87,7 +87,8 @@ public function testFederatedLoginLink() {
     $this->drupalGet('admin/structure/block/add/simplesamlphp_auth_block/' . $default_theme);
     $edit = [];
     $edit['region'] = 'sidebar_first';
-    $this->drupalPostForm('admin/structure/block/add/simplesamlphp_auth_block/' . $default_theme, $edit, t('Save block'));
+    $this->drupalGet('admin/structure/block/add/simplesamlphp_auth_block/' . $default_theme);
+    $this->submitForm($edit, t('Save block'));

     // Assert Login link in SimplesamlphpAuthBlock.
     $this->assertSession()->elementTextContains('css', '.region-sidebar-first .block-simplesamlphp-auth-block h2', 'SimpleSAMLphp Auth Status');
diff --git a/tests/src/Unit/Service/SimplesamlphpAuthManagerTest.php b/tests/src/Unit/Service/SimplesamlphpAuthManagerTest.php
index 3cb5e8f7..7591fb14 100644
--- a/tests/src/Unit/Service/SimplesamlphpAuthManagerTest.php
+++ b/tests/src/Unit/Service/SimplesamlphpAuthManagerTest.php
@@ -29,63 +29,63 @@ class SimplesamlphpAuthManagerTest extends UnitTestCase {
   /**
    * A mocked config factory instance.
    *
-   * @var \Drupal\Core\Config\ConfigFactoryInterface|\PHPUnit_Framework_MockObject_MockObject
+   * @var \Drupal\Core\Config\ConfigFactoryInterface|\PHPUnit\Framework\MockObject\MockObject
    */
   protected $configFactory;

   /**
    * A mocked SimpleSAML configuration instance.
    *
-   * @var \SimpleSAML\Configuration|\PHPUnit_Framework_MockObject_MockObject
+   * @var \SimpleSAML\Configuration|\PHPUnit\Framework\MockObject\MockObject
    */
   protected $simplesamlConfig;

   /**
    * A mocked SimpleSAML instance.
    *
-   * @var \SimpleSAML\Auth\Simple|\PHPUnit_Framework_MockObject_MockObject
+   * @var \SimpleSAML\Auth\Simple|\PHPUnit\Framework\MockObject\MockObject
    */
   public $instance;

   /**
    * A mocked current user.
    *
-   * @var \Drupal\Core\Session\AccountInterface|\PHPUnit_Framework_MockObject_MockObject
+   * @var \Drupal\Core\Session\AccountInterface|\PHPUnit\Framework\MockObject\MockObject
    */
   protected $currentUser;

   /**
    * A mocked AdminContext.
    *
-   * @var \Drupal\Core\Routing\AdminContext|\PHPUnit_Framework_MockObject_MockObject
+   * @var \Drupal\Core\Routing\AdminContext|\PHPUnit\Framework\MockObject\MockObject
    */
   protected $adminContext;

   /**
    * A mocked ModuleHandlerInterface.
    *
-   * @var \Drupal\Core\Extension\ModuleHandlerInterface|\PHPUnit_Framework_MockObject_MockObject
+   * @var \Drupal\Core\Extension\ModuleHandlerInterface|\PHPUnit\Framework\MockObject\MockObject
    */
   protected $moduleHandler;

   /**
    * A mocked RequestStack.
    *
-   * @var \Symfony\Component\HttpFoundation\RequestStack|\PHPUnit_Framework_MockObject_MockObject
+   * @var \Symfony\Component\HttpFoundation\RequestStack|\PHPUnit\Framework\MockObject\MockObject
    */
   protected $requestStack;

   /**
    * A mocked messenger.
    *
-   * @var \Drupal\Core\Messenger\MessengerInterface|\PHPUnit_Framework_MockObject_MockObject
+   * @var \Drupal\Core\Messenger\MessengerInterface|\PHPUnit\Framework\MockObject\MockObject
    */
   protected $messenger;

   /**
    * {@inheritdoc}
    */
-  protected function setUp() {
+  protected function setUp(): void {
     parent::setUp();

     // Set up default test configuration Mock object.
@@ -100,50 +100,27 @@ protected function setUp() {
       ],
     ]);

-    $this->instance = $this->getMockBuilder(Simple::class)
-      ->setMethods([
-        'isAuthenticated',
-        'requireAuth',
-        'getAttributes',
-        'logout',
-      ])
-      ->disableOriginalConstructor()
-      ->getMock();
+    $this->instance = $this->createMock(Simple::class);

-    $this->currentUser = $this->getMockBuilder(AccountInterface::class)
-      ->disableOriginalConstructor()
-      ->getMock();
+    $this->currentUser = $this->createMock(AccountInterface::class);

-    $this->adminContext = $this->getMockBuilder(AdminContext::class)
-      ->disableOriginalConstructor()
-      ->getMock();
+    $this->adminContext = $this->createMock(AdminContext::class);

-    $this->moduleHandler = $this->getMockBuilder(ModuleHandlerInterface::class)
-      ->disableOriginalConstructor()
-      ->getMock();
+    $this->moduleHandler = $this->createMock(ModuleHandlerInterface::class);

     $this->moduleHandler->expects($this->any())
       ->method('getImplementations')
       ->with($this->equalTo('simplesamlphp_auth_allow_login'))
       ->will($this->returnValue([]));

-    $this->requestStack = $this->getMockBuilder(RequestStack::class)
-      ->disableOriginalConstructor()
-      ->getMock();
+    $this->requestStack = $this->createMock(RequestStack::class);

-    $this->messenger = $this->getMockBuilder(MessengerInterface::class)
-      ->disableOriginalConstructor()
-      ->getMock();
+    $this->messenger = $this->createMock(MessengerInterface::class);

-    $this->simplesamlConfig = $this->getMockBuilder(Configuration::class)
-      ->setMethods(['getValue'])
-      ->disableOriginalConstructor()
-      ->getMock();
+    $this->simplesamlConfig = $this->createMock(Configuration::class);

     $container = new ContainerBuilder();
-    $request = $this->getMockBuilder(Request::class)
-      ->disableOriginalConstructor()
-      ->getMock();
+    $request = $this->createMock(Request::class);

     $this->requestStack->expects($this->any())
       ->method('getCurrentRequest')
diff --git a/tests/src/Unit/Service/SimplesamlphpDrupalAuthTest.php b/tests/src/Unit/Service/SimplesamlphpDrupalAuthTest.php
index 8b3a1a1d..afd38838 100644
--- a/tests/src/Unit/Service/SimplesamlphpDrupalAuthTest.php
+++ b/tests/src/Unit/Service/SimplesamlphpDrupalAuthTest.php
@@ -21,28 +21,28 @@ class SimplesamlphpDrupalAuthTest extends UnitTestCase {
   /**
    * The mocked SimpleSAMLphp Authentication helper.
    *
-   * @var \Drupal\simplesamlphp_auth\Service\SimplesamlphpAuthManager|\PHPUnit_Framework_MockObject_MockObject
+   * @var \Drupal\simplesamlphp_auth\Service\SimplesamlphpAuthManager|\PHPUnit\Framework\MockObject\MockObject
    */
   protected $simplesaml;

   /**
    * The mocked entity type manager.
    *
-   * @var \Drupal\Core\Entity\EntityTypeManagerInterface|\PHPUnit_Framework_MockObject_MockObject
+   * @var \Drupal\Core\Entity\EntityTypeManagerInterface|\PHPUnit\Framework\MockObject\MockObject
    */
   protected $entityTypeManager;

   /**
    * The mocked logger instance.
    *
-   * @var \Psr\Log\LoggerInterface|\PHPUnit_Framework_MockObject_MockObject
+   * @var \Psr\Log\LoggerInterface|\PHPUnit\Framework\MockObject\MockObject
    */
   protected $logger;

   /**
    * The mocked config factory instance.
    *
-   * @var \Drupal\Core\Config\ConfigFactoryInterface|\PHPUnit_Framework_MockObject_MockObject
+   * @var \Drupal\Core\Config\ConfigFactoryInterface|\PHPUnit\Framework\MockObject\MockObject
    */
   protected $configFactory;

@@ -63,43 +63,35 @@ class SimplesamlphpDrupalAuthTest extends UnitTestCase {
   /**
    * A mocked messenger.
    *
-   * @var \Drupal\Core\Messenger\MessengerInterface|\PHPUnit_Framework_MockObject_MockObject
+   * @var \Drupal\Core\Messenger\MessengerInterface|\PHPUnit\Framework\MockObject\MockObject
    */
   protected $messenger;

   /**
    * A mocked ModuleHandlerInterface.
    *
-   * @var \Drupal\Core\Extension\ModuleHandlerInterface|\PHPUnit_Framework_MockObject_MockObject
+   * @var \Drupal\Core\Extension\ModuleHandlerInterface|\PHPUnit\Framework\MockObject\MockObject
    */
   protected $moduleHandler;

   /**
    * {@inheritdoc}
    */
-  protected function setUp() {
+  protected function setUp(): void {
     parent::setUp();

     $this->entityTypeManager = $this->createMock('\Drupal\Core\Entity\EntityTypeManagerInterface');

-    $this->logger = $this->getMockBuilder('\Psr\Log\LoggerInterface')
-      ->disableOriginalConstructor()
-      ->getMock();
+    $this->logger = $this->createMock('\Psr\Log\LoggerInterface');

-    $this->messenger = $this->getMockBuilder(MessengerInterface::class)
-      ->disableOriginalConstructor()
-      ->getMock();
+    $this->messenger = $this->createMock(MessengerInterface::class);

-    $this->moduleHandler = $this->getMockBuilder(ModuleHandlerInterface::class)
-      ->disableOriginalConstructor()
-      ->getMock();
+    $this->moduleHandler = $this->createMock(ModuleHandlerInterface::class);

     $this->moduleHandler->expects($this->any())
       ->method('alter');

-    $this->simplesaml = $this->getMockBuilder('\Drupal\simplesamlphp_auth\Service\SimplesamlphpAuthManager')
-      ->disableOriginalConstructor()
-      ->getMock();
+    $this->simplesaml = $this->createMock('\Drupal\simplesamlphp_auth\Service\SimplesamlphpAuthManager');

     $this->configFactory = $this->getConfigFactoryStub([
       'simplesamlphp_auth.settings' => [
@@ -193,10 +185,7 @@ public function testExternalLoginWithRoleMatch() {
       ->will($this->returnValue($this->entityAccount));

     // Create a Mock SimplesamlphpAuthManager object.
-    $simplesaml = $this->getMockBuilder('\Drupal\simplesamlphp_auth\Service\SimplesamlphpAuthManager')
-      ->disableOriginalConstructor()
-      ->setMethods(['getAttributes'])
-      ->getMock();
+    $simplesaml = $this->createMock('\Drupal\simplesamlphp_auth\Service\SimplesamlphpAuthManager');

     // Mock the getAttributes() method on SimplesamlphpAuthManager.
     $attributes = ['eduPersonAffiliation' => ['student']];
@@ -307,10 +296,7 @@ public function testExternalRegisterWithAutoEnableSaml() {
       ->will($this->returnValue($entity_storage));

     // Create a Mock ExternalAuth object.
-    $externalauth = $this->getMockBuilder('\Drupal\externalauth\ExternalAuth')
-      ->disableOriginalConstructor()
-      ->setMethods(['register', 'linkExistingAccount', 'userLoginFinalize'])
-      ->getMock();
+    $externalauth = $this->createMock('\Drupal\externalauth\ExternalAuth');

     // Set up expectations for ExternalAuth service.
     $externalauth->expects($this->once())
@@ -355,10 +341,7 @@ public function testExternalRegisterWithAutoEnableSaml() {
    */
   public function testSynchronizeUserAttributes() {
     // Create a Mock SimplesamlphpAuthManager object.
-    $simplesaml = $this->getMockBuilder('\Drupal\simplesamlphp_auth\Service\SimplesamlphpAuthManager')
-      ->disableOriginalConstructor()
-      ->setMethods(['getDefaultName', 'getDefaultEmail'])
-      ->getMock();
+    $simplesaml = $this->createMock('\Drupal\simplesamlphp_auth\Service\SimplesamlphpAuthManager');

     // Mock the getDefaultName() & getDefaultEmail methods.
     $simplesaml->expects($this->once())
@@ -422,10 +405,7 @@ public function testRoleMatching($rolemap, $attributes, $expected_roles) {
     ]);

     // Create a Mock SimplesamlphpAuthManager object.
-    $simplesaml = $this->getMockBuilder('\Drupal\simplesamlphp_auth\Service\SimplesamlphpAuthManager')
-      ->disableOriginalConstructor()
-      ->setMethods(['getAttributes'])
-      ->getMock();
+    $simplesaml = $this->createMock('\Drupal\simplesamlphp_auth\Service\SimplesamlphpAuthManager');

     // Mock the getAttributes() method on SimplesamlphpAuthManager.
     $simplesaml->expects($this->any())
