[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 = '') public function setExpectedTriggerError($errno, $message = '')
{ {
$exceptionName = ''; set_error_handler(
switch ($errno) static function ($errno, $errstr)
{ {
case E_NOTICE: restore_error_handler();
case E_STRICT: throw new Exception($errstr, $errno);
// The static property was removed from PHPUnit since v.8.3.0 },
if (isset(PHPUnit\Framework\Error\Notice::$enabled)) E_ALL
{ );
PHPUnit\Framework\Error\Notice::$enabled = true;
}
$exceptionName = 'PHPUnit\Framework\Error\Notice';
break;
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->expectedTriggerError = true;
$this->test_case->expectException($exceptionName); $this->test_case->expectException(Exception::class);
$this->test_case->expectExceptionCode($errno); $this->test_case->expectExceptionCode($errno);
if ($message) if ($message)
{ {