1<?php
2
3declare(strict_types = 1);
4
5namespace Elasticsearch\Tests\ConnectionPool;
6
7use Elasticsearch\ClientBuilder;
8use Elasticsearch\ConnectionPool\SniffingConnectionPool;
9
10/**
11 * Class SniffingConnectionPoolIntegrationTest
12 *
13 * @category   Tests
14 * @package    Elasticsearch
15 * @subpackage Tests/SniffingConnectionPoolTest
16 * @author     Zachary Tong <zachary.tong@elasticsearch.com>
17 * @license    http://www.apache.org/licenses/LICENSE-2.0 Apache2
18 * @link       http://elasticsearch.org
19 */
20class SniffingConnectionPoolIntegrationTest extends \PHPUnit\Framework\TestCase
21{
22    protected function setUp()
23    {
24        static::markTestSkipped("All of Sniffing unit tests use outdated cluster state format, need to redo");
25    }
26
27    public function testSniff()
28    {
29        $client = ClientBuilder::create()
30            ->setHosts([getenv('ES_TEST_HOST')])
31            ->setConnectionPool(SniffingConnectionPool::class, ['sniffingInterval' => -10])
32            ->build();
33
34        $pinged = $client->ping();
35        $this->assertTrue($pinged);
36    }
37}
38