1
0
mirror of https://github.com/Seldaek/monolog.git synced 2025-10-22 17:16:18 +02:00

Upgrade phpstan, phpunit (#1923)

* Upgrade phpstan, phpunit

* Fix phpunit deprecation

* Fix hg tests

* Fix php-console tests

* Fix phpunit on 8.1

* Bump phpconsole
This commit is contained in:
Jordi Boggiano
2024-11-11 15:21:55 +01:00
committed by GitHub
parent 7af6f41cff
commit f43e3d5637
43 changed files with 210 additions and 153 deletions

View File

@@ -68,7 +68,6 @@ class ErrorHandlerTest extends \PHPUnit\Framework\TestCase
{
$ref = new \ReflectionClass(\get_class($instance));
$prop = $ref->getProperty($property);
$prop->setAccessible(true);
return $prop->getValue($instance);
}
@@ -91,6 +90,7 @@ class ErrorHandlerTest extends \PHPUnit\Framework\TestCase
$this->assertEquals($expectedFatalLevel, $this->getPrivatePropertyValue($errHandler, 'fatalLevel'));
}
#[WithoutErrorHandler]
public function testHandleException()
{
$logger = new Logger('test', [$handler = new TestHandler]);
@@ -106,12 +106,14 @@ class ErrorHandlerTest extends \PHPUnit\Framework\TestCase
$errHandler->registerExceptionHandler([], true);
$prop = $this->getPrivatePropertyValue($errHandler, 'previousExceptionHandler');
$this->assertTrue(\is_callable($prop));
restore_exception_handler();
restore_exception_handler();
}
public function testCodeToString()
{
$method = new \ReflectionMethod(ErrorHandler::class, 'codeToString');
$method->setAccessible(true);
$this->assertEquals('E_ERROR', $method->invokeArgs(null, [E_ERROR]));
$this->assertEquals('E_WARNING', $method->invokeArgs(null, [E_WARNING]));