From 758c8dac6a05fccfbef3353fdd45d722f1789a33 Mon Sep 17 00:00:00 2001 From: fogelito Date: Thu, 23 Apr 2026 16:16:24 +0300 Subject: [PATCH] Client's test --- src/Client.php | 10 ++++++++++ tests/MongoTest.php | 4 ++++ 2 files changed, 14 insertions(+) diff --git a/src/Client.php b/src/Client.php index 748124960f..9d7884fa19 100644 --- a/src/Client.php +++ b/src/Client.php @@ -228,6 +228,16 @@ class Client return $this; } + /** + * Return client's host + * + * @return string + */ + public function getHost(): string + { + return $this->host; + } + /** * Create a UUID using UUID7 standard for MongoDB _id field. * diff --git a/tests/MongoTest.php b/tests/MongoTest.php index 2d4871647e..02d739ad2f 100644 --- a/tests/MongoTest.php +++ b/tests/MongoTest.php @@ -41,6 +41,10 @@ class MongoTest extends TestCase self::assertTrue($this->getDatabase()->dropDatabase()); } + public function testGetHost() + { + self::assertSame('mongo', $this->getDatabase()->getClusterTime()); + } /** * @throws Exception