diff --git a/core/tests/Drupal/KernelTests/Core/Session/AccountSwitcherTest.php b/core/tests/Drupal/KernelTests/Core/Session/AccountSwitcherTest.php
index 0492d77347..f6db9111f1 100644
--- a/core/tests/Drupal/KernelTests/Core/Session/AccountSwitcherTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Session/AccountSwitcherTest.php
@@ -24,12 +24,12 @@ public function testAccountSwitching() {
 
     // Verify that the active user has changed, and that session saving is
     // disabled.
-    $this->assertEqual($user->id(), 2, 'Switched to user 2.');
+    $this->assertEquals($user->id(), 2, 'Switched to user 2.');
     $this->assertFalse($session_handler->isSessionWritable(), 'Session saving is disabled.');
 
     // Perform a second (nested) user account switch.
     $switcher->switchTo(new UserSession(['uid' => 3]));
-    $this->assertEqual($user->id(), 3, 'Switched to user 3.');
+    $this->assertEquals($user->id(), 3, 'Switched to user 3.');
 
     // Revert to the user session that was active between the first and second
     // switch.
@@ -37,7 +37,7 @@ public function testAccountSwitching() {
 
     // Since we are still in the account from the first switch, session handling
     // still needs to be disabled.
-    $this->assertEqual($user->id(), 2, 'Reverted to user 2.');
+    $this->assertEquals($user->id(), 2, 'Reverted to user 2.');
     $this->assertFalse($session_handler->isSessionWritable(), 'Session saving still disabled.');
 
     // Revert to the original account which was active before the first switch.
@@ -45,8 +45,8 @@ public function testAccountSwitching() {
 
     // Assert that the original account is active again, and that session saving
     // has been re-enabled.
-    $this->assertEqual($user->id(), $original_user->id(), 'Original user correctly restored.');
-    $this->assertEqual($session_handler->isSessionWritable(), $original_session_saving, 'Original session saving correctly restored.');
+    $this->assertEquals($user->id(), $original_user->id(), 'Original user correctly restored.');
+    $this->assertEquals($session_handler->isSessionWritable(), $original_session_saving, 'Original session saving correctly restored.');
 
     // Verify that AccountSwitcherInterface::switchBack() will throw
     // an exception if there are no accounts left in the stack.
