Skip to content

Commit 49f2346

Browse files
author
Deploy
committed
test: added connect test
1 parent b8a8855 commit 49f2346

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

tests/ArangoClientTest.php

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,33 @@
268268
$this->schemaManager->deleteCollection($collection);
269269
});
270270

271+
272+
test('connect', function () {
273+
$oldHttpClient = $this->arangoClient->getHttpClient();
274+
$oldHttpClientObjectId = spl_object_id($oldHttpClient);
275+
276+
$newConfig = [
277+
'endpoint' => 'http://localhost:8529',
278+
'version' => 2,
279+
'connection' => 'Close',
280+
'username' => 'root',
281+
'password' => null,
282+
'database' => $this->testDatabaseName,
283+
'jsonStreamDecoderThreshold' => 1048576,
284+
];
285+
286+
$this->arangoClient->connect($newConfig);
287+
288+
$newHttpClient = $this->arangoClient->getHttpClient();
289+
$newHttpClientObjectId = spl_object_id($newHttpClient);
290+
291+
expect($oldHttpClientObjectId)->not()->toBe($newHttpClientObjectId);
292+
293+
$this->arangoClient->setHttpClient($oldHttpClient);
294+
});
295+
296+
297+
271298
test('disconnect', function () {
272299
$disconnected = $this->arangoClient->disconnect();
273300

0 commit comments

Comments
 (0)