/** * Tests if the same client is returned. */ public function testGetClient() { $client = $this->getMockBuilder('Elasticsearch\\Client')->disableOriginalConstructor()->getMock(); $client->expects($this->never())->method($this->anything()); $hash = spl_object_hash($client); $connection = new Connection($client, []); $this->assertEquals($hash, spl_object_hash($connection->getClient())); }