Ejemplo n.º 1
0
 public function testGetJson()
 {
     $sampleFile1 = test_files_path() . 'sample1.html';
     $json = trim(TikaWrapper::getJson($sampleFile1));
     $jsonLines = preg_split('/\\n/', $json);
     $this->assertEquals('{ "Content-Encoding":"ISO-8859-1",', trim($jsonLines[0]));
     $this->assertEquals('"Content-Length":119,', trim($jsonLines[1]));
     $this->assertEquals('"Content-Type":"text/plain; charset\\u003dISO-8859-1",', trim($jsonLines[2]));
     $this->assertEquals('"dc:title":"Some title",', trim($jsonLines[3]));
     $this->assertEquals('"resourceName":"sample1.txt",', trim($jsonLines[4]));
     $this->assertEquals('"title":"Some title" }', trim($jsonLines[5]));
 }