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