Skip to content

Commit 0ee6eb3

Browse files
committed
Add a missing test for Server::getClient
1 parent 0958a49 commit 0ee6eb3

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

tests/PHPCouchDB/ServerTest.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,4 +118,15 @@ public function testUseADbWithCreateThatDoesNotExist() {
118118
$server = new \PHPCouchDB\Server(["client" => $client]);
119119
$this->assertInstanceOf("\PHPCouchDB\Database", $server->useDb(["name" => "egdb", "create_if_not_exists" => true]));
120120
}
121+
122+
public function testGetClient() {
123+
$mock = new MockHandler([ $this->db_response ]);
124+
125+
$handler = HandlerStack::create($mock);
126+
$client = new Client(['handler' => $handler]);
127+
128+
// userland code starts
129+
$server = new \PHPCouchDB\Server(["client" => $client]);
130+
$this->assertInstanceOf("\GuzzleHttp\ClientInterface", $server->getClient());
131+
}
121132
}

0 commit comments

Comments
 (0)