From cab9d48ed4c391a09d95925a8410ad7a5573ad6e Mon Sep 17 00:00:00 2001
From: Andreas Fernandez <a.fernandez@scripting-base.de>
Date: Mon, 26 Jun 2017 20:46:51 +0200
Subject: [PATCH] [BUGFIX] Fix namespace of PHPUnit exception

Since PHPUnit 6.2, exceptions are namespaced. The tests are adjusted to
catch these exceptions properly again.

Resolves: #81705
Related: #81696
Releases: master, 8.7
Change-Id: I786248b9ca3f4fcef37ab9dd4fd29d696eef438b
Reviewed-on: https://review.typo3.org/53333
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
---
 typo3/sysext/core/Tests/Unit/Resource/ProcessedFileTest.php     | 2 +-
 .../extbase/Tests/Unit/Mvc/Web/Routing/UriBuilderTest.php       | 2 +-
 .../Property/TypeConverter/PersistentObjectConverterTest.php    | 2 +-
 .../fluid/Tests/Unit/ViewHelpers/Form/SelectViewHelperTest.php  | 2 +-
 .../fluid/Tests/Unit/ViewHelpers/Format/DateViewHelperTest.php  | 2 +-
 .../Tests/Unit/ContentObject/ContentObjectRendererTest.php      | 2 +-
 6 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/typo3/sysext/core/Tests/Unit/Resource/ProcessedFileTest.php b/typo3/sysext/core/Tests/Unit/Resource/ProcessedFileTest.php
index 5a4773e45180..7a7869819fd6 100644
--- a/typo3/sysext/core/Tests/Unit/Resource/ProcessedFileTest.php
+++ b/typo3/sysext/core/Tests/Unit/Resource/ProcessedFileTest.php
@@ -40,7 +40,7 @@ class ProcessedFileTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCase
     protected $databaseRow = [];
 
     /**
-     * @throws \PHPUnit_Framework_Exception
+     * @throws \PHPUnit\Framework\Exception
      */
     protected function setUp()
     {
diff --git a/typo3/sysext/extbase/Tests/Unit/Mvc/Web/Routing/UriBuilderTest.php b/typo3/sysext/extbase/Tests/Unit/Mvc/Web/Routing/UriBuilderTest.php
index 7b0e7f2b2931..a86b73b6d3cc 100644
--- a/typo3/sysext/extbase/Tests/Unit/Mvc/Web/Routing/UriBuilderTest.php
+++ b/typo3/sysext/extbase/Tests/Unit/Mvc/Web/Routing/UriBuilderTest.php
@@ -61,7 +61,7 @@ class UriBuilderTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCase
 
     /**
      * @throws \InvalidArgumentException
-     * @throws \PHPUnit_Framework_Exception
+     * @throws \PHPUnit\Framework\Exception
      */
     protected function setUp()
     {
diff --git a/typo3/sysext/extbase/Tests/Unit/Property/TypeConverter/PersistentObjectConverterTest.php b/typo3/sysext/extbase/Tests/Unit/Property/TypeConverter/PersistentObjectConverterTest.php
index 1c2b35964c2c..899bfef624f1 100644
--- a/typo3/sysext/extbase/Tests/Unit/Property/TypeConverter/PersistentObjectConverterTest.php
+++ b/typo3/sysext/extbase/Tests/Unit/Property/TypeConverter/PersistentObjectConverterTest.php
@@ -61,7 +61,7 @@ class PersistentObjectConverterTest extends \TYPO3\TestingFramework\Core\Unit\Un
 
     /**
      * @throws \InvalidArgumentException
-     * @throws \PHPUnit_Framework_Exception
+     * @throws \PHPUnit\Framework\Exception
      * @throws \RuntimeException
      */
     protected function setUp()
diff --git a/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Form/SelectViewHelperTest.php b/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Form/SelectViewHelperTest.php
index 91081825485f..1394107def46 100644
--- a/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Form/SelectViewHelperTest.php
+++ b/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Form/SelectViewHelperTest.php
@@ -249,7 +249,7 @@ class SelectViewHelperTest extends ViewHelperBaseTestcase
             $this->setLocale(LC_CTYPE, $locale);
             $this->setLocale(LC_MONETARY, $locale);
             $this->setLocale(LC_TIME, $locale);
-        } catch (\PHPUnit_Framework_Exception $e) {
+        } catch (\PHPUnit\Framework\Exception $e) {
             $this->markTestSkipped('Locale ' . $locale . ' is not available.');
         }
         if (stristr(PHP_OS, 'Darwin') !== false) {
diff --git a/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Format/DateViewHelperTest.php b/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Format/DateViewHelperTest.php
index d12130fb8bf7..c49e512f5cfa 100644
--- a/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Format/DateViewHelperTest.php
+++ b/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Format/DateViewHelperTest.php
@@ -466,7 +466,7 @@ class DateViewHelperTest extends ViewHelperBaseTestcase
             $this->setLocale(LC_CTYPE, $locale);
             $this->setLocale(LC_MONETARY, $locale);
             $this->setLocale(LC_TIME, $locale);
-        } catch (\PHPUnit_Framework_Exception $e) {
+        } catch (\PHPUnit\Framework\Exception $e) {
             $this->markTestSkipped('Locale ' . $locale . ' is not available.');
         }
         $this->setArgumentsUnderTest(
diff --git a/typo3/sysext/frontend/Tests/Unit/ContentObject/ContentObjectRendererTest.php b/typo3/sysext/frontend/Tests/Unit/ContentObject/ContentObjectRendererTest.php
index b8ed108e2b3a..132e764030df 100644
--- a/typo3/sysext/frontend/Tests/Unit/ContentObject/ContentObjectRendererTest.php
+++ b/typo3/sysext/frontend/Tests/Unit/ContentObject/ContentObjectRendererTest.php
@@ -3980,7 +3980,7 @@ class ContentObjectRendererTest extends \TYPO3\TestingFramework\Core\Unit\UnitTe
         $locale = 'en_US.UTF-8';
         try {
             $this->setLocale(LC_NUMERIC, $locale);
-        } catch (\PHPUnit_Framework_Exception $e) {
+        } catch (\PHPUnit\Framework\Exception $e) {
             $this->markTestSkipped('Locale ' . $locale . ' is not available.');
         }
         $conf = ['bytes.' => $conf];
-- 
GitLab