[BUGFIX] Improve ErrorHandlerTest handleErrorFetchesDeprecations 62/55562/3
authorNicole Cordes <typo3@cordes.co>
Mon, 5 Feb 2018 11:32:06 +0000 (12:32 +0100)
committerFrank Naegler <frank.naegler@typo3.org>
Mon, 5 Feb 2018 12:58:57 +0000 (13:58 +0100)
The patch decouples the ErrorHandler test from MySQL and some internal
deprecated function.

Related: #83770
Releases: master
Change-Id: Id3b9ed3486d0c5c8a4f6ba030a25f1f8aee75b97
Reviewed-on: https://review.typo3.org/55562
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Frank Naegler <frank.naegler@typo3.org>
Tested-by: Frank Naegler <frank.naegler@typo3.org>
typo3/sysext/core/Tests/Functional/Error/ErrorHandlerTest.php

index 91a7302..2b969bf 100644 (file)
@@ -23,18 +23,11 @@ class ErrorHandlerTest extends \TYPO3\TestingFramework\Core\Functional\Functiona
     /**
      * @var array
      */
-    protected $coreExtensionsToLoad = [
-        'workspaces',
-    ];
-
-    /**
-     * @var array
-     */
     protected $configurationToUseInTestInstance = [
         'DB' => [
             'Connections' => [
                 'Default' => [
-                    'initCommands' => 'SET SESSION sql_mode = \'STRICT_ALL_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_VALUE_ON_ZERO,NO_ENGINE_SUBSTITUTION,NO_ZERO_DATE,NO_ZERO_IN_DATE,ONLY_FULL_GROUP_BY\';',
+                    'initCommands' => 'SET NAMES \'UTF8\';',
                 ],
             ],
         ],
@@ -45,6 +38,14 @@ class ErrorHandlerTest extends \TYPO3\TestingFramework\Core\Functional\Functiona
      */
     public function handleErrorFetchesDeprecations()
     {
-        $this->assertTrue(\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('version'));
+        trigger_error(
+            'The first error triggers database connection to be initialized and should be caught.',
+            E_USER_DEPRECATED
+        );
+        trigger_error(
+            'The second error should be caught by ErrorHandler as well.',
+            E_USER_DEPRECATED
+        );
+        $this->assertTrue(true);
     }
 }