public function ClientManagerTest::testGetClientForCluster in Elasticsearch Connector 8.6
Same name and namespace in other branches
- 8.7 tests/src/Unit/ElasticSearch/ClientManagerTest.php \Drupal\Tests\elasticsearch_connector\Unit\ElasticSearch\ClientManagerTest::testGetClientForCluster()
- 8.5 tests/src/Unit/ElasticSearch/ClientManagerTest.php \Drupal\Tests\elasticsearch_connector\Unit\ElasticSearch\ClientManagerTest::testGetClientForCluster()
@covers ::getClientForCluster
File
- tests/
src/ Unit/ ElasticSearch/ ClientManagerTest.php, line 51
Class
- ClientManagerTest
- @coversDefaultClass \Drupal\elasticsearch_connector\ElasticSearch\ClientManager
Namespace
Drupal\Tests\elasticsearch_connector\Unit\ElasticSearchCode
public function testGetClientForCluster() {
$cluster = $this
->prophesize(Cluster::class);
$cluster
->getRawUrl()
->willReturn('http://example.com');
$cluster = $cluster
->reveal();
$cluster->options['use_authentication'] = TRUE;
$cluster->options['username'] = 'Tom';
$cluster->options['password'] = 'Waits';
$cluster->options['authentication_type'] = 'basic_auth';
$client = $this->clientManager
->getClientForCluster($cluster);
$this
->assertInstanceOf(ClientInterface::class, $client);
}