Conditions | 2 |
Paths | 2 |
Total Lines | 19 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
16 | public function testServerExtraction() |
||
17 | { |
||
18 | $extractor = TikaServerTextExtractor::create(); |
||
19 | if (!$extractor->isAvailable()) { |
||
20 | $this->markTestSkipped('tika server not available'); |
||
21 | } |
||
22 | |||
23 | // Check file |
||
24 | $file = new File(); |
||
25 | $file->setFromLocalFile(dirname(__FILE__) . '/fixtures/test1.pdf'); |
||
26 | $file->write(); |
||
27 | |||
28 | $content = $extractor->getContent($file); |
||
29 | $this->assertContains('This is a test file with a link', $content); |
||
30 | |||
31 | // Check mime validation |
||
32 | $this->assertTrue($extractor->supportsMime('application/pdf')); |
||
33 | $this->assertTrue($extractor->supportsMime('text/html')); |
||
34 | $this->assertFalse($extractor->supportsMime('application/not-supported')); |
||
35 | } |
||
37 |