2012-08-22 18:23:06 +02:00
|
|
|
<?php
|
2015-11-18 05:07:31 +01:00
|
|
|
class PDFTextExtractorTest extends SapphireTest
|
|
|
|
{
|
|
|
|
public function testExtraction()
|
|
|
|
{
|
|
|
|
$extractor = new PDFTextExtractor();
|
|
|
|
if (!$extractor->isAvailable()) {
|
2016-02-25 04:28:36 +01:00
|
|
|
$this->setExpectedException(
|
|
|
|
'FileTextExtractor_Exception',
|
|
|
|
'getRawOutput called on unavailable extractor'
|
|
|
|
);
|
2015-11-18 05:07:31 +01:00
|
|
|
}
|
2012-08-22 18:23:06 +02:00
|
|
|
|
2015-11-18 05:07:31 +01:00
|
|
|
$content = $extractor->getContent(Director::baseFolder() . '/textextraction/tests/fixtures/test1.pdf');
|
|
|
|
$this->assertContains('This is a test file with a link', $content);
|
|
|
|
}
|
2015-02-18 03:31:38 +01:00
|
|
|
}
|