1<?php
2// (c) Copyright by authors of the Tiki Wiki CMS Groupware Project
3//
4// All Rights Reserved. See copyright.txt for details and a complete list of authors.
5// Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details.
6// $Id$
7
8class Search_Elastic_PaginationTest extends Search_Index_PaginationTest
9{
10	function setUp()
11	{
12		static $count = 0;
13
14		$elasticSearchHost = empty(getenv('ELASTICSEARCH_HOST')) ? 'localhost' : getenv('ELASTICSEARCH_HOST');
15		$connection = new Search_Elastic_Connection('http://' . $elasticSearchHost . ':9200');
16		$connection->startBulk(100);
17
18		$status = $connection->getStatus();
19		if (! $status->ok) {
20			$this->markTestSkipped('Elasticsearch needs to be available on ' . $elasticSearchHost . ':9200 for the test to run.');
21		}
22
23		$this->index = new Search_Elastic_Index($connection, 'test_index');
24		$this->index->destroy();
25	}
26
27	function tearDown()
28	{
29		if ($this->index) {
30			$this->index->destroy();
31		}
32	}
33}
34