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:
@@ -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'];
|
||||
|
Reference in New Issue
Block a user