Skip to content

Commit

Permalink
test: Assert that 3 exceptions are thrown in invalid connection test
Browse files Browse the repository at this point in the history
  • Loading branch information
exaby73 committed Nov 29, 2024
1 parent 779c74b commit 43ca704
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions tests/Integration/ClientIntegrationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -279,21 +279,27 @@ public function testInvalidConnectionCheck(): void
->withDriver('http', 'http://localboast')
->build();

$exceptionThrownCount = 0;
try {
self::assertFalse($client->verifyConnectivity('bolt'));
$client->verifyConnectivity('bolt');
++$exceptionThrownCount;
} catch (Exception $e) {
self::assertInstanceOf(RuntimeException::class, $e);
}
try {
self::assertFalse($client->verifyConnectivity('neo4j'));
$client->verifyConnectivity('neo4j');
++$exceptionThrownCount;
} catch (Exception $e) {
self::assertInstanceOf(RuntimeException::class, $e);
}
try {
self::assertFalse($client->verifyConnectivity('http'));
$client->verifyConnectivity('http');
++$exceptionThrownCount;
} catch (Exception $e) {
self::assertInstanceOf(RuntimeException::class, $e);
}

self::assertEquals(3, $exceptionThrownCount);
}

public function testValidConnectionCheck(): void
Expand Down

0 comments on commit 43ca704

Please sign in to comment.