‪TYPO3CMS  11.5
TYPO3\CMS\Core\Tests\Unit\Error\ErrorHandlerTest Class Reference
Inheritance diagram for TYPO3\CMS\Core\Tests\Unit\Error\ErrorHandlerTest:

Public Member Functions

 errorHandlerLogsCorrectly (int $levelsToHandle, int $levelsToThrow, int $levelToTrigger, string $message, string $file, int $line, ?bool $expectedReturn, ?string $deprecationsLogMessage, ?string $deprecationsLogLevel, ?string $errorsLogMessage, ?string $errorsLogLevel, ?string $exceptionMessage)
 
 errorTests ()
 

Protected Member Functions

 setUp ()
 

Protected Attributes

ErrorHandlerInterface $subject
 
LoggerInterface $unusedLogger
 
LoggerInterface $trackingLogger
 
const DEFAULT_ERROR_HANDLER_LEVELS = E_ALL & ~(E_STRICT | E_NOTICE | E_COMPILE_WARNING | E_COMPILE_ERROR | E_CORE_WARNING | E_CORE_ERROR | E_PARSE | E_ERROR)
 
const DEFAULT_EXCEPTIONAL_ERROR_LEVELS = E_ALL & ~(E_STRICT | E_NOTICE | E_COMPILE_WARNING | E_COMPILE_ERROR | E_CORE_WARNING | E_CORE_ERROR | E_PARSE | E_ERROR | E_DEPRECATED | E_USER_DEPRECATED | E_WARNING | E_USER_ERROR | E_USER_NOTICE | E_USER_WARNING)
 
 $resetSingletonInstances = true
 

Detailed Description

Testcase for the ErrorHandler class.

Definition at line 33 of file ErrorHandlerTest.php.

Member Function Documentation

◆ errorHandlerLogsCorrectly()

TYPO3\CMS\Core\Tests\Unit\Error\ErrorHandlerTest::errorHandlerLogsCorrectly ( int  $levelsToHandle,
int  $levelsToThrow,
int  $levelToTrigger,
string  $message,
string  $file,
int  $line,
?bool  $expectedReturn,
?string  $deprecationsLogMessage,
?string  $deprecationsLogLevel,
?string  $errorsLogMessage,
?string  $errorsLogLevel,
?string  $exceptionMessage 
)
Test:
‪@dataProvider errorTests

disabled until the new channel is in place if ($errorsLogMessage) { self::assertEquals($errorsLogMessage, $logManager->getLogger('TYPO3.CMS.php_errors')->records[0]['message']); self::assertEquals($errorsLogLevel, $logManager->getLogger('TYPO3.CMS.php_errors')->records[0]['level']); }

Definition at line 71 of file ErrorHandlerTest.php.

References TYPO3\CMS\Core\Tests\Unit\Error\ErrorHandlerTest\$subject, TYPO3\CMS\Core\Error\ErrorHandlerInterface\handleError(), and TYPO3\CMS\Core\Error\ErrorHandlerInterface\setExceptionalErrors().

◆ errorTests()

◆ setUp()

TYPO3\CMS\Core\Tests\Unit\Error\ErrorHandlerTest::setUp ( )
protected

Sets up this test case.

Definition at line 49 of file ErrorHandlerTest.php.

Member Data Documentation

◆ $resetSingletonInstances

TYPO3\CMS\Core\Tests\Unit\Error\ErrorHandlerTest::$resetSingletonInstances = true
protected

Definition at line 44 of file ErrorHandlerTest.php.

◆ $subject

ErrorHandlerInterface TYPO3\CMS\Core\Tests\Unit\Error\ErrorHandlerTest::$subject
protected

◆ $trackingLogger

LoggerInterface TYPO3\CMS\Core\Tests\Unit\Error\ErrorHandlerTest::$trackingLogger
protected

Definition at line 38 of file ErrorHandlerTest.php.

◆ $unusedLogger

LoggerInterface TYPO3\CMS\Core\Tests\Unit\Error\ErrorHandlerTest::$unusedLogger
protected

Definition at line 37 of file ErrorHandlerTest.php.

◆ DEFAULT_ERROR_HANDLER_LEVELS

const TYPO3\CMS\Core\Tests\Unit\Error\ErrorHandlerTest::DEFAULT_ERROR_HANDLER_LEVELS = E_ALL & ~(E_STRICT | E_NOTICE | E_COMPILE_WARNING | E_COMPILE_ERROR | E_CORE_WARNING | E_CORE_ERROR | E_PARSE | E_ERROR)
protected

◆ DEFAULT_EXCEPTIONAL_ERROR_LEVELS

const TYPO3\CMS\Core\Tests\Unit\Error\ErrorHandlerTest::DEFAULT_EXCEPTIONAL_ERROR_LEVELS = E_ALL & ~(E_STRICT | E_NOTICE | E_COMPILE_WARNING | E_COMPILE_ERROR | E_CORE_WARNING | E_CORE_ERROR | E_PARSE | E_ERROR | E_DEPRECATED | E_USER_DEPRECATED | E_WARNING | E_USER_ERROR | E_USER_NOTICE | E_USER_WARNING)
protected