diff --git a/TESTING.md b/TESTING.md
index 3dbb738178f63caceddc528f7b3978ede726c504..e0c4fd0e94ef4cffec6addb03fe9a0f3edec5eb3 100644
--- a/TESTING.md
+++ b/TESTING.md
@@ -27,13 +27,13 @@ definition:
 namespace SimpleSAML\Test\Utils;
 ```
 
-The test classes need to extend `PHPUnit_Framework_TestCase`, and inside
+The test classes need to extend `PHPUnit\Framework\TestCase`, and inside
 you can implement as many methods as you want. `phpunit` will only run
 the ones prefixed with "test".
 
 You will usually make use of the `assert*()` methods provided by
-`PHPUnit_Framework_TestCase`, but you can also tell `phpunit` to expect
-an exception to be thrown using *phpdoc*. For example, if you want to 
+`PHPUnit\Framework\TestCase`, but you can also tell `phpunit` to expect
+an exception to be thrown using *phpdoc*. For example, if you want to
 ensure that the `SimpleSAML\Utils\HTTP::addURLParameters()` method
 throws an exception in a specific situation:
 
@@ -47,7 +47,7 @@ throws an exception in a specific situation:
 ```
 
 Refer to [the `phpunit 4.8` documentation](https://phpunit.de/manual/4.8/en/installation.html)
-for more information on how to write tests. We currently use the `phpunit 4.8` 
+for more information on how to write tests. We currently use the `phpunit 4.8`
 since it is the last version to support php 5.3.
 
 Once you have implemented your tests, you can run them locally. First,
@@ -66,7 +66,7 @@ the old version installed by composer
 ./vendor/bin/phpunit -c tools/phpunit/phpunit.xml
 ```
 
-All the tests are run by our *continuous integration* platform, 
+All the tests are run by our *continuous integration* platform,
 [travis](https://travis-ci.org/simplesamlphp/simplesamlphp). If you are
 submitting a pull request, Travis will run your tests and notify whether
 your code builds or not according to them.
diff --git a/composer.json b/composer.json
index 66f86ca76058cb31bcd424d50181ee1318159750..6424ead7122481cf61bc15cf284e0f0e27802bad 100644
--- a/composer.json
+++ b/composer.json
@@ -45,7 +45,7 @@
     },
     "require-dev": {
         "ext-pdo_sqlite": "*",
-        "phpunit/phpunit": "~4.8",
+        "phpunit/phpunit": "~4.8.35",
         "mikey179/vfsStream": "~1.6",
         "friendsofphp/php-cs-fixer": "^2.2"
     },
diff --git a/composer.lock b/composer.lock
index 95ea5699196a00a382d03e6314c1168f4fd1f583..d889ae0365f64648906802db8eb296da1245809b 100644
--- a/composer.lock
+++ b/composer.lock
@@ -4,7 +4,7 @@
         "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
         "This file is @generated automatically"
     ],
-    "content-hash": "66d40cfe8e5bf764140f170bd2abed71",
+    "content-hash": "b4321ba6aa21f1dfd919f942037f2692",
     "packages": [
         {
             "name": "gettext/gettext",
diff --git a/tests/Utils/ClearStateTestCase.php b/tests/Utils/ClearStateTestCase.php
index 701dba29f95beb7b5e2d92063c8f071980ed313d..2cecc16b4c5d46af5774f50ee9332737f34b2389 100644
--- a/tests/Utils/ClearStateTestCase.php
+++ b/tests/Utils/ClearStateTestCase.php
@@ -4,10 +4,12 @@ namespace SimpleSAML\Test\Utils;
 
 include(dirname(__FILE__) . '/StateClearer.php');
 
+use PHPUnit\Framework\TestCase;
+
 /**
  * A base SSP test case that takes care of removing global state prior to test runs
  */
-class ClearStateTestCase extends \PHPUnit_Framework_TestCase
+class ClearStateTestCase extends TestCase
 {
     /**
      * Used for managing and clearing state
diff --git a/tests/lib/SimpleSAML/Auth/StateTest.php b/tests/lib/SimpleSAML/Auth/StateTest.php
index 5bbb9c5d88b28c8b25e03ea00efb66af5b6c0d14..0edb0b20ec8b2a94549f2e4a09aba1776b0d79fd 100644
--- a/tests/lib/SimpleSAML/Auth/StateTest.php
+++ b/tests/lib/SimpleSAML/Auth/StateTest.php
@@ -1,10 +1,11 @@
 <?php
 
+use PHPUnit\Framework\TestCase;
 
 /**
  * Tests for SimpleSAML_Auth_State
  */
-class Auth_StateTest extends PHPUnit_Framework_TestCase
+class Auth_StateTest extends TestCase
 {
 
 
diff --git a/tests/lib/SimpleSAML/DatabaseTest.php b/tests/lib/SimpleSAML/DatabaseTest.php
index 833d2e0ae618fe631f51febd4b9456d5cd0ecd0f..5fb137cea9fed7258474430c9d46c7aa49be06d6 100644
--- a/tests/lib/SimpleSAML/DatabaseTest.php
+++ b/tests/lib/SimpleSAML/DatabaseTest.php
@@ -1,5 +1,6 @@
 <?php
 
+use PHPUnit\Framework\TestCase;
 
 /**
  * This test ensures that the SimpleSAML_Database class can properly
@@ -12,7 +13,7 @@
  * @author Tyler Antonio, University of Alberta. <tantonio@ualberta.ca>
  * @package SimpleSAMLphp
  */
-class SimpleSAML_DatabaseTest extends PHPUnit_Framework_TestCase
+class SimpleSAML_DatabaseTest extends TestCase
 {
 
     /**
diff --git a/tests/lib/SimpleSAML/Locale/LanguageTest.php b/tests/lib/SimpleSAML/Locale/LanguageTest.php
index 7072a4930ccdf1504b0eeb2ae6c1317a71af1cf0..4b76c09d6187570990a2e4e0e45419a0f05e179c 100644
--- a/tests/lib/SimpleSAML/Locale/LanguageTest.php
+++ b/tests/lib/SimpleSAML/Locale/LanguageTest.php
@@ -2,9 +2,10 @@
 
 namespace SimpleSAML\Test\Locale;
 
+use PHPUnit\Framework\TestCase;
 use SimpleSAML\Locale\Language;
 
-class LanguageTest extends \PHPUnit_Framework_TestCase
+class LanguageTest extends TestCase
 {
 
 
diff --git a/tests/lib/SimpleSAML/Locale/LocalizationTest.php b/tests/lib/SimpleSAML/Locale/LocalizationTest.php
index a8ea072affe88884e1db299fa12b9a88c92890d9..d38af4add61227531ff0710238450c7c8a1e7c56 100644
--- a/tests/lib/SimpleSAML/Locale/LocalizationTest.php
+++ b/tests/lib/SimpleSAML/Locale/LocalizationTest.php
@@ -2,11 +2,12 @@
 
 namespace SimpleSAML\Test\Locale;
 
+use PHPUnit\Framework\TestCase;
 use SimpleSAML\Locale\Localization;
 use \SimpleSAML_Configuration as Configuration;
 
 
-class LocalizationTest extends \PHPUnit_Framework_TestCase
+class LocalizationTest extends TestCase
 {
     protected function setUp()
     {
diff --git a/tests/lib/SimpleSAML/Locale/TranslateTest.php b/tests/lib/SimpleSAML/Locale/TranslateTest.php
index ee431d6005e4c2f50cb0240a5a452616d3b4a3a7..93d6c441ba830b160c79f06925426331ccb082ff 100644
--- a/tests/lib/SimpleSAML/Locale/TranslateTest.php
+++ b/tests/lib/SimpleSAML/Locale/TranslateTest.php
@@ -2,9 +2,10 @@
 
 namespace SimpleSAML\Test\Locale;
 
+use PHPUnit\Framework\TestCase;
 use SimpleSAML\Locale\Translate;
 
-class TranslateTest extends \PHPUnit_Framework_TestCase
+class TranslateTest extends TestCase
 {
 
     /**
diff --git a/tests/lib/SimpleSAML/Metadata/SAMLBuilderTest.php b/tests/lib/SimpleSAML/Metadata/SAMLBuilderTest.php
index e958667c76cf478a6b18bab3aa529768813e8b9e..d9aa96a5a60c8d9778655eb78f0769c300b96aff 100644
--- a/tests/lib/SimpleSAML/Metadata/SAMLBuilderTest.php
+++ b/tests/lib/SimpleSAML/Metadata/SAMLBuilderTest.php
@@ -1,10 +1,11 @@
 <?php
 
+use PHPUnit\Framework\TestCase;
 
 /**
  * Class SimpleSAML_Metadata_SAMLBuilderTest
  */
-class SimpleSAML_Metadata_SAMLBuilderTest extends PHPUnit_Framework_TestCase
+class SimpleSAML_Metadata_SAMLBuilderTest extends TestCase
 {
 
     /**
diff --git a/tests/lib/SimpleSAML/Metadata/SAMLParserTest.php b/tests/lib/SimpleSAML/Metadata/SAMLParserTest.php
index 85cb0858b24bc5905cdbb8853f39c981915fef57..0e34ad063e006f336fe978f7178a51a516eea086 100644
--- a/tests/lib/SimpleSAML/Metadata/SAMLParserTest.php
+++ b/tests/lib/SimpleSAML/Metadata/SAMLParserTest.php
@@ -1,10 +1,12 @@
 <?php
 namespace SimpleSAML\Metadata;
 
+use PHPUnit\Framework\TestCase;
+
 /**
  * Test SAML parsing
  */
-class SAMLParserTest extends \PHPUnit_Framework_TestCase
+class SAMLParserTest extends TestCase
 {
 
     /**
diff --git a/tests/lib/SimpleSAML/ModuleTest.php b/tests/lib/SimpleSAML/ModuleTest.php
index a3abf0e11460e1de5e5692f6fde13cf1fb0e2cd4..00cff258cabf8d7246cbcebedca1ebd80cc27968 100644
--- a/tests/lib/SimpleSAML/ModuleTest.php
+++ b/tests/lib/SimpleSAML/ModuleTest.php
@@ -1,9 +1,10 @@
 <?php
 namespace SimpleSAML\Test;
 
+use PHPUnit\Framework\TestCase;
 use SimpleSAML\Module;
 
-class ModuleTest extends \PHPUnit_Framework_TestCase
+class ModuleTest extends TestCase
 {
 
 
diff --git a/tests/lib/SimpleSAML/Store/RedisTest.php b/tests/lib/SimpleSAML/Store/RedisTest.php
index 329f57113374e7e7d5f1ca6cc455077520f2b318..d17f4473a3f99b48db61f1e2b52f76aebbc23f0b 100644
--- a/tests/lib/SimpleSAML/Store/RedisTest.php
+++ b/tests/lib/SimpleSAML/Store/RedisTest.php
@@ -2,6 +2,7 @@
 
 namespace SimpleSAML\Test\Store;
 
+use PHPUnit\Framework\TestCase;
 use \SimpleSAML_Configuration as Configuration;
 use \SimpleSAML\Store;
 
@@ -13,7 +14,7 @@ use \SimpleSAML\Store;
  *
  * @package simplesamlphp/simplesamlphp
  */
-class RedisTest extends \PHPUnit_Framework_TestCase
+class RedisTest extends TestCase
 {
     protected function setUp()
     {
diff --git a/tests/lib/SimpleSAML/Store/SQLTest.php b/tests/lib/SimpleSAML/Store/SQLTest.php
index 56f21156a8e06d42864c9522b2bfb251de04729b..143632f9060f5ccfa4d992883ff68191bc7d4b34 100644
--- a/tests/lib/SimpleSAML/Store/SQLTest.php
+++ b/tests/lib/SimpleSAML/Store/SQLTest.php
@@ -2,6 +2,7 @@
 
 namespace SimpleSAML\Test\Store;
 
+use PHPUnit\Framework\TestCase;
 use \SimpleSAML_Configuration as Configuration;
 use \SimpleSAML\Store;
 
@@ -14,7 +15,7 @@ use \SimpleSAML\Store;
  * @author Sergio GĂłmez <sergio@uco.es>
  * @package simplesamlphp/simplesamlphp
  */
-class SQLTest extends \PHPUnit_Framework_TestCase
+class SQLTest extends TestCase
 {
     protected function setUp()
     {
diff --git a/tests/lib/SimpleSAML/StoreTest.php b/tests/lib/SimpleSAML/StoreTest.php
index e807d5c8479490db44bd32ae7a342b0ca69bac90..22641681dcd9143f351226d9d55797854ed811f9 100644
--- a/tests/lib/SimpleSAML/StoreTest.php
+++ b/tests/lib/SimpleSAML/StoreTest.php
@@ -2,6 +2,7 @@
 
 namespace SimpleSAML\Test;
 
+use PHPUnit\Framework\TestCase;
 use \SimpleSAML_Configuration as Configuration;
 use \SimpleSAML\Store;
 
@@ -14,7 +15,7 @@ use \SimpleSAML\Store;
  * @author Sergio GĂłmez <sergio@uco.es>
  * @package simplesamlphp/simplesamlphp
  */
-class StoreTest extends \PHPUnit_Framework_TestCase
+class StoreTest extends TestCase
 {
     /**
      * @covers \SimpleSAML\Store::getInstance
diff --git a/tests/lib/SimpleSAML/Utils/ArraysTest.php b/tests/lib/SimpleSAML/Utils/ArraysTest.php
index c4a38726aef8839a2e1458d99773e2b088bddb0d..0ec3e29bdf74250eb7a098fa230647db0e54f96f 100644
--- a/tests/lib/SimpleSAML/Utils/ArraysTest.php
+++ b/tests/lib/SimpleSAML/Utils/ArraysTest.php
@@ -2,12 +2,13 @@
 
 namespace SimpleSAML\Test\Utils;
 
+use PHPUnit\Framework\TestCase;
 use SimpleSAML\Utils\Arrays;
 
 /**
  * Tests for SimpleSAML\Utils\Arrays.
  */
-class ArraysTest extends \PHPUnit_Framework_TestCase
+class ArraysTest extends TestCase
 {
 
     /**
diff --git a/tests/lib/SimpleSAML/Utils/AttributesTest.php b/tests/lib/SimpleSAML/Utils/AttributesTest.php
index 0dc083314e29e18c55ff6d49ef90a60869c93016..271b506848b0b76a1bcf4d6a94bac2d0b994fc09 100644
--- a/tests/lib/SimpleSAML/Utils/AttributesTest.php
+++ b/tests/lib/SimpleSAML/Utils/AttributesTest.php
@@ -2,6 +2,7 @@
 
 namespace SimpleSAML\Test\Utils;
 
+use PHPUnit\Framework\TestCase;
 use SimpleSAML\Utils\Attributes;
 
 /**
@@ -9,7 +10,7 @@ use SimpleSAML\Utils\Attributes;
  *
  * @author Jaime Perez, UNINETT AS <jaime.perez@uninett.no>
  */
-class AttributesTest extends \PHPUnit_Framework_TestCase
+class AttributesTest extends TestCase
 {
 
     /**
diff --git a/tests/lib/SimpleSAML/Utils/Config/MetadataTest.php b/tests/lib/SimpleSAML/Utils/Config/MetadataTest.php
index 95f0aa547c5a0c33ff3f135684ee42ea674e9502..98ffb7f0b3350e28b71cc50211e4a65994352323 100644
--- a/tests/lib/SimpleSAML/Utils/Config/MetadataTest.php
+++ b/tests/lib/SimpleSAML/Utils/Config/MetadataTest.php
@@ -2,12 +2,13 @@
 
 namespace SimpleSAML\Test\Utils\Config;
 
+use PHPUnit\Framework\TestCase;
 use SimpleSAML\Utils\Config\Metadata;
 
 /**
  * Tests related to SAML metadata.
  */
-class MetadataTest extends \PHPUnit_Framework_TestCase
+class MetadataTest extends TestCase
 {
 
     /**
diff --git a/tests/lib/SimpleSAML/Utils/ConfigTest.php b/tests/lib/SimpleSAML/Utils/ConfigTest.php
index 5dd0fa33b1ad2dca80bd5d43a530af385a7ca532..262fbfd801837ef611fb738c69424fa5caaa41ea 100644
--- a/tests/lib/SimpleSAML/Utils/ConfigTest.php
+++ b/tests/lib/SimpleSAML/Utils/ConfigTest.php
@@ -2,12 +2,13 @@
 
 namespace SimpleSAML\Test\Utils;
 
+use PHPUnit\Framework\TestCase;
 use SimpleSAML\Utils\Config;
 
 /**
  * Tests for SimpleSAML\Utils\Config
  */
-class ConfigTest extends \PHPUnit_Framework_TestCase
+class ConfigTest extends TestCase
 {
 
     /**
diff --git a/tests/lib/SimpleSAML/Utils/CryptoTest.php b/tests/lib/SimpleSAML/Utils/CryptoTest.php
index cb31cdbae0b8afa9c18f0b74c9ca4921c6ba7d5e..a47d0d432c938fe3001a6a0c2a4fb059937d77a0 100644
--- a/tests/lib/SimpleSAML/Utils/CryptoTest.php
+++ b/tests/lib/SimpleSAML/Utils/CryptoTest.php
@@ -2,6 +2,7 @@
 
 namespace SimpleSAML\Test\Utils;
 
+use PHPUnit\Framework\TestCase;
 use SimpleSAML\Utils\Crypto;
 use \SimpleSAML_Configuration as Configuration;
 
@@ -10,7 +11,7 @@ use \org\bovigo\vfs\vfsStream;
 /**
  * Tests for SimpleSAML\Utils\Crypto.
  */
-class CryptoTest extends \PHPUnit_Framework_TestCase
+class CryptoTest extends TestCase
 {
     const ROOTDIRNAME = 'testdir';
     const DEFAULTCERTDIR = 'certdir';
diff --git a/tests/lib/SimpleSAML/Utils/HTTPTest.php b/tests/lib/SimpleSAML/Utils/HTTPTest.php
index 4fd540cfb241d38575cf0638b9fa10902f54fb2d..073073c9378b12d1ca2b306fdf5392304adf6ca3 100644
--- a/tests/lib/SimpleSAML/Utils/HTTPTest.php
+++ b/tests/lib/SimpleSAML/Utils/HTTPTest.php
@@ -1,9 +1,10 @@
 <?php
 namespace SimpleSAML\Test\Utils;
 
+use PHPUnit\Framework\TestCase;
 use SimpleSAML\Utils\HTTP;
 
-class HTTPTest extends \PHPUnit_Framework_TestCase
+class HTTPTest extends TestCase
 {
 
 
diff --git a/tests/lib/SimpleSAML/Utils/NetTest.php b/tests/lib/SimpleSAML/Utils/NetTest.php
index c6f4d4f9e2c4b34b43bf39df59bae7f10f2b9201..8e7e29e5453794f34bce483ee921279dd37b845e 100644
--- a/tests/lib/SimpleSAML/Utils/NetTest.php
+++ b/tests/lib/SimpleSAML/Utils/NetTest.php
@@ -2,12 +2,13 @@
 
 namespace SimpleSAML\Test\Utils;
 
+use PHPUnit\Framework\TestCase;
 use SimpleSAML\Utils\Net;
 
 /**
  * Tests for SimpleSAML\Utils\Test.
  */
-class NetTest extends \PHPUnit_Framework_TestCase
+class NetTest extends TestCase
 {
 
 
diff --git a/tests/lib/SimpleSAML/Utils/RandomTest.php b/tests/lib/SimpleSAML/Utils/RandomTest.php
index 9f2f6381be6a1a5852810140073d1202e361423b..ff05ed0243f2ceb09104ee59b2b3deb6f529e401 100644
--- a/tests/lib/SimpleSAML/Utils/RandomTest.php
+++ b/tests/lib/SimpleSAML/Utils/RandomTest.php
@@ -2,12 +2,13 @@
 
 namespace SimpleSAML\Test\Utils;
 
+use PHPUnit\Framework\TestCase;
 use SimpleSAML\Utils\Random;
 
 /**
  * Tests for SimpleSAML\Utils\Random.
  */
-class RandomTest extends \PHPUnit_Framework_TestCase
+class RandomTest extends TestCase
 {
 
     /**
diff --git a/tests/lib/SimpleSAML/Utils/SystemTest.php b/tests/lib/SimpleSAML/Utils/SystemTest.php
index c749b798757df5ce3baad64aed59135a5fbb1b38..1227f9453528ea00d565b2bd579fc9d348205b69 100644
--- a/tests/lib/SimpleSAML/Utils/SystemTest.php
+++ b/tests/lib/SimpleSAML/Utils/SystemTest.php
@@ -2,6 +2,7 @@
 
 namespace SimpleSAML\Test\Utils;
 
+use PHPUnit\Framework\TestCase;
 use \SimpleSAML_Configuration as Configuration;
 use \SimpleSAML\Utils\System;
 
@@ -10,7 +11,7 @@ use \org\bovigo\vfs\vfsStream;
 /**
  * Tests for SimpleSAML\Utils\System.
  */
-class SystemTest extends \PHPUnit_Framework_TestCase
+class SystemTest extends TestCase
 {
     const ROOTDIRNAME = 'testdir';
     const DEFAULTTEMPDIR = 'tempdir';
diff --git a/tests/lib/SimpleSAML/Utils/TimeTest.php b/tests/lib/SimpleSAML/Utils/TimeTest.php
index 953bd13311b08bf04600faa3c3dc5a2dc1f78dde..043aefbe52d4bec5519bda67216e5086fb4e79ff 100644
--- a/tests/lib/SimpleSAML/Utils/TimeTest.php
+++ b/tests/lib/SimpleSAML/Utils/TimeTest.php
@@ -2,9 +2,10 @@
 
 namespace SimpleSAML\Test\Utils;
 
+use PHPUnit\Framework\TestCase;
 use SimpleSAML\Utils\Time;
 
-class TimeTest extends \PHPUnit_Framework_TestCase
+class TimeTest extends TestCase
 {
 
     /**
diff --git a/tests/lib/SimpleSAML/Utils/XMLTest.php b/tests/lib/SimpleSAML/Utils/XMLTest.php
index a812b964f0d8a8a7a83c0835dd95a88b37edca0b..7660487956ba79e9449342b26380896d7641041f 100644
--- a/tests/lib/SimpleSAML/Utils/XMLTest.php
+++ b/tests/lib/SimpleSAML/Utils/XMLTest.php
@@ -2,13 +2,14 @@
 
 namespace SimpleSAML\Test\Utils;
 
+use PHPUnit\Framework\TestCase;
 use \SimpleSAML_Configuration as Configuration;
 use \SimpleSAML\Utils\XML;
 
 /**
  * Tests for SimpleSAML\Utils\XML.
  */
-class XMLTest extends \PHPUnit_Framework_TestCase
+class XMLTest extends TestCase
 {
     /**
      * @covers \SimpleSAML\Utils\XML::isDOMNodeOfType
diff --git a/tests/lib/SimpleSAML/XML/ErrorsTest.php b/tests/lib/SimpleSAML/XML/ErrorsTest.php
index c73580a500bd2f007fa558ea22af35867a915a16..a6a46f19da67564f78e765bb4865bb1821a6068d 100644
--- a/tests/lib/SimpleSAML/XML/ErrorsTest.php
+++ b/tests/lib/SimpleSAML/XML/ErrorsTest.php
@@ -12,9 +12,10 @@
 
 namespace SimpleSAML\Test\XML;
 
+use PHPUnit\Framework\TestCase;
 use SimpleSAML\XML\Errors;
 
-class ErrorsTest extends \PHPUnit_Framework_TestCase
+class ErrorsTest extends TestCase
 {
     /**
      * @covers \SimpleSAML\XML\Errors::begin
diff --git a/tests/lib/SimpleSAML/XML/ParserTest.php b/tests/lib/SimpleSAML/XML/ParserTest.php
index 7860d9523285b4a6a2597107b60bb972ab04079f..336ae86f12357fff99e3870873d19bc171807c90 100644
--- a/tests/lib/SimpleSAML/XML/ParserTest.php
+++ b/tests/lib/SimpleSAML/XML/ParserTest.php
@@ -11,9 +11,10 @@
 
 namespace SimpleSAML\Test\XML;
 
+use PHPUnit\Framework\TestCase;
 use SimpleSAML\XML\Parser;
 
-class ParserTest extends \PHPUnit_Framework_TestCase
+class ParserTest extends TestCase
 {
     const XMLDOC = <<< XML
 <?xml version="1.0" encoding="UTF-8"?>
diff --git a/tests/lib/SimpleSAML/XML/Shib13/AuthnResponseTest.php b/tests/lib/SimpleSAML/XML/Shib13/AuthnResponseTest.php
index f10423c0aaa6712a134ec86507deb102c2da5f94..b492337f6780387f9125ddac3cea9a9885997fa7 100644
--- a/tests/lib/SimpleSAML/XML/Shib13/AuthnResponseTest.php
+++ b/tests/lib/SimpleSAML/XML/Shib13/AuthnResponseTest.php
@@ -11,12 +11,13 @@
 
 namespace SimpleSAML\Test\XML\Shib13;
 
+use PHPUnit\Framework\TestCase;
 use SimpleSAML\XML\Shib13\AuthnResponse;
 
-class AuthnResponseTest extends \PHPUnit_Framework_TestCase
+class AuthnResponseTest extends TestCase
 {
     const XMLDOC = <<< XML
-<Response xmlns="urn:oasis:names:tc:SAML:1.0:protocol" 
+<Response xmlns="urn:oasis:names:tc:SAML:1.0:protocol"
     MajorVersion="1" MinorVersion="1"
     ResponseID="" IssueInstant="">
     <Assertion xmlns="urn:oasis:names:tc:SAML:1.0:assertion"
@@ -34,7 +35,7 @@ class AuthnResponseTest extends \PHPUnit_Framework_TestCase
 XML;
 
     const BADXMLDOC = <<< XML
-<Response xmlns="urn:oasis:names:tc:SAML:1.0:protocol" 
+<Response xmlns="urn:oasis:names:tc:SAML:1.0:protocol"
     MajorVersion="1" MinorVersion="1"
     ResponseID="" IssueInstant="">
     <Assertion xmlns="urn:oasis:names:tc:SAML:1.0:assertion"
diff --git a/tests/lib/SimpleSAML/XML/SignerTest.php b/tests/lib/SimpleSAML/XML/SignerTest.php
index 359836b8b8d6b6a2dfec24751a011621f011c68e..77edff09d1d1291fef61af531b5988d5b41ac04a 100644
--- a/tests/lib/SimpleSAML/XML/SignerTest.php
+++ b/tests/lib/SimpleSAML/XML/SignerTest.php
@@ -2,6 +2,7 @@
 
 namespace SimpleSAML\Test\Utils;
 
+use PHPUnit\Framework\TestCase;
 use \SimpleSAML_Configuration as Configuration;
 use \SimpleSAML\XML\Signer;
 
@@ -10,7 +11,7 @@ use \org\bovigo\vfs\vfsStream;
 /**
  * Tests for SimpleSAML\XML\Signer.
  */
-class SignerTest extends \PHPUnit_Framework_TestCase
+class SignerTest extends TestCase
 {
     // openssl genrsa -out private.pem 2048
     private $private_key = <<<'NOWDOC'
diff --git a/tests/lib/SimpleSAML/XML/ValidatorTest.php b/tests/lib/SimpleSAML/XML/ValidatorTest.php
index 2b178022e80b994d2b9dac0ca124ef7ca190b51d..8dc2179f45986bfc4c287dc1a54c7c31f252e721 100644
--- a/tests/lib/SimpleSAML/XML/ValidatorTest.php
+++ b/tests/lib/SimpleSAML/XML/ValidatorTest.php
@@ -2,6 +2,7 @@
 
 namespace SimpleSAML\Test\XML;
 
+use PHPUnit\Framework\TestCase;
 use \SimpleSAML_Configuration as Configuration;
 use \SimpleSAML\XML\Signer;
 use \SimpleSAML\XML\Validator;
@@ -11,7 +12,7 @@ use \org\bovigo\vfs\vfsStream;
 /**
  * Tests for SimpleSAML\XML\Validator.
  */
-class ValidatorTest extends \PHPUnit_Framework_TestCase
+class ValidatorTest extends TestCase
 {
     // openssl genrsa -out ca.key.pem 2048
     private $ca_private_key = <<<'NOWDOC'
diff --git a/tests/modules/consent/lib/Auth/Process/ConsentTest.php b/tests/modules/consent/lib/Auth/Process/ConsentTest.php
index e83659d22e054db22ba453e60a5372ac2af2f56b..887e11b433e8daffa88fdef506339124d9622685 100644
--- a/tests/modules/consent/lib/Auth/Process/ConsentTest.php
+++ b/tests/modules/consent/lib/Auth/Process/ConsentTest.php
@@ -8,9 +8,10 @@
 
 namespace SimpleSAML\Test\Module\consent\Auth\Process;
 
+use PHPUnit\Framework\TestCase;
 use \SimpleSAML_Configuration as Configuration;
 
-class ConsentTest extends \PHPUnit_Framework_TestCase
+class ConsentTest extends TestCase
 {
     public function setUp()
     {
diff --git a/tests/modules/core/lib/Auth/Process/AttributeAddTest.php b/tests/modules/core/lib/Auth/Process/AttributeAddTest.php
index 29e900db754cbf1303a081fefc33ae89677eabff..1fd9fc72bc67ccfdefcb3ee23822be1afddf8333 100644
--- a/tests/modules/core/lib/Auth/Process/AttributeAddTest.php
+++ b/tests/modules/core/lib/Auth/Process/AttributeAddTest.php
@@ -1,9 +1,11 @@
 <?php
 
+use PHPUnit\Framework\TestCase;
+
 /**
  * Test for the core:AttributeAdd filter.
  */
-class Test_Core_Auth_Process_AttributeAdd extends PHPUnit_Framework_TestCase
+class Test_Core_Auth_Process_AttributeAdd extends TestCase
 {
 
     /**
diff --git a/tests/modules/core/lib/Auth/Process/AttributeAlterTest.php b/tests/modules/core/lib/Auth/Process/AttributeAlterTest.php
index 47a16e5a43d309d3f5ef4869b2588990edcfa0d0..8260c04e487e3c9d345ac9391604589d194bd941 100644
--- a/tests/modules/core/lib/Auth/Process/AttributeAlterTest.php
+++ b/tests/modules/core/lib/Auth/Process/AttributeAlterTest.php
@@ -1,9 +1,11 @@
 <?php
 
+use PHPUnit\Framework\TestCase;
+
 /**
  * Test for the core:AttributeAlter filter.
  */
-class Test_Core_Auth_Process_AttributeAlter extends PHPUnit_Framework_TestCase
+class Test_Core_Auth_Process_AttributeAlter extends TestCase
 {
 
     /**
@@ -354,4 +356,3 @@ class Test_Core_Auth_Process_AttributeAlter extends PHPUnit_Framework_TestCase
         $result = self::processFilter($config, $request);
     }
 }
-
diff --git a/tests/modules/core/lib/Auth/Process/AttributeCopyTest.php b/tests/modules/core/lib/Auth/Process/AttributeCopyTest.php
index 599df57bb3fa8f16110ea5065b65224268268df2..d960c379f764e9b0db635a8f8aa44253daaa52c5 100644
--- a/tests/modules/core/lib/Auth/Process/AttributeCopyTest.php
+++ b/tests/modules/core/lib/Auth/Process/AttributeCopyTest.php
@@ -1,9 +1,11 @@
 <?php
 
+use PHPUnit\Framework\TestCase;
+
 /**
  * Test for the core:AttributeCopy filter.
  */
-class Test_Core_Auth_Process_AttributeCopy extends PHPUnit_Framework_TestCase
+class Test_Core_Auth_Process_AttributeCopy extends TestCase
 {
 
     /**
diff --git a/tests/modules/core/lib/Auth/Process/AttributeLimitTest.php b/tests/modules/core/lib/Auth/Process/AttributeLimitTest.php
index 7c2e6ac7a172b6ffb7a3a4c3bed4d92df980483b..57e912e88cdf993f143e9240e79acd455b8738a3 100644
--- a/tests/modules/core/lib/Auth/Process/AttributeLimitTest.php
+++ b/tests/modules/core/lib/Auth/Process/AttributeLimitTest.php
@@ -1,8 +1,11 @@
 <?php
+
+use PHPUnit\Framework\TestCase;
+
 /**
  * Test for the core:AttributeLimit filter.
  */
-class Test_Core_Auth_Process_AttributeLimitTest extends PHPUnit_Framework_TestCase
+class Test_Core_Auth_Process_AttributeLimitTest extends TestCase
 {
 
     /**
@@ -197,8 +200,8 @@ class Test_Core_Auth_Process_AttributeLimitTest extends PHPUnit_Framework_TestCa
 
     /**
      * Test for exception with illegal config.
-     * 
-     * @expectedException Exception 
+     *
+     * @expectedException Exception
      */
     public function testInvalidConfig()
     {
@@ -211,8 +214,8 @@ class Test_Core_Auth_Process_AttributeLimitTest extends PHPUnit_Framework_TestCa
 
     /**
      * Test for invalid attribute name
-     * 
-     * @expectedException Exception 
+     *
+     * @expectedException Exception
      */
     public function testInvalidAttributeName()
     {
@@ -265,12 +268,12 @@ class Test_Core_Auth_Process_AttributeLimitTest extends PHPUnit_Framework_TestCa
     }
 
     /**
-     * Test for allowed attributes not an array. 
+     * Test for allowed attributes not an array.
      *
-     * This test is very unlikely and would require malformed metadata processing. 
+     * This test is very unlikely and would require malformed metadata processing.
      * Cannot be generated via config options.
      *
-     * @expectedException Exception 
+     * @expectedException Exception
      */
     public function testMatchAttributeValuesNotArray()
     {
diff --git a/tests/modules/core/lib/Auth/Process/AttributeRealmTest.php b/tests/modules/core/lib/Auth/Process/AttributeRealmTest.php
index af3cd3e38a87bca9e2dec09ea685c81cab2d9084..915475d17d559b7eb163eff0dd6242e38f034978 100644
--- a/tests/modules/core/lib/Auth/Process/AttributeRealmTest.php
+++ b/tests/modules/core/lib/Auth/Process/AttributeRealmTest.php
@@ -1,9 +1,11 @@
 <?php
 
+use PHPUnit\Framework\TestCase;
+
 /**
  * Test for the core:AttributeRealm filter.
  */
-class Test_Core_Auth_Process_AttributeRealm extends PHPUnit_Framework_TestCase
+class Test_Core_Auth_Process_AttributeRealm extends TestCase
 {
 
     /**
diff --git a/tests/modules/core/lib/Auth/Process/AttributeValueMapTest.php b/tests/modules/core/lib/Auth/Process/AttributeValueMapTest.php
index c0deaf8aa62885c505111cbfaaf65c84bc686963..a6d601f06bfa821ab68f514fd471d1f37a8a4a47 100644
--- a/tests/modules/core/lib/Auth/Process/AttributeValueMapTest.php
+++ b/tests/modules/core/lib/Auth/Process/AttributeValueMapTest.php
@@ -2,12 +2,13 @@
 
 namespace SimpleSAML\Test\Module\core\Auth\Process;
 
+use PHPUnit\Framework\TestCase;
 use SimpleSAML\Module\core\Auth\Process\AttributeValueMap;
 
 /**
  * Test for the core:AttributeValueMap filter.
  */
-class AttributeValueMapTest extends \PHPUnit_Framework_TestCase
+class AttributeValueMapTest extends TestCase
 {
 
     /**
diff --git a/tests/modules/core/lib/Auth/Process/PHPTest.php b/tests/modules/core/lib/Auth/Process/PHPTest.php
index 46c7d37d8418294012ffaf2bc30275a4d667918e..0e18e9bcd9f10b052fa934a950369b222c9035e4 100644
--- a/tests/modules/core/lib/Auth/Process/PHPTest.php
+++ b/tests/modules/core/lib/Auth/Process/PHPTest.php
@@ -1,10 +1,11 @@
 <?php
 
+use PHPUnit\Framework\TestCase;
 
 /**
  * Test for the core:PHP filter.
  */
-class Test_Core_Auth_Process_PHP extends PHPUnit_Framework_TestCase
+class Test_Core_Auth_Process_PHP extends TestCase
 {
 
     /**
diff --git a/tests/modules/core/lib/Auth/Process/ScopeAttributeTest.php b/tests/modules/core/lib/Auth/Process/ScopeAttributeTest.php
index 8b86314cf2ba9909e4168da047c3d40e90153f6c..866fc1a641a60db42eaffa27365e8664957b6197 100644
--- a/tests/modules/core/lib/Auth/Process/ScopeAttributeTest.php
+++ b/tests/modules/core/lib/Auth/Process/ScopeAttributeTest.php
@@ -1,9 +1,11 @@
 <?php
 
+use PHPUnit\Framework\TestCase;
+
 /**
  * Test for the core:ScopeAttribute filter.
  */
-class Test_Core_Auth_Process_ScopeAttribute extends PHPUnit_Framework_TestCase
+class Test_Core_Auth_Process_ScopeAttribute extends TestCase
 {
 
     /*
diff --git a/tests/modules/core/lib/Auth/Process/ScopeFromAttributeTest.php b/tests/modules/core/lib/Auth/Process/ScopeFromAttributeTest.php
index f6ef1bf90414abb094f6e92db22c2d75fda23fd1..545093124dbe74709ed2b8fec9fd98eb90d212e1 100644
--- a/tests/modules/core/lib/Auth/Process/ScopeFromAttributeTest.php
+++ b/tests/modules/core/lib/Auth/Process/ScopeFromAttributeTest.php
@@ -1,9 +1,11 @@
 <?php
 
+use PHPUnit\Framework\TestCase;
+
 /**
  * Test for the core:ScopeFromAttribute filter.
  */
-class Test_Core_Auth_Process_ScopeFromAttribute extends PHPUnit_Framework_TestCase
+class Test_Core_Auth_Process_ScopeFromAttribute extends TestCase
 {
 
     /*
diff --git a/tests/modules/core/lib/Auth/Process/TargetedIDTest.php b/tests/modules/core/lib/Auth/Process/TargetedIDTest.php
index 1e5de903351a8aa2276f0cb2f170d4d62e538beb..7cfc1abe3e222bf193a8514e1a10f3179914db66 100644
--- a/tests/modules/core/lib/Auth/Process/TargetedIDTest.php
+++ b/tests/modules/core/lib/Auth/Process/TargetedIDTest.php
@@ -1,9 +1,11 @@
 <?php
 
+use PHPUnit\Framework\TestCase;
+
 /**
  * Test for the core:TargetedID filter.
  */
-class Test_Core_Auth_Process_TargetedID extends PHPUnit_Framework_TestCase
+class Test_Core_Auth_Process_TargetedID extends TestCase
 {
     /**
      * Helper function to run the filter with a given configuration.
@@ -149,13 +151,13 @@ class Test_Core_Auth_Process_TargetedID extends PHPUnit_Framework_TestCase
 //        $request['UserID'] = 'user3@example.org';
 //	$result = self::processFilter($config, $request);
 //	$tid2 = $result['Attributes']['eduPersonTargetedID'][0];
-//        
+//
 //        $this->assertNotEquals($tid1, $tid2);
 //
 //        $request['Destination']['entityid'] = 'urn:example.org:another-sp';
 //	$result = self::processFilter($config, $request);
 //	$tid3 = $result['Attributes']['eduPersonTargetedID'][0];
-//        
+//
 //        $this->assertNotEquals($tid2, $tid3);
 //    }
 
diff --git a/tests/modules/ldap/lib/Auth/Process/BaseFilterTest.php b/tests/modules/ldap/lib/Auth/Process/BaseFilterTest.php
index b21b426ab88d22fd9b82fdfc519d6edbe5626251..08dd8ea52a8b59bd177f9a8997e03fe2f7fff563 100644
--- a/tests/modules/ldap/lib/Auth/Process/BaseFilterTest.php
+++ b/tests/modules/ldap/lib/Auth/Process/BaseFilterTest.php
@@ -1,6 +1,8 @@
 <?php
 
-class sspmod_ldap_Auth_Process_BaseFilter_Test extends PHPUnit_Framework_TestCase
+use PHPUnit\Framework\TestCase;
+
+class sspmod_ldap_Auth_Process_BaseFilter_Test extends TestCase
 {
     public function testVarExportHidesLdapPassword()
     {
diff --git a/tests/modules/saml/lib/Auth/Process/FilterScopesTest.php b/tests/modules/saml/lib/Auth/Process/FilterScopesTest.php
index 4f595c609d4183c4eebad8479a6b4e469554829c..1915c9c0e77316a4a7236e309ce6777ccb891cc9 100644
--- a/tests/modules/saml/lib/Auth/Process/FilterScopesTest.php
+++ b/tests/modules/saml/lib/Auth/Process/FilterScopesTest.php
@@ -8,8 +8,9 @@
 
 namespace SimpleSAML\Test\Module\saml\Auth\Process;
 
+use PHPUnit\Framework\TestCase;
 
-class FilterScopesTest extends \PHPUnit_Framework_TestCase
+class FilterScopesTest extends TestCase
 {
 
     /*
diff --git a/tests/modules/saml/lib/Auth/Source/Auth_Source_SP_Test.php b/tests/modules/saml/lib/Auth/Source/Auth_Source_SP_Test.php
index bb3d065db979d757aa9a474c55706ade050578c3..57baff5ff06b30480f5742dc97dde3f657e614f5 100644
--- a/tests/modules/saml/lib/Auth/Source/Auth_Source_SP_Test.php
+++ b/tests/modules/saml/lib/Auth/Source/Auth_Source_SP_Test.php
@@ -2,6 +2,7 @@
 
 namespace SimpleSAML\Test\Module\saml\Auth\Source;
 
+use PHPUnit\Framework\TestCase;
 use \SimpleSAML_Configuration as Configuration;
 
 /**
@@ -67,7 +68,7 @@ class SP_Tester extends \sspmod_saml_Auth_Source_SP
 /**
  * Set of test cases for sspmod_saml_Auth_Source_SP.
  */
-class SP_Test extends \PHPUnit_Framework_TestCase
+class SP_Test extends TestCase
 {
 
     private $idpMetadata = null;
diff --git a/tests/www/IndexTest.php b/tests/www/IndexTest.php
index aa7df8bb5d68a1b36e6acdf0a0eb05382c6ed4cb..65059d33d33f1c966610ff7eb74d9a13b62d5de2 100644
--- a/tests/www/IndexTest.php
+++ b/tests/www/IndexTest.php
@@ -12,9 +12,10 @@ namespace SimpleSAML\Test\Web;
 
 include(dirname(__FILE__).'/../BuiltInServer.php');
 
+use PHPUnit\Framework\TestCase;
 use \SimpleSAML\Test\BuiltInServer;
 
-class IndexTest extends \PHPUnit_Framework_TestCase
+class IndexTest extends TestCase
 {
 
     /**