diff --git a/tests/src/Unit/FotowebLoginManagerTest.php b/tests/src/Unit/FotowebLoginManagerTest.php
index 69ca8a9..e130e61 100644
--- a/tests/src/Unit/FotowebLoginManagerTest.php
+++ b/tests/src/Unit/FotowebLoginManagerTest.php
@@ -28,7 +28,7 @@ class FotowebLoginManagerTest extends UnitTestCase {
   /**
    * {@inheritdoc}
    */
-  protected function setUp() {
+  protected function setUp(): void {
     parent::setUp();
 
     $config_factory = $this
@@ -42,17 +42,13 @@ class FotowebLoginManagerTest extends UnitTestCase {
     $container->set('config.factory', $config_factory);
 
     // Create mocks.
-    $fieldItem = $this->getMockBuilder(FieldItemListInterface::class)
-      ->disableOriginalConstructor()
-      ->getMock();
+    $fieldItem = $this->createMock(FieldItemListInterface::class);
     $fieldItem->expects($this->any())
       ->method('__get')
       ->with('value')
       ->willReturn('fotoweb_testuser');
 
-    $testUser = $this->getMockBuilder('Drupal\user\Entity\User')
-      ->disableOriginalConstructor()
-      ->getMock();
+    $testUser = $this->createMock('Drupal\user\Entity\User');
     $testUser->expects($this->any())
       ->method('hasField')
       ->with('name')
@@ -83,7 +79,7 @@ class FotowebLoginManagerTest extends UnitTestCase {
     $username = 'fotoweb_testuser';
     // The login token uses time based components, so we are only checking
     // for the expected format.
-    $this->assertRegExp('/^[A-Za-z0-9]{0,130}==$/', $this->fotowebLoginManager->getUserLoginTokenFromUsername($username));
+    $this->assertMatchesRegularExpression('/^[A-Za-z0-9]{0,130}==$/', $this->fotowebLoginManager->getUserLoginTokenFromUsername($username));
   }
 
   /**
@@ -95,7 +91,7 @@ class FotowebLoginManagerTest extends UnitTestCase {
       ->method('id')
       ->will($this->returnValue(1));
 
-    $this->assertRegExp('/^[A-Za-z0-9]{0,130}==$/', $this->fotowebLoginManager->getLoginTokenFromAccount($account));
+    $this->assertMatchesRegularExpression('/^[A-Za-z0-9]{0,130}==$/', $this->fotowebLoginManager->getLoginTokenFromAccount($account));
   }
 
 }
diff --git a/tests/src/Unit/RenditionImageFetcherTest.php b/tests/src/Unit/RenditionImageFetcherTest.php
index f02e37b..a3c7f1d 100644
--- a/tests/src/Unit/RenditionImageFetcherTest.php
+++ b/tests/src/Unit/RenditionImageFetcherTest.php
@@ -30,7 +30,7 @@ class RenditionImageFetcherTest extends UnitTestCase {
   /**
    * {@inheritdoc}
    */
-  protected function setUp() {
+  protected function setUp(): void {
     parent::setUp();
 
     $configFactory = $this
diff --git a/tests/src/Unit/RenditionNegotiatorTest.php b/tests/src/Unit/RenditionNegotiatorTest.php
index dd5b1d2..363a072 100644
--- a/tests/src/Unit/RenditionNegotiatorTest.php
+++ b/tests/src/Unit/RenditionNegotiatorTest.php
@@ -24,7 +24,7 @@ class RenditionNegotiatorTest extends UnitTestCase {
   /**
    * {@inheritdoc}
    */
-  protected function setUp() {
+  protected function setUp(): void {
     parent::setUp();
 
     $configFactory = $this
