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
 /**
  * Test unsupported media type
  */
 public function testUnsupportedMedia()
 {
     try {
         $client = Client::make('localhost', 9998);
         $client->getText(dirname(__DIR__) . '/samples/sample4.doc');
         $this->fail();
     } catch (Exception $exception) {
         $this->assertEquals(415, $exception->getCode());
     }
 }
Esempio n. 3
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. 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');
 }