public function testFixEmbedded() { $doc = new TikaWrapper($this->resource, $this->client); $html = '<img src="embedded:image1.png">'; $fixed = $doc->fixEmbedded($html); $this->assertEquals('<img src="image1.png">', $fixed); }
public function testGetDocumentType() { $sampleFile1 = test_files_path() . 'sample1.pdf'; $sampleFile2 = test_files_path() . 'sample1.html'; $sampleFile3 = test_files_path() . 'sample1.txt'; $sampleFile4 = test_files_path() . 'test.odt'; $docType1 = trim(TikaWrapper::getDocumentType($sampleFile1)); $docType2 = trim(TikaWrapper::getDocumentType($sampleFile2)); $docType3 = trim(TikaWrapper::getDocumentType($sampleFile3)); $docType4 = trim(TikaWrapper::getDocumentType($sampleFile4)); $this->assertEquals('application/pdf', $docType1); $this->assertEquals('application/xhtml+xml', $docType2); $this->assertEquals('text/plain', $docType3); $this->assertEquals('application/vnd.oasis.opendocument.text', $docType4); }