File tree Expand file tree Collapse file tree 1 file changed +5
-9
lines changed
tests/Elasticsearch/Tests Expand file tree Collapse file tree 1 file changed +5
-9
lines changed Original file line number Diff line number Diff line change 21
21
use Elasticsearch \Client ;
22
22
use Elasticsearch \ClientBuilder ;
23
23
use Elasticsearch \Common \Exceptions \ElasticsearchException ;
24
- use Elasticsearch \Common \ Exceptions \ InvalidArgumentException ;
24
+ use Elasticsearch \Tests \ ClientBuilder \ DummyLogger ;
25
25
use PHPUnit \Framework \TestCase ;
26
26
27
27
class ClientBuilderTest extends TestCase
28
28
{
29
29
30
30
public function testClientBuilderThrowsExceptionForIncorrectLoggerClass ()
31
31
{
32
- $ this ->expectException (InvalidArgumentException::class);
33
- $ this ->expectExceptionMessage ('$logger must implement \Psr\Log\LoggerInterface! ' );
34
-
35
- ClientBuilder::create ()->setLogger (new \Elasticsearch \Tests \ClientBuilder \DummyLogger ());
32
+ $ this ->expectException (\TypeError::class);
33
+ ClientBuilder::create ()->setLogger (new DummyLogger );
36
34
}
37
35
38
36
public function testClientBuilderThrowsExceptionForIncorrectTracerClass ()
39
37
{
40
- $ this ->expectException (InvalidArgumentException::class);
41
- $ this ->expectExceptionMessage ('$tracer must implement \Psr\Log\LoggerInterface! ' );
42
-
43
- ClientBuilder::create ()->setTracer (new \Elasticsearch \Tests \ClientBuilder \DummyLogger ());
38
+ $ this ->expectException (\TypeError::class);
39
+ ClientBuilder::create ()->setTracer (new DummyLogger );
44
40
}
45
41
46
42
public function testElasticClientMetaHeaderIsSentByDefault ()
You can’t perform that action at this time.
0 commit comments