Skip to content

Commit

Permalink
test: Fix invalid connection test
Browse files Browse the repository at this point in the history
  • Loading branch information
exaby73 committed Nov 25, 2024
1 parent dfb7eff commit a1dce41
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions tests/Integration/ClientIntegrationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

namespace Laudis\Neo4j\Tests\Integration;

use Exception;
use InvalidArgumentException;
use Laudis\Neo4j\Authentication\Authenticate;
use Laudis\Neo4j\Basic\Driver;
Expand Down Expand Up @@ -46,7 +47,7 @@ public function testDriverAuthFailureVerifyConnectivity(): void
}

if (!is_string($connection)) {
$connection = 'bolt://localhost';
$connection = 'bolt://neo4j';
}

$uri = Uri::create($connection);
Expand Down Expand Up @@ -286,9 +287,21 @@ public function testInvalidConnectionCheck(): void
->withDriver('http', 'http://localboast')
->build();

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

public function testValidConnectionCheck(): void
Expand Down

0 comments on commit a1dce41

Please sign in to comment.