/** * Create shared instances of clients */ public static function setUpBeforeClass() { $jars = getenv('APACHE_TIKA_JARS'); foreach (self::$versions as $version) { self::$clients[$version] = Client::make("{$jars}/tika-app-{$version}.jar"); } }
/** * Setters and getters test * * @dataProvider versionProvider */ public function testSettersGetters($version) { static $port = 9998; $client = Client::make('localhost', $port++); $client->setHost('127.0.0.1'); $client->setPort(9997); $client->setOptions([CURLOPT_TIMEOUT => 10]); $this->assertEquals('127.0.0.1', $client->getHost()); $this->assertEquals(9997, $client->getPort()); $this->assertEquals(10, $client->getOptions()[CURLOPT_TIMEOUT]); }
/** * Version test */ public function testVersion() { $version = self::$client->getVersion(); $this->assertEquals('Apache Tika 1.11', $version); }
/** * Create shared instance of client */ public static function setUpBeforeClass() { $travis = '/home/travis/tika/tika-app.jar'; $develop = dirname(__DIR__) . '/bin/tika-app-1.11.jar'; self::$client = Client::make(file_exists($travis) ? $travis : $develop); }
/** * Create shared instance of client */ public static function setUpBeforeClass() { self::$client = Client::make('localhost'); }
/** * Client parameters provider * * @return array */ public function parameterProvider() { $parameters = []; $port = 9998; foreach (Client::getSupportedVersions() as $version) { $parameters[] = [[getenv('APACHE_TIKA_JARS') . '/tika-app-' . $version . '.jar']]; $parameters[] = [['localhost', $port++]]; } return $parameters; }
/** * Get the list of versions to test against * * @param null|string $name * @param array $data * @param string $dataName */ public function __construct($name = null, array $data = [], $dataName = '') { parent::__construct($name, $data, $dataName); self::$versions = array_reverse(Client::getSupportedVersions()); }