From 758c8dac6a05fccfbef3353fdd45d722f1789a33 Mon Sep 17 00:00:00 2001 From: fogelito Date: Thu, 23 Apr 2026 16:16:24 +0300 Subject: [PATCH 1/2] 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 7481249..9d7884f 100644 --- a/src/Client.php +++ b/src/Client.php @@ -228,6 +228,16 @@ public function connect(): self 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 2d48716..02d739a 100644 --- a/tests/MongoTest.php +++ b/tests/MongoTest.php @@ -41,6 +41,10 @@ public function testDeleteDatabase() self::assertTrue($this->getDatabase()->dropDatabase()); } + public function testGetHost() + { + self::assertSame('mongo', $this->getDatabase()->getClusterTime()); + } /** * @throws Exception From f2ef70c72c7537ac9b40dea2da2f5a40e48a1d81 Mon Sep 17 00:00:00 2001 From: fogelito Date: Thu, 23 Apr 2026 16:18:18 +0300 Subject: [PATCH 2/2] assert getHost --- tests/MongoTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/MongoTest.php b/tests/MongoTest.php index 02d739a..afc073c 100644 --- a/tests/MongoTest.php +++ b/tests/MongoTest.php @@ -43,7 +43,7 @@ public function testDeleteDatabase() public function testGetHost() { - self::assertSame('mongo', $this->getDatabase()->getClusterTime()); + self::assertSame('mongo', $this->getDatabase()->getHost()); } /**