Conditions | 2 |
Paths | 2 |
Total Lines | 17 |
Code Lines | 10 |
Lines | 17 |
Ratio | 100 % |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
26 | View Code Duplication | public function testServerExtraction() |
|
27 | { |
||
28 | $extractor = new TikaServerTextExtractor(); |
||
29 | if (!$extractor->isAvailable()) { |
||
30 | $this->markTestSkipped('tika server not available'); |
||
31 | } |
||
32 | |||
33 | // Check file |
||
34 | $file = Director::baseFolder() . '/textextraction/tests/fixtures/test1.pdf'; |
||
35 | $content = $extractor->getContent($file); |
||
36 | $this->assertContains('This is a test file with a link', $content); |
||
37 | |||
38 | // Check mime validation |
||
39 | $this->assertTrue($extractor->supportsMime('application/pdf')); |
||
40 | $this->assertTrue($extractor->supportsMime('text/html')); |
||
41 | $this->assertFalse($extractor->supportsMime('application/not-supported')); |
||
42 | } |
||
43 | } |
||
44 |
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.