From 66d5d3ce7857e3d5bc92e09402b432f855c0bb07 Mon Sep 17 00:00:00 2001
From: Tim van Dijen <tvdijen@gmail.com>
Date: Sun, 14 Jul 2019 16:55:55 +0200
Subject: [PATCH] Fix UndefinedClass

---
 .../core/lib/Auth/Process/CardinalitySingleTest.php        | 7 +------
 tests/modules/core/lib/Auth/Process/CardinalityTest.php    | 7 +------
 tests/modules/core/lib/Auth/UserPassBaseTest.php           | 2 +-
 tests/modules/core/lib/Auth/UserPassOrgBaseTest.php        | 2 +-
 tests/www/RouterTest.php                                   | 3 ++-
 5 files changed, 6 insertions(+), 15 deletions(-)

diff --git a/tests/modules/core/lib/Auth/Process/CardinalitySingleTest.php b/tests/modules/core/lib/Auth/Process/CardinalitySingleTest.php
index 533bb9f11..798388628 100644
--- a/tests/modules/core/lib/Auth/Process/CardinalitySingleTest.php
+++ b/tests/modules/core/lib/Auth/Process/CardinalitySingleTest.php
@@ -2,15 +2,10 @@
 
 namespace SimpleSAML\Test\Module\core\Auth\Process;
 
-// Alias the PHPUnit 6.0 ancestor if available, else fall back to legacy ancestor
-if (class_exists('\PHPUnit\Framework\TestCase', true) and !class_exists('\PHPUnit_Framework_TestCase', true)) {
-    class_alias('\PHPUnit\Framework\TestCase', '\PHPUnit_Framework_TestCase', true);
-}
-
 /**
  * Test for the core:CardinalitySingle filter.
  */
-class CardinalitySingleTest extends \PHPUnit_Framework_TestCase
+class CardinalitySingleTest extends \PHPUnit\Framework\TestCase
 {
     private $http;
 
diff --git a/tests/modules/core/lib/Auth/Process/CardinalityTest.php b/tests/modules/core/lib/Auth/Process/CardinalityTest.php
index 5f3302c1b..508338367 100644
--- a/tests/modules/core/lib/Auth/Process/CardinalityTest.php
+++ b/tests/modules/core/lib/Auth/Process/CardinalityTest.php
@@ -2,15 +2,10 @@
 
 namespace SimpleSAML\Test\Module\core\Auth\Process;
 
-// Alias the PHPUnit 6.0 ancestor if available, else fall back to legacy ancestor
-if (class_exists('\PHPUnit\Framework\TestCase', true) and !class_exists('\PHPUnit_Framework_TestCase', true)) {
-    class_alias('\PHPUnit\Framework\TestCase', '\PHPUnit_Framework_TestCase', true);
-}
-
 /**
  * Test for the core:Cardinality filter.
  */
-class CardinalityTest extends \PHPUnit_Framework_TestCase
+class CardinalityTest extends \PHPUnit\Framework\TestCase
 {
     private $http;
 
diff --git a/tests/modules/core/lib/Auth/UserPassBaseTest.php b/tests/modules/core/lib/Auth/UserPassBaseTest.php
index 242ff79db..a6715df98 100644
--- a/tests/modules/core/lib/Auth/UserPassBaseTest.php
+++ b/tests/modules/core/lib/Auth/UserPassBaseTest.php
@@ -2,7 +2,7 @@
 
 namespace SimpleSAML\Test\Module\core\Auth;
 
-class UserPassBaseTest extends \PHPUnit_Framework_TestCase
+class UserPassBaseTest extends \PHPUnit\Framework\TestCase
 {
     public function testAuthenticateECPCallsLoginAndSetsAttributes()
     {
diff --git a/tests/modules/core/lib/Auth/UserPassOrgBaseTest.php b/tests/modules/core/lib/Auth/UserPassOrgBaseTest.php
index 7db0605b0..e3a091cef 100644
--- a/tests/modules/core/lib/Auth/UserPassOrgBaseTest.php
+++ b/tests/modules/core/lib/Auth/UserPassOrgBaseTest.php
@@ -4,7 +4,7 @@ namespace SimpleSAML\Test\Module\core\Auth;
 
 use SimpleSAML\Module\core\Auth\UserPassOrgBase;
 
-class UserPassOrgBaseTest extends \PHPUnit_Framework_TestCase
+class UserPassOrgBaseTest extends \PHPUnit\Framework\TestCase
 {
     public function testRememberOrganizationEnabled()
     {
diff --git a/tests/www/RouterTest.php b/tests/www/RouterTest.php
index 70c73ce92..d653b1b1d 100644
--- a/tests/www/RouterTest.php
+++ b/tests/www/RouterTest.php
@@ -3,6 +3,7 @@
 namespace SimpleSAML\Test\Web;
 
 use Symfony\Component\Yaml\Parser;
+use Symfony\Component\Yaml\Exception\ParseException;
 use PHPUnit\Framework\TestCase;
 use \SimpleSAML\Configuration;
 use \SimpleSAML\Module;
@@ -28,7 +29,7 @@ class RouterTest extends TestCase
                         try {
                             $value = $yaml->parse(file_get_contents('modules/'.$module.'/'.$file));
                             $this->addToAssertionCount(1);
-                        } catch (\ParseException $e) {
+                        } catch (ParseException $e) {
                             $this->fail($e->getMessage().' in '.$e->getFile().':'.$e->getLine());
                         }
                     }
-- 
GitLab