Merge branch '2.3' into 2.4
* 2.3: [Debug] fix ErrorHandlerTest when context is not an array Conflicts: src/Symfony/Component/Debug/Tests/ErrorHandlerTest.php
This commit is contained in:
commit
f800ade034
@ -145,7 +145,7 @@ class ErrorHandler
|
|||||||
require __DIR__.'/Exception/ContextErrorException.php';
|
require __DIR__.'/Exception/ContextErrorException.php';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (PHP_VERSION_ID < 50400 && isset($context['GLOBALS'])) {
|
if (PHP_VERSION_ID < 50400 && isset($context['GLOBALS']) && is_array($context)) {
|
||||||
unset($context['GLOBALS']);
|
unset($context['GLOBALS']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -181,18 +181,18 @@ PHP
|
|||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
$handler = ErrorHandler::register(0);
|
$handler = ErrorHandler::register(0);
|
||||||
$this->assertFalse($handler->handle(0, 'foo', 'foo.php', 12, 'foo'));
|
$this->assertFalse($handler->handle(0, 'foo', 'foo.php', 12, array()));
|
||||||
|
|
||||||
restore_error_handler();
|
restore_error_handler();
|
||||||
|
|
||||||
$handler = ErrorHandler::register(3);
|
$handler = ErrorHandler::register(3);
|
||||||
$this->assertFalse($handler->handle(4, 'foo', 'foo.php', 12, 'foo'));
|
$this->assertFalse($handler->handle(4, 'foo', 'foo.php', 12, array()));
|
||||||
|
|
||||||
restore_error_handler();
|
restore_error_handler();
|
||||||
|
|
||||||
$handler = ErrorHandler::register(3);
|
$handler = ErrorHandler::register(3);
|
||||||
try {
|
try {
|
||||||
$handler->handle(111, 'foo', 'foo.php', 12, 'foo');
|
$handler->handle(111, 'foo', 'foo.php', 12, array());
|
||||||
} catch (\ErrorException $e) {
|
} catch (\ErrorException $e) {
|
||||||
$this->assertSame('111: foo in foo.php line 12', $e->getMessage());
|
$this->assertSame('111: foo in foo.php line 12', $e->getMessage());
|
||||||
$this->assertSame(111, $e->getSeverity());
|
$this->assertSame(111, $e->getSeverity());
|
||||||
@ -203,12 +203,12 @@ PHP
|
|||||||
restore_error_handler();
|
restore_error_handler();
|
||||||
|
|
||||||
$handler = ErrorHandler::register(E_USER_DEPRECATED);
|
$handler = ErrorHandler::register(E_USER_DEPRECATED);
|
||||||
$this->assertTrue($handler->handle(E_USER_DEPRECATED, 'foo', 'foo.php', 12, 'foo'));
|
$this->assertTrue($handler->handle(E_USER_DEPRECATED, 'foo', 'foo.php', 12, array()));
|
||||||
|
|
||||||
restore_error_handler();
|
restore_error_handler();
|
||||||
|
|
||||||
$handler = ErrorHandler::register(E_DEPRECATED);
|
$handler = ErrorHandler::register(E_DEPRECATED);
|
||||||
$this->assertTrue($handler->handle(E_DEPRECATED, 'foo', 'foo.php', 12, 'foo'));
|
$this->assertTrue($handler->handle(E_DEPRECATED, 'foo', 'foo.php', 12, array()));
|
||||||
|
|
||||||
restore_error_handler();
|
restore_error_handler();
|
||||||
|
|
||||||
@ -231,7 +231,7 @@ PHP
|
|||||||
|
|
||||||
$handler = ErrorHandler::register(E_USER_DEPRECATED);
|
$handler = ErrorHandler::register(E_USER_DEPRECATED);
|
||||||
$handler->setLogger($logger);
|
$handler->setLogger($logger);
|
||||||
$handler->handle(E_USER_DEPRECATED, 'foo', 'foo.php', 12, 'foo');
|
$handler->handle(E_USER_DEPRECATED, 'foo', 'foo.php', 12, array());
|
||||||
|
|
||||||
restore_error_handler();
|
restore_error_handler();
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
|
Reference in New Issue
Block a user