Esempio n. 1
0
 /**
  * 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");
     }
 }
Esempio n. 2
0
 /**
  * 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]);
 }
Esempio n. 3
0
 /**
  * Version test
  */
 public function testVersion()
 {
     $version = self::$client->getVersion();
     $this->assertEquals('Apache Tika 1.11', $version);
 }
Esempio n. 4
0
 /**
  * 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);
 }
Esempio n. 5
0
 /**
  * Create shared instance of client
  */
 public static function setUpBeforeClass()
 {
     self::$client = Client::make('localhost');
 }
Esempio n. 6
0
 /**
  * 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;
 }
Esempio n. 7
0
 /**
  * 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());
 }