Skip to content

Commit

Permalink
test: Refactor tests
Browse files Browse the repository at this point in the history
  • Loading branch information
exaby73 committed Nov 28, 2024
1 parent a1dce41 commit 2a85094
Showing 1 changed file with 4 additions and 16 deletions.
20 changes: 4 additions & 16 deletions tests/Integration/ClientIntegrationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,11 @@ final class ClientIntegrationTest extends EnvironmentAwareIntegrationTest
{
public function testDriverAuthFailureVerifyConnectivity(): void
{
$connection = $_ENV['CONNECTION'] ?? false;
if (str_starts_with((string) $connection, 'http')) {
if (str_starts_with($this->uri->getScheme(), 'http')) {
$this->markTestSkipped('HTTP does not support auth failure connectivity passing');
}

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

$uri = Uri::create($connection);
$uri = $uri->withUserInfo('neo4j', 'absolutelyonehundredpercentawrongpassword');
$uri = $this->uri->withUserInfo('neo4j', 'absolutelyonehundredpercentawrongpassword');

/** @noinspection PhpUnhandledExceptionInspection */
$conf = DriverConfiguration::default()->withLogger(LogLevel::DEBUG, $this->createMock(LoggerInterface::class));
Expand All @@ -71,17 +65,11 @@ public function testDriverAuthFailureVerifyConnectivity(): void

public function testClientAuthFailureVerifyConnectivity(): void
{
$connection = $_ENV['CONNECTION'] ?? false;
if (str_starts_with((string) $connection, 'http')) {
if (str_starts_with($this->uri->getScheme(), 'http')) {
$this->markTestSkipped('HTTP does not support auth failure connectivity passing');
}

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

$uri = Uri::create($connection);
$uri = $uri->withUserInfo('neo4j', 'absolutelyonehundredpercentawrongpassword');
$uri = $this->uri->withUserInfo('neo4j', 'absolutelyonehundredpercentawrongpassword');

/** @noinspection PhpUnhandledExceptionInspection */
$conf = DriverConfiguration::default()->withLogger(LogLevel::DEBUG, $this->createMock(LoggerInterface::class));
Expand Down

0 comments on commit 2a85094

Please sign in to comment.