getConnection() public method

public getConnection ( ) : Connection
return Connection
コード例 #1
0
 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());
 }
コード例 #2
0
ファイル: ClientTest.php プロジェクト: theDisco/Elastica
 /**
  * @group unit
  */
 public function testPassBigIntSettingsToConnectionConfig()
 {
     $client = new Client(['bigintConversion' => true]);
     $this->assertTrue($client->getConnection()->getConfig('bigintConversion'));
 }
コード例 #3
0
 public function testWithoutProxy()
 {
     $client = new \Elastica\Client(array('transport' => 'Guzzle'));
     $client->getConnection()->setProxy('');
     $transferInfo = $client->request('/_nodes')->getTransferInfo();
     $this->assertEquals(200, $transferInfo['http_code']);
 }
コード例 #4
0
 public function testConnectionParamsArePreparedForDefaultOptions()
 {
     $client = new Client(array('url' => 'https://localhost:9200'));
     $connection = $client->getConnection();
     $this->assertEquals('https://localhost:9200', $connection->getConfig('url'));
 }