1
0
mirror of https://github.com/Seldaek/monolog.git synced 2025-08-21 04:11:47 +02:00

Fix phpunit deprecations

This commit is contained in:
Jordi Boggiano
2024-04-12 17:26:33 +02:00
parent 5b990255a3
commit b127292ee0
39 changed files with 220 additions and 302 deletions

View File

@@ -13,6 +13,7 @@ namespace Monolog\Handler;
use Monolog\Test\TestCase;
use Monolog\Level;
use PHPUnit\Framework\Attributes\DataProvider;
class ProcessHandlerTest extends TestCase
{
@@ -76,11 +77,10 @@ class ProcessHandlerTest extends TestCase
}
/**
* @dataProvider invalidCommandProvider
* @param mixed $invalidCommand
* @covers Monolog\Handler\ProcessHandler::guardAgainstInvalidCommand
*/
public function testConstructWithInvalidCommandThrowsInvalidArgumentException($invalidCommand, $expectedExcep)
#[DataProvider('invalidCommandProvider')]
public function testConstructWithInvalidCommandThrowsInvalidArgumentException(mixed $invalidCommand, string $expectedExcep)
{
$this->expectException($expectedExcep);
new ProcessHandler($invalidCommand, Level::Debug);
@@ -99,10 +99,10 @@ class ProcessHandlerTest extends TestCase
}
/**
* @dataProvider invalidCwdProvider
* @param mixed $invalidCwd
* @covers Monolog\Handler\ProcessHandler::guardAgainstInvalidCwd
*/
#[DataProvider('invalidCwdProvider')]
public function testConstructWithInvalidCwdThrowsInvalidArgumentException($invalidCwd, $expectedExcep)
{
$this->expectException($expectedExcep);
@@ -136,7 +136,7 @@ class ProcessHandlerTest extends TestCase
$handler->expects($this->once())
->method('selectErrorStream')
->will($this->returnValue(false));
->willReturn(false);
$this->expectException(\UnexpectedValueException::class);
/** @var ProcessHandler $handler */
@@ -170,7 +170,7 @@ class ProcessHandlerTest extends TestCase
$handler->expects($this->exactly(2))
->method('readProcessErrors')
->willReturnOnConsecutiveCalls('', $this->returnValue('some fake error message here'));
->willReturnOnConsecutiveCalls('', 'some fake error message here');
$this->expectException(\UnexpectedValueException::class);
/** @var ProcessHandler $handler */