diff --git a/composer.json b/composer.json
index 593247318aadcc3c756407454d0a89993e88dec2..01ff8701f4008058ef4477c5b4968f5fe9e1c5f4 100644
--- a/composer.json
+++ b/composer.json
@@ -71,7 +71,7 @@
         "ext-curl": "*",
         "mikey179/vfsstream": "~1.6",
         "simplesamlphp/simplesamlphp-module-adfs": "dev-master",
-        "simplesamlphp/simplesamlphp-test-framework": "^1.1.0",
+        "simplesamlphp/simplesamlphp-test-framework": "^1.1.3",
         "simplesamlphp/xml-security": "^0.2.7"
     },
     "suggest": {
diff --git a/composer.lock b/composer.lock
index 9e0b6f35b073c2fa04b6f9d899f7d5dc906ef43b..0bab813cbcf29e7848cb503e92236d05e2b871f5 100644
--- a/composer.lock
+++ b/composer.lock
@@ -4,7 +4,7 @@
         "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
         "This file is @generated automatically"
     ],
-    "content-hash": "b4be109aa063a98f4992cedcc5bbc5f9",
+    "content-hash": "a45a572469f4f9b24be5da3662672b97",
     "packages": [
         {
             "name": "gettext/gettext",
@@ -3129,25 +3129,25 @@
         },
         {
             "name": "twig/intl-extra",
-            "version": "v3.3.0",
+            "version": "v3.3.3",
             "source": {
                 "type": "git",
                 "url": "https://github.com/twigphp/intl-extra.git",
-                "reference": "919e8f945c30bd3efeb6a4d79722cda538116658"
+                "reference": "5a84d0f6bab386bc4224b4220da1daef8d015577"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/twigphp/intl-extra/zipball/919e8f945c30bd3efeb6a4d79722cda538116658",
-                "reference": "919e8f945c30bd3efeb6a4d79722cda538116658",
+                "url": "https://api.github.com/repos/twigphp/intl-extra/zipball/5a84d0f6bab386bc4224b4220da1daef8d015577",
+                "reference": "5a84d0f6bab386bc4224b4220da1daef8d015577",
                 "shasum": ""
             },
             "require": {
                 "php": ">=7.1.3",
-                "symfony/intl": "^4.3|^5.0",
+                "symfony/intl": "^4.3|^5.0|^6.0",
                 "twig/twig": "^2.4|^3.0"
             },
             "require-dev": {
-                "symfony/phpunit-bridge": "^4.4.9|^5.0.9"
+                "symfony/phpunit-bridge": "^4.4.9|^5.0.9|^6.0"
             },
             "type": "library",
             "extra": {
@@ -3182,7 +3182,7 @@
                 "twig"
             ],
             "support": {
-                "source": "https://github.com/twigphp/intl-extra/tree/v3.3.0"
+                "source": "https://github.com/twigphp/intl-extra/tree/v3.3.3"
             },
             "funding": [
                 {
@@ -3194,20 +3194,20 @@
                     "type": "tidelift"
                 }
             ],
-            "time": "2021-01-01T14:58:18+00:00"
+            "time": "2021-05-20T14:28:34+00:00"
         },
         {
             "name": "twig/twig",
-            "version": "v2.14.6",
+            "version": "v2.14.7",
             "source": {
                 "type": "git",
                 "url": "https://github.com/twigphp/Twig.git",
-                "reference": "27e5cf2b05e3744accf39d4c68a3235d9966d260"
+                "reference": "8e202327ee1ed863629de9b18a5ec70ac614d88f"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/twigphp/Twig/zipball/27e5cf2b05e3744accf39d4c68a3235d9966d260",
-                "reference": "27e5cf2b05e3744accf39d4c68a3235d9966d260",
+                "url": "https://api.github.com/repos/twigphp/Twig/zipball/8e202327ee1ed863629de9b18a5ec70ac614d88f",
+                "reference": "8e202327ee1ed863629de9b18a5ec70ac614d88f",
                 "shasum": ""
             },
             "require": {
@@ -3217,7 +3217,7 @@
             },
             "require-dev": {
                 "psr/container": "^1.0",
-                "symfony/phpunit-bridge": "^4.4.9|^5.0.9"
+                "symfony/phpunit-bridge": "^4.4.9|^5.0.9|^6.0"
             },
             "type": "library",
             "extra": {
@@ -3261,7 +3261,7 @@
             ],
             "support": {
                 "issues": "https://github.com/twigphp/Twig/issues",
-                "source": "https://github.com/twigphp/Twig/tree/v2.14.6"
+                "source": "https://github.com/twigphp/Twig/tree/v2.14.7"
             },
             "funding": [
                 {
@@ -3273,7 +3273,7 @@
                     "type": "tidelift"
                 }
             ],
-            "time": "2021-05-16T12:12:47+00:00"
+            "time": "2021-09-17T08:39:54+00:00"
         },
         {
             "name": "webmozart/assert",
@@ -3337,16 +3337,16 @@
     "packages-dev": [
         {
             "name": "amphp/amp",
-            "version": "v2.6.0",
+            "version": "v2.6.1",
             "source": {
                 "type": "git",
                 "url": "https://github.com/amphp/amp.git",
-                "reference": "caa95edeb1ca1bf7532e9118ede4a3c3126408cc"
+                "reference": "c5fc66a78ee38d7ac9195a37bacaf940eb3f65ae"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/amphp/amp/zipball/caa95edeb1ca1bf7532e9118ede4a3c3126408cc",
-                "reference": "caa95edeb1ca1bf7532e9118ede4a3c3126408cc",
+                "url": "https://api.github.com/repos/amphp/amp/zipball/c5fc66a78ee38d7ac9195a37bacaf940eb3f65ae",
+                "reference": "c5fc66a78ee38d7ac9195a37bacaf940eb3f65ae",
                 "shasum": ""
             },
             "require": {
@@ -3414,7 +3414,7 @@
             "support": {
                 "irc": "irc://irc.freenode.org/amphp",
                 "issues": "https://github.com/amphp/amp/issues",
-                "source": "https://github.com/amphp/amp/tree/v2.6.0"
+                "source": "https://github.com/amphp/amp/tree/v2.6.1"
             },
             "funding": [
                 {
@@ -3422,7 +3422,7 @@
                     "type": "github"
                 }
             ],
-            "time": "2021-07-16T20:06:06+00:00"
+            "time": "2021-09-23T18:43:08+00:00"
         },
         {
             "name": "amphp/byte-stream",
@@ -3503,16 +3503,16 @@
         },
         {
             "name": "composer/package-versions-deprecated",
-            "version": "1.11.99.3",
+            "version": "1.11.99.4",
             "source": {
                 "type": "git",
                 "url": "https://github.com/composer/package-versions-deprecated.git",
-                "reference": "fff576ac850c045158a250e7e27666e146e78d18"
+                "reference": "b174585d1fe49ceed21928a945138948cb394600"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/composer/package-versions-deprecated/zipball/fff576ac850c045158a250e7e27666e146e78d18",
-                "reference": "fff576ac850c045158a250e7e27666e146e78d18",
+                "url": "https://api.github.com/repos/composer/package-versions-deprecated/zipball/b174585d1fe49ceed21928a945138948cb394600",
+                "reference": "b174585d1fe49ceed21928a945138948cb394600",
                 "shasum": ""
             },
             "require": {
@@ -3556,7 +3556,7 @@
             "description": "Composer plugin that provides efficient querying for installed package versions (no runtime IO)",
             "support": {
                 "issues": "https://github.com/composer/package-versions-deprecated/issues",
-                "source": "https://github.com/composer/package-versions-deprecated/tree/1.11.99.3"
+                "source": "https://github.com/composer/package-versions-deprecated/tree/1.11.99.4"
             },
             "funding": [
                 {
@@ -3572,7 +3572,7 @@
                     "type": "tidelift"
                 }
             ],
-            "time": "2021-08-17T13:49:14+00:00"
+            "time": "2021-09-13T08:41:34+00:00"
         },
         {
             "name": "composer/semver",
@@ -3928,16 +3928,16 @@
         },
         {
             "name": "mikey179/vfsstream",
-            "version": "v1.6.9",
+            "version": "v1.6.10",
             "source": {
                 "type": "git",
                 "url": "https://github.com/bovigo/vfsStream.git",
-                "reference": "2257e326dc3d0f50e55d0a90f71e37899f029718"
+                "reference": "250c0825537d501e327df879fb3d4cd751933b85"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/bovigo/vfsStream/zipball/2257e326dc3d0f50e55d0a90f71e37899f029718",
-                "reference": "2257e326dc3d0f50e55d0a90f71e37899f029718",
+                "url": "https://api.github.com/repos/bovigo/vfsStream/zipball/250c0825537d501e327df879fb3d4cd751933b85",
+                "reference": "250c0825537d501e327df879fb3d4cd751933b85",
                 "shasum": ""
             },
             "require": {
@@ -3975,7 +3975,7 @@
                 "source": "https://github.com/bovigo/vfsStream/tree/master",
                 "wiki": "https://github.com/bovigo/vfsStream/wiki"
             },
-            "time": "2021-07-16T08:08:02+00:00"
+            "time": "2021-09-25T08:05:01+00:00"
         },
         {
             "name": "myclabs/deep-copy",
@@ -4088,16 +4088,16 @@
         },
         {
             "name": "nikic/php-parser",
-            "version": "v4.12.0",
+            "version": "v4.13.0",
             "source": {
                 "type": "git",
                 "url": "https://github.com/nikic/PHP-Parser.git",
-                "reference": "6608f01670c3cc5079e18c1dab1104e002579143"
+                "reference": "50953a2691a922aa1769461637869a0a2faa3f53"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/6608f01670c3cc5079e18c1dab1104e002579143",
-                "reference": "6608f01670c3cc5079e18c1dab1104e002579143",
+                "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/50953a2691a922aa1769461637869a0a2faa3f53",
+                "reference": "50953a2691a922aa1769461637869a0a2faa3f53",
                 "shasum": ""
             },
             "require": {
@@ -4138,9 +4138,9 @@
             ],
             "support": {
                 "issues": "https://github.com/nikic/PHP-Parser/issues",
-                "source": "https://github.com/nikic/PHP-Parser/tree/v4.12.0"
+                "source": "https://github.com/nikic/PHP-Parser/tree/v4.13.0"
             },
-            "time": "2021-07-21T10:44:31+00:00"
+            "time": "2021-09-20T12:20:58+00:00"
         },
         {
             "name": "openlss/lib-array2xml",
@@ -4417,16 +4417,16 @@
         },
         {
             "name": "phpdocumentor/type-resolver",
-            "version": "1.4.0",
+            "version": "1.5.0",
             "source": {
                 "type": "git",
                 "url": "https://github.com/phpDocumentor/TypeResolver.git",
-                "reference": "6a467b8989322d92aa1c8bf2bebcc6e5c2ba55c0"
+                "reference": "30f38bffc6f24293dadd1823936372dfa9e86e2f"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/6a467b8989322d92aa1c8bf2bebcc6e5c2ba55c0",
-                "reference": "6a467b8989322d92aa1c8bf2bebcc6e5c2ba55c0",
+                "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/30f38bffc6f24293dadd1823936372dfa9e86e2f",
+                "reference": "30f38bffc6f24293dadd1823936372dfa9e86e2f",
                 "shasum": ""
             },
             "require": {
@@ -4434,7 +4434,8 @@
                 "phpdocumentor/reflection-common": "^2.0"
             },
             "require-dev": {
-                "ext-tokenizer": "*"
+                "ext-tokenizer": "*",
+                "psalm/phar": "^4.8"
             },
             "type": "library",
             "extra": {
@@ -4460,9 +4461,9 @@
             "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names",
             "support": {
                 "issues": "https://github.com/phpDocumentor/TypeResolver/issues",
-                "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.4.0"
+                "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.5.0"
             },
-            "time": "2020-09-17T18:55:26+00:00"
+            "time": "2021-09-17T15:28:14+00:00"
         },
         {
             "name": "phpspec/prophecy",
@@ -4533,23 +4534,23 @@
         },
         {
             "name": "phpunit/php-code-coverage",
-            "version": "9.2.6",
+            "version": "9.2.7",
             "source": {
                 "type": "git",
                 "url": "https://github.com/sebastianbergmann/php-code-coverage.git",
-                "reference": "f6293e1b30a2354e8428e004689671b83871edde"
+                "reference": "d4c798ed8d51506800b441f7a13ecb0f76f12218"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/f6293e1b30a2354e8428e004689671b83871edde",
-                "reference": "f6293e1b30a2354e8428e004689671b83871edde",
+                "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/d4c798ed8d51506800b441f7a13ecb0f76f12218",
+                "reference": "d4c798ed8d51506800b441f7a13ecb0f76f12218",
                 "shasum": ""
             },
             "require": {
                 "ext-dom": "*",
                 "ext-libxml": "*",
                 "ext-xmlwriter": "*",
-                "nikic/php-parser": "^4.10.2",
+                "nikic/php-parser": "^4.12.0",
                 "php": ">=7.3",
                 "phpunit/php-file-iterator": "^3.0.3",
                 "phpunit/php-text-template": "^2.0.2",
@@ -4598,7 +4599,7 @@
             ],
             "support": {
                 "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues",
-                "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.6"
+                "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.7"
             },
             "funding": [
                 {
@@ -4606,7 +4607,7 @@
                     "type": "github"
                 }
             ],
-            "time": "2021-03-28T07:26:59+00:00"
+            "time": "2021-09-17T05:39:03+00:00"
         },
         {
             "name": "phpunit/php-file-iterator",
@@ -4851,16 +4852,16 @@
         },
         {
             "name": "phpunit/phpunit",
-            "version": "9.5.9",
+            "version": "9.5.10",
             "source": {
                 "type": "git",
                 "url": "https://github.com/sebastianbergmann/phpunit.git",
-                "reference": "ea8c2dfb1065eb35a79b3681eee6e6fb0a6f273b"
+                "reference": "c814a05837f2edb0d1471d6e3f4ab3501ca3899a"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/ea8c2dfb1065eb35a79b3681eee6e6fb0a6f273b",
-                "reference": "ea8c2dfb1065eb35a79b3681eee6e6fb0a6f273b",
+                "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/c814a05837f2edb0d1471d6e3f4ab3501ca3899a",
+                "reference": "c814a05837f2edb0d1471d6e3f4ab3501ca3899a",
                 "shasum": ""
             },
             "require": {
@@ -4876,7 +4877,7 @@
                 "phar-io/version": "^3.0.2",
                 "php": ">=7.3",
                 "phpspec/prophecy": "^1.12.1",
-                "phpunit/php-code-coverage": "^9.2.3",
+                "phpunit/php-code-coverage": "^9.2.7",
                 "phpunit/php-file-iterator": "^3.0.5",
                 "phpunit/php-invoker": "^3.1.1",
                 "phpunit/php-text-template": "^2.0.3",
@@ -4938,7 +4939,7 @@
             ],
             "support": {
                 "issues": "https://github.com/sebastianbergmann/phpunit/issues",
-                "source": "https://github.com/sebastianbergmann/phpunit/tree/9.5.9"
+                "source": "https://github.com/sebastianbergmann/phpunit/tree/9.5.10"
             },
             "funding": [
                 {
@@ -4950,7 +4951,7 @@
                     "type": "github"
                 }
             ],
-            "time": "2021-08-31T06:47:40+00:00"
+            "time": "2021-09-25T07:38:51+00:00"
         },
         {
             "name": "sebastian/cli-parser",
@@ -5805,7 +5806,6 @@
                     "type": "github"
                 }
             ],
-            "abandoned": true,
             "time": "2020-09-28T06:45:17+00:00"
         },
         {
@@ -6008,23 +6008,23 @@
         },
         {
             "name": "simplesamlphp/simplesamlphp-test-framework",
-            "version": "v1.1.0",
+            "version": "v1.1.4",
             "source": {
                 "type": "git",
                 "url": "https://github.com/simplesamlphp/simplesamlphp-test-framework.git",
-                "reference": "2951b7b760a9f9b752debe5b8d7f191efd8cf1a7"
+                "reference": "a5f9d1f99aad4e3f843edd34796ecc59fba6a0c3"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/simplesamlphp/simplesamlphp-test-framework/zipball/2951b7b760a9f9b752debe5b8d7f191efd8cf1a7",
-                "reference": "2951b7b760a9f9b752debe5b8d7f191efd8cf1a7",
+                "url": "https://api.github.com/repos/simplesamlphp/simplesamlphp-test-framework/zipball/a5f9d1f99aad4e3f843edd34796ecc59fba6a0c3",
+                "reference": "a5f9d1f99aad4e3f843edd34796ecc59fba6a0c3",
                 "shasum": ""
             },
             "require": {
                 "php": ">=7.4",
-                "phpunit/phpunit": "^8.5|^9.0",
-                "squizlabs/php_codesniffer": "^3.5",
-                "vimeo/psalm": "^4.1"
+                "phpunit/phpunit": "^8.5|^9.5",
+                "squizlabs/php_codesniffer": "^3.6",
+                "vimeo/psalm": "^4.8"
             },
             "require-dev": {
                 "ext-curl": "*",
@@ -6060,7 +6060,7 @@
                 "issues": "https://github.com/simplesamlphp/simplesamlphp-test-framework/issues",
                 "source": "https://github.com/simplesamlphp/simplesamlphp-test-framework"
             },
-            "time": "2021-03-14T00:30:00+00:00"
+            "time": "2021-09-26T13:02:27+00:00"
         },
         {
             "name": "simplesamlphp/xml-common",
diff --git a/tests/Utils/ArrayLogger.php b/tests/Utils/ArrayLogger.php
deleted file mode 100644
index ac15538e79a29d708af720e11cafec0022fbcdc2..0000000000000000000000000000000000000000
--- a/tests/Utils/ArrayLogger.php
+++ /dev/null
@@ -1,31 +0,0 @@
-<?php
-
-declare(strict_types=1);
-
-namespace SimpleSAML\Test\Utils;
-
-use SimpleSAML\Configuration;
-use SimpleSAML\Logger\LoggingHandlerInterface;
-
-class ArrayLogger implements LoggingHandlerInterface
-{
-    /**
-     * @var array List of log entries by level
-     */
-    public array $logs = [];
-
-    public function __construct(Configuration $config)
-    {
-        // don't do anything with the configuration
-    }
-
-    public function log(int $level, string $string): void
-    {
-        $this->logs[$level][] = $string;
-    }
-
-    public function setLogFormat(string $format): void
-    {
-        // ignored
-    }
-}
diff --git a/tests/Utils/ClearStateTestCase.php b/tests/Utils/ClearStateTestCase.php
deleted file mode 100644
index 644e4353f8e287e94d221df0fd949fe6872474f6..0000000000000000000000000000000000000000
--- a/tests/Utils/ClearStateTestCase.php
+++ /dev/null
@@ -1,56 +0,0 @@
-<?php
-
-declare(strict_types=1);
-
-namespace SimpleSAML\Test\Utils;
-
-use PHPUnit\Framework\TestCase;
-
-/**
- * A base SSP test case that takes care of removing global state prior to test runs
- */
-class ClearStateTestCase extends TestCase
-{
-    /**
-     * Used for managing and clearing state
-     * @var \SimpleSAML\Test\Utils\StateClearer|null
-     */
-    protected static ?StateClearer $stateClearer = null;
-
-
-    /**
-     */
-    public static function setUpBeforeClass(): void
-    {
-        if (self::$stateClearer === null) {
-            self::$stateClearer = new StateClearer();
-            self::$stateClearer->backupGlobals();
-        }
-    }
-
-
-    /**
-     */
-    protected function setUp(): void
-    {
-        self::clearState();
-    }
-
-
-    /**
-     */
-    public static function tearDownAfterClass(): void
-    {
-        self::clearState();
-    }
-
-
-    /**
-     * Clear any SSP global state to reduce spill over between tests.
-     */
-    public static function clearState(): void
-    {
-        self::$stateClearer->clearGlobals();
-        self::$stateClearer->clearSSPState();
-    }
-}
diff --git a/tests/Utils/ReduceSpillOverTest.php b/tests/Utils/ReduceSpillOverTest.php
deleted file mode 100644
index ba57f9cbf420ab949f5dee6d8ad89e4282b9ef29..0000000000000000000000000000000000000000
--- a/tests/Utils/ReduceSpillOverTest.php
+++ /dev/null
@@ -1,45 +0,0 @@
-<?php
-
-declare(strict_types=1);
-
-namespace SimpleSAML\Test\Utils;
-
-use SimpleSAML\Configuration;
-use SimpleSAML\Error;
-
-/**
- * Test that ensures state doesn't spill over between tests
- * @package SimpleSAML\Test\Utils
- */
-class ReduceSpillOverTest extends ClearStateTestCase
-{
-    /**
-     * Set some global state
-     */
-    public function testSetState(): void
-    {
-        $_SERVER['QUERY_STRING'] = 'a=b';
-        Configuration::loadFromArray(['a' => 'b'], '[ARRAY]', 'simplesaml');
-        $this->assertEquals('b', Configuration::getInstance()->getString('a'));
-        putenv('SIMPLESAMLPHP_CONFIG_DIR=' . __DIR__);
-    }
-
-
-    /**
-     * Confirm global state removed prior to next test
-     * @throws \SimpleSAML\Error\ConfigurationError
-     */
-    public function testStateRemoved(): void
-    {
-        $this->assertArrayNotHasKey('QUERY_STRING', $_SERVER);
-        /** @var false $env */
-        $env = getenv('SIMPLESAMLPHP_CONFIG_DIR');
-        $this->assertFalse($env);
-        try {
-            Configuration::getInstance();
-            $this->fail('Expected config configured in other tests to no longer be valid');
-        } catch (Error\ConfigurationError $error) {
-            // Expected error
-        }
-    }
-}
diff --git a/tests/Utils/StateClearer.php b/tests/Utils/StateClearer.php
deleted file mode 100644
index 569c8f90eea3b514c3b8194276d73b7e8c471e0f..0000000000000000000000000000000000000000
--- a/tests/Utils/StateClearer.php
+++ /dev/null
@@ -1,87 +0,0 @@
-<?php
-
-declare(strict_types=1);
-
-namespace SimpleSAML\Test\Utils;
-
-/**
- * A helper class to aid in clearing global state that is set during SSP tests
- */
-class StateClearer
-{
-    /**
-     * Global state to restore between test runs
-     * @var array
-     */
-    private array $backups = [];
-
-    /**
-     * Class that implement \SimpleSAML\Utils\ClearableState and should have clearInternalState called between tests
-     * @var array
-     */
-    private array $clearableState = [
-        'SimpleSAML\Configuration',
-        'SimpleSAML\Metadata\MetaDataStorageHandler',
-        'SimpleSAML\Store\StoreFactory',
-        'SimpleSAML\Session'
-    ];
-
-    /**
-     * Environmental variables to unset
-     * @var string[]
-     */
-    private array $vars_to_unset = ['SIMPLESAMLPHP_CONFIG_DIR'];
-
-
-    /**
-     */
-    public function backupGlobals(): void
-    {
-        // Backup any state that is needed as part of processing, so we can restore it later.
-        // TODO: phpunit's backupGlobals = false, yet we are trying to do a similar thing here. Is that an issue?
-        $this->backups['$_COOKIE'] = $_COOKIE;
-        $this->backups['$_ENV'] = $_ENV;
-        $this->backups['$_FILES'] = $_FILES;
-        $this->backups['$_GET'] = $_GET;
-        $this->backups['$_POST'] = $_POST;
-        $this->backups['$_SERVER'] = $_SERVER;
-        /** @psalm-var array|null $_SESSION */
-        $this->backups['$_SESSION'] = isset($_SESSION) ? $_SESSION : [];
-        $this->backups['$_REQUEST'] = $_REQUEST;
-    }
-
-
-    /**
-     * Clear any global state.
-     */
-    public function clearGlobals(): void
-    {
-        if (!empty($this->backups)) {
-            $_COOKIE = $this->backups['$_COOKIE'];
-            $_ENV = $this->backups['$_ENV'];
-            $_FILES = $this->backups['$_FILES'];
-            $_GET = $this->backups['$_GET'];
-            $_POST = $this->backups['$_POST'];
-            $_SERVER = $this->backups['$_SERVER'];
-            $_SESSION = $this->backups['$_SESSION'];
-            $_REQUEST = $this->backups['$_REQUEST'];
-        } else {
-            //TODO: what should this behavior be?
-        }
-    }
-
-
-    /**
-     * Clear any SSP specific state, such as SSP enviormental variables or cached internals.
-     */
-    public function clearSSPState(): void
-    {
-        foreach ($this->clearableState as $var) {
-            $var::clearInternalState();
-        }
-
-        foreach ($this->vars_to_unset as $var) {
-            putenv($var);
-        }
-    }
-}
diff --git a/tests/bootstrap.php b/tests/bootstrap.php
index 76e5b5f97efa2ff1f6ebd08a0b32009a64f0de9b..796ba16b466d572a18bf20e5092b396b534d42e0 100644
--- a/tests/bootstrap.php
+++ b/tests/bootstrap.php
@@ -5,9 +5,6 @@ declare(strict_types=1);
 $projectRoot = dirname(__DIR__);
 require_once($projectRoot . '/vendor/autoload.php');
 
-// Current SSP autoloader can't resolve classes from the tests folder.
-include($projectRoot . '/tests/Utils/ClearStateTestCase.php');
-
 // set the SAML2 container
 $container = new \SimpleSAML\Compat\SspContainer();
 \SAML2\Compat\ContainerSingleton::setContainer($container);
diff --git a/tests/lib/SimpleSAML/Auth/SimpleTest.php b/tests/lib/SimpleSAML/Auth/SimpleTest.php
index 2c407cd491ff13a1f3419e41022ade6331f1d48c..ae8ce73292ddfb3afdd02edad0f237c47291cad6 100644
--- a/tests/lib/SimpleSAML/Auth/SimpleTest.php
+++ b/tests/lib/SimpleSAML/Auth/SimpleTest.php
@@ -7,7 +7,7 @@ namespace SimpleSAML\Test\Auth;
 use ReflectionClass;
 use SimpleSAML\Auth;
 use SimpleSAML\Configuration;
-use SimpleSAML\Test\Utils\ClearStateTestCase;
+use SimpleSAML\TestUtils\ClearStateTestCase;
 
 /**
  * Tests for \SimpleSAML\Auth\Simple
diff --git a/tests/lib/SimpleSAML/Auth/SourceTest.php b/tests/lib/SimpleSAML/Auth/SourceTest.php
index 0d447cb6ddca87f096b87ca6919dec3f1b829baa..443ad4a78a1a3a5bf836d5b057742f65a28020d1 100644
--- a/tests/lib/SimpleSAML/Auth/SourceTest.php
+++ b/tests/lib/SimpleSAML/Auth/SourceTest.php
@@ -6,7 +6,7 @@ namespace SimpleSAML\Test\Auth;
 
 use ReflectionClass;
 use SimpleSAML\Auth;
-use SimpleSAML\Test\Utils\ClearStateTestCase;
+use SimpleSAML\TestUtils\ClearStateTestCase;
 use SimpleSAML\Test\Utils\TestAuthSource;
 use SimpleSAML\Test\Utils\TestAuthSourceFactory;
 
diff --git a/tests/lib/SimpleSAML/ConfigurationTest.php b/tests/lib/SimpleSAML/ConfigurationTest.php
index 50455174d92f1c35878ec7f8f5bab82344e015e3..7950667680e9eeb135ad10c7f5d9845716d3f35b 100644
--- a/tests/lib/SimpleSAML/ConfigurationTest.php
+++ b/tests/lib/SimpleSAML/ConfigurationTest.php
@@ -8,7 +8,7 @@ use Exception;
 use SAML2\Constants;
 use SimpleSAML\Configuration;
 use SimpleSAML\Error;
-use SimpleSAML\Test\Utils\ClearStateTestCase;
+use SimpleSAML\TestUtils\ClearStateTestCase;
 
 /**
  * Tests for \SimpleSAML\Configuration
diff --git a/tests/lib/SimpleSAML/LoggerTest.php b/tests/lib/SimpleSAML/LoggerTest.php
index 6fdaf00394592e2b8d2a3df20908059f8d1f0294..a613cee8d0059535a1f449efa28f04025bea47db 100644
--- a/tests/lib/SimpleSAML/LoggerTest.php
+++ b/tests/lib/SimpleSAML/LoggerTest.php
@@ -8,12 +8,12 @@ use Exception;
 use PHPUnit\Framework\TestCase;
 use SimpleSAML\Configuration;
 use SimpleSAML\Logger;
-use SimpleSAML\Test\Utils\ArrayLogger;
+use SimpleSAML\TestUtils\ArrayLogger;
 
 class LoggerTest extends TestCase
 {
     /**
-     * @var Logger\LoggingHandlerInterface|null
+     * @var \SimpleSAML\Logger\LoggingHandlerInterface|null
      */
     protected $originalLogger;
 
diff --git a/tests/lib/SimpleSAML/Metadata/MetaDataStorageHandlerTest.php b/tests/lib/SimpleSAML/Metadata/MetaDataStorageHandlerTest.php
index 66739c3aad358b3653db8599ae85d61c58c01303..dd881ab0923f73ba12b3b23eda65d9397a9a14fc 100644
--- a/tests/lib/SimpleSAML/Metadata/MetaDataStorageHandlerTest.php
+++ b/tests/lib/SimpleSAML/Metadata/MetaDataStorageHandlerTest.php
@@ -6,7 +6,7 @@ namespace SimpleSAML\Test\Metadata;
 
 use SimpleSAML\Configuration;
 use SimpleSAML\Metadata\MetaDataStorageHandler;
-use SimpleSAML\Test\Utils\ClearStateTestCase;
+use SimpleSAML\TestUtils\ClearStateTestCase;
 
 /**
  * @covers \SimpleSAML\Metadata\MetadataStorageHandler
diff --git a/tests/lib/SimpleSAML/SessionHandlerPHPTest.php b/tests/lib/SimpleSAML/SessionHandlerPHPTest.php
index 5e79591eac60d8f4ee62b915d080a77b2c128d5d..e3c79e3ed3fedae436a1321d8cb89c73e39f7b58 100644
--- a/tests/lib/SimpleSAML/SessionHandlerPHPTest.php
+++ b/tests/lib/SimpleSAML/SessionHandlerPHPTest.php
@@ -5,7 +5,7 @@ declare(strict_types=1);
 namespace SimpleSAML\Test\Utils;
 
 use PHPUnit\Framework\TestCase;
-use SimpleSAML\Test\Utils\ClearStateTestCase;
+use SimpleSAML\TestUtils\ClearStateTestCase;
 use SimpleSAML\SessionHandlerPHP;
 use SimpleSAML\Configuration;
 
diff --git a/tests/lib/SimpleSAML/SessionTest.php b/tests/lib/SimpleSAML/SessionTest.php
index 1a75ba4388c9343436bae3b032b03e5493400c1e..b586532cf0bdd34976ea153a3d9c79f595a9d437 100644
--- a/tests/lib/SimpleSAML/SessionTest.php
+++ b/tests/lib/SimpleSAML/SessionTest.php
@@ -5,7 +5,7 @@ declare(strict_types=1);
 namespace SimpleSAML\Test\Utils;
 
 use PHPUnit\Framework\TestCase;
-use SimpleSAML\Test\Utils\ClearStateTestCase;
+use SimpleSAML\TestUtils\ClearStateTestCase;
 use SimpleSAML\Session;
 use SimpleSAML\Configuration;
 
diff --git a/tests/lib/SimpleSAML/Utils/EMailTest.php b/tests/lib/SimpleSAML/Utils/EMailTest.php
index f3b51427ab37eb4ace19b31da78ef6897e76449e..a1dc4be039b8fcf776e2e2c68e68bfcff79df87f 100644
--- a/tests/lib/SimpleSAML/Utils/EMailTest.php
+++ b/tests/lib/SimpleSAML/Utils/EMailTest.php
@@ -7,7 +7,7 @@ namespace SimpleSAML\Test\Utils;
 use Exception;
 use InvalidArgumentException;
 use SimpleSAML\Configuration;
-use SimpleSAML\Test\Utils\TestCase;
+use SimpleSAML\TestUtils\ClearStateTestCase;
 use SimpleSAML\Utils\EMail;
 
 /**
diff --git a/tests/lib/SimpleSAML/Utils/HTTPTest.php b/tests/lib/SimpleSAML/Utils/HTTPTest.php
index 03a40a7b4d50fee8d97a7fb82736d79755e154a4..907b0179c654dd571ac17e966dd8bcff7c7c9b8a 100644
--- a/tests/lib/SimpleSAML/Utils/HTTPTest.php
+++ b/tests/lib/SimpleSAML/Utils/HTTPTest.php
@@ -7,7 +7,7 @@ namespace SimpleSAML\Test\Utils;
 use PHPUnit\Framework\TestCase;
 use SimpleSAML\Configuration;
 use SimpleSAML\Error;
-use SimpleSAML\Test\Utils\ClearStateTestCase;
+use SimpleSAML\TestUtils\ClearStateTestCase;
 use SimpleSAML\Utils;
 
 /**
diff --git a/tests/modules/core/lib/Controller/LoginTest.php b/tests/modules/core/lib/Controller/LoginTest.php
index 341885210608455c1c8b52a174bc74351e2cff7d..f204086633fd3c5ec69847fd519a6d246c741431 100644
--- a/tests/modules/core/lib/Controller/LoginTest.php
+++ b/tests/modules/core/lib/Controller/LoginTest.php
@@ -13,7 +13,7 @@ use SimpleSAML\HTTP\RunnableResponse;
 use SimpleSAML\Locale\Localization;
 use SimpleSAML\Module\core\Controller;
 use SimpleSAML\Session;
-use SimpleSAML\Test\Utils\ClearStateTestCase;
+use SimpleSAML\TestUtils\ClearStateTestCase;
 use SimpleSAML\XHTML\Template;
 use Symfony\Component\HttpFoundation\RedirectResponse;
 use Symfony\Component\HttpFoundation\Request;
diff --git a/tests/modules/multiauth/lib/Auth/Source/MultiAuthTest.php b/tests/modules/multiauth/lib/Auth/Source/MultiAuthTest.php
index 5760e213d72780b215e04740c215c54fe385b665..83be7f6e0d4f80b702b9cfad0d5787decd7c8125 100644
--- a/tests/modules/multiauth/lib/Auth/Source/MultiAuthTest.php
+++ b/tests/modules/multiauth/lib/Auth/Source/MultiAuthTest.php
@@ -6,7 +6,7 @@ namespace SimpleSAML\Test\Module\multiauth\Auth\Source;
 
 use Error;
 use Exception;
-use SimpleSAML\Test\Utils\ClearStateTestCase;
+use SimpleSAML\TestUtils\ClearStateTestCase;
 use SimpleSAML\Configuration;
 use SimpleSAML\Module\multiauth\Auth\Source\MultiAuth;
 
diff --git a/tests/modules/saml/lib/Auth/Source/SPTest.php b/tests/modules/saml/lib/Auth/Source/SPTest.php
index bb5746072f308692ef6efb82005d18fa0389d3b4..1bb6ab70097413c5f98c194e666e851a080ebcaf 100644
--- a/tests/modules/saml/lib/Auth/Source/SPTest.php
+++ b/tests/modules/saml/lib/Auth/Source/SPTest.php
@@ -16,7 +16,7 @@ use SimpleSAML\Error\Exception;
 use SimpleSAML\Module\saml\Error\NoAvailableIDP;
 use SimpleSAML\Module\saml\Error\NoSupportedIDP;
 use SimpleSAML\Test\Metadata\MetaDataStorageSourceTest;
-use SimpleSAML\Test\Utils\ClearStateTestCase;
+use SimpleSAML\TestUtils\ClearStateTestCase;
 use SimpleSAML\Test\Utils\ExitTestException;
 use SimpleSAML\Test\Utils\SpTester;
 
diff --git a/tests/modules/saml/lib/IdP/SAML2Test.php b/tests/modules/saml/lib/IdP/SAML2Test.php
index 9f0b5906bc51418f73429f2acc334229199011a6..1b017fe586ed2d3bd17a26e89f09c468223518c6 100644
--- a/tests/modules/saml/lib/IdP/SAML2Test.php
+++ b/tests/modules/saml/lib/IdP/SAML2Test.php
@@ -11,7 +11,7 @@ use SimpleSAML\IdP;
 use SimpleSAML\Metadata\MetaDataStorageHandler;
 use SimpleSAML\Metadata\MetaDataStorageHandlerSerialize;
 use SimpleSAML\Module\saml\IdP\SAML2;
-use SimpleSAML\Test\Utils\ClearStateTestCase;
+use SimpleSAML\TestUtils\ClearStateTestCase;
 
 /**
  * @covers \SimpleSAML\Module\saml\IdP\SAML2