Skip to content

Commit 3d805f4

Browse files
author
Илья
committed
Update test
1 parent 29ee0e2 commit 3d805f4

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

tests/LoggerCheckTest.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace YdbPlatform\Ydb\Test;
44

55
use PHPUnit\Framework\TestCase;
6+
use YdbPlatform\Ydb\Auth\Implement\AnonymousAuthentication;
67
use YdbPlatform\Ydb\Logger\NullLogger;
78
use YdbPlatform\Ydb\Logger\SimpleStdLogger;
89
use YdbPlatform\Ydb\Ydb;
@@ -35,4 +36,13 @@ public function testCheckUseNullLogger(){
3536
$ydb = new Ydb($config);
3637
$this->assertInstanceOf(NullLogger::class, $ydb->getLogger());
3738
}
39+
40+
public function testThrowExceptionOnNonLoggerObject(){
41+
$config = [
42+
'logger' => new AnonymousAuthentication()
43+
];
44+
$this->expectException('TypeError');
45+
$ydb = new Ydb($config);
46+
$this->assertInstanceOf(NullLogger::class, $ydb->getLogger());
47+
}
3848
}

0 commit comments

Comments
 (0)