From 43ca70440aa673088bacf5cfa2aef253e0dd148b Mon Sep 17 00:00:00 2001 From: exaby73 Date: Fri, 29 Nov 2024 13:27:28 +0530 Subject: [PATCH] test: Assert that 3 exceptions are thrown in invalid connection test --- tests/Integration/ClientIntegrationTest.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/tests/Integration/ClientIntegrationTest.php b/tests/Integration/ClientIntegrationTest.php index 52d10f76..8bc03832 100644 --- a/tests/Integration/ClientIntegrationTest.php +++ b/tests/Integration/ClientIntegrationTest.php @@ -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