Skip to content

Commit

Permalink
[BUGFIX] Improve ErrorHandlerTest handleErrorFetchesDeprecations
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
IchHabRecht authored and NeoBlack committed Feb 5, 2018
1 parent 9f73c3a commit fa01dca
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions typo3/sysext/core/Tests/Functional/Error/ErrorHandlerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,14 @@
*/
class ErrorHandlerTest extends \TYPO3\TestingFramework\Core\Functional\FunctionalTestCase
{
/**
* @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\';',
],
],
],
Expand All @@ -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);
}
}

0 comments on commit fa01dca

Please sign in to comment.