Skip to content

Commit

Permalink
Fixed client creation tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Radiergummi committed May 14, 2024
1 parent 2edb310 commit a9eb07e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 24 deletions.
21 changes: 0 additions & 21 deletions tests/ConnectionManagerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,27 +102,6 @@ public function testCreatesConnectionsWithCacheInstance(): void
self::assertSame($cache, $connection->getCache());
}

public function testCreatesConnectionsWithLoggerInstance(): void
{
/** @var LoggerInterface&Mock $logger */
$logger = $this->mock(LoggerInterface::class);
$clientFactory = new ClientFactory($logger);
$instance = new ConnectionManager(
[
'connections' => [
'foo' => [
'servers' => [
'0.0.0.0',
],
],
],
],
$clientFactory,
null,
);
$instance->connection('foo');
}

/**
* @throws ExpectationFailedException
* @throws InvalidArgumentException
Expand Down
8 changes: 5 additions & 3 deletions tests/Factories/ClientFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,15 @@ public function testCreateClient(): void

public function testCreateClientWithHosts(): void
{
$hosts = ['foo', 'bar', 'baz'];
$config = [
'hosts' => ['foo', 'bar', 'baz']
];
$factory = new ClientFactory();
$client = $factory->createClient($hosts);
$client = $factory->createClient($config);

self::assertContains(
$client->transport->getConnection()->getHost(),
$hosts
$config['hosts']
);
}
}

0 comments on commit a9eb07e

Please sign in to comment.