1
0
mirror of https://github.com/Seldaek/monolog.git synced 2025-08-11 15:44:34 +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

@@ -19,10 +19,13 @@ use Elasticsearch\Client;
use Elastic\Elasticsearch\Client as Client8;
use Elasticsearch\ClientBuilder;
use Elastic\Elasticsearch\ClientBuilder as ClientBuilder8;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\DataProvider;
/**
* @group Elasticsearch
*/
#[CoversClass(ElasticsearchHandler::class)]
class ElasticsearchHandlerTest extends TestCase
{
protected Client|Client8 $client;
@@ -57,9 +60,6 @@ class ElasticsearchHandlerTest extends TestCase
unset($this->client);
}
/**
* @covers Monolog\Handler\ElasticsearchHandler::setFormatter
*/
public function testSetFormatter()
{
$handler = new ElasticsearchHandler($this->client);
@@ -70,9 +70,6 @@ class ElasticsearchHandlerTest extends TestCase
$this->assertEquals('type_new', $handler->getFormatter()->getType());
}
/**
* @covers Monolog\Handler\ElasticsearchHandler::setFormatter
*/
public function testSetFormatterInvalid()
{
$handler = new ElasticsearchHandler($this->client);
@@ -84,10 +81,6 @@ class ElasticsearchHandlerTest extends TestCase
$handler->setFormatter($formatter);
}
/**
* @covers Monolog\Handler\ElasticsearchHandler::__construct
* @covers Monolog\Handler\ElasticsearchHandler::getOptions
*/
public function testOptions()
{
$expected = [
@@ -105,10 +98,7 @@ class ElasticsearchHandlerTest extends TestCase
$this->assertEquals($expected, $handler->getOptions());
}
/**
* @covers Monolog\Handler\ElasticsearchHandler::bulkSend
* @dataProvider providerTestConnectionErrors
*/
#[DataProvider('providerTestConnectionErrors')]
public function testConnectionErrors($ignore, $expectedError)
{
$hosts = ['http://127.0.0.1:1'];