public function testConstruct() { $host = 'localhost'; $port = 9500; $client = new Client(array('host' => $host, 'port' => $port, 'transport' => 'Thrift')); $this->assertEquals($host, $client->getConnection()->getHost()); $this->assertEquals($port, $client->getConnection()->getPort()); }
/** * @group unit */ public function testPassBigIntSettingsToConnectionConfig() { $client = new Client(['bigintConversion' => true]); $this->assertTrue($client->getConnection()->getConfig('bigintConversion')); }
public function testWithoutProxy() { $client = new \Elastica\Client(array('transport' => 'Guzzle')); $client->getConnection()->setProxy(''); $transferInfo = $client->request('/_nodes')->getTransferInfo(); $this->assertEquals(200, $transferInfo['http_code']); }
public function testConnectionParamsArePreparedForDefaultOptions() { $client = new Client(array('url' => 'https://localhost:9200')); $connection = $client->getConnection(); $this->assertEquals('https://localhost:9200', $connection->getConfig('url')); }