[ticket/17108] Update composer dependencies and expect trigger error code

PHPBB3-17108
This commit is contained in:
Marc Alexander 2023-04-05 20:53:54 +02:00
parent 21222adc99
commit 51cdac9100
No known key found for this signature in database
GPG key ID: 50E0D2423696F995
2 changed files with 335 additions and 348 deletions

648
phpBB/composer.lock generated

File diff suppressed because it is too large Load diff

View file

@ -106,34 +106,17 @@ class phpbb_test_case_helpers
public function setExpectedTriggerError($errno, $message = '')
{
$exceptionName = '';
switch ($errno)
set_error_handler(
static function ($errno, $errstr)
{
case E_NOTICE:
case E_STRICT:
// The static property was removed from PHPUnit since v.8.3.0
if (isset(PHPUnit\Framework\Error\Notice::$enabled))
{
PHPUnit\Framework\Error\Notice::$enabled = true;
}
$exceptionName = 'PHPUnit\Framework\Error\Notice';
break;
restore_error_handler();
throw new Exception($errstr, $errno);
},
E_ALL
);
case E_WARNING:
// The static property was removed from PHPUnit since v.8.3.0
if (isset(PHPUnit\Framework\Error\Warning::$enabled))
{
PHPUnit\Framework\Error\Warning::$enabled = true;
}
$exceptionName = 'PHPUnit\Framework\Error\Warning';
break;
default:
$exceptionName = 'PHPUnit\Framework\Error\Error';
break;
}
$this->expectedTriggerError = true;
$this->test_case->expectException($exceptionName);
$this->test_case->expectException(Exception::class);
$this->test_case->expectExceptionCode($errno);
if ($message)
{