mirror of
https://github.com/silverstripe/silverstripe-textextraction
synced 2024-10-22 11:06:00 +02:00
2977f85cb5
API Implement support for detection via mime-type as well as file extension API Implement FileContent property for safe usage in templates API instead of returning the list of extensions / mime types supported, support is determined on a per-file bases Marking dev-master as version 2.0 as this contains breaking changes
13 lines
393 B
PHP
13 lines
393 B
PHP
<?php
|
|
class PDFTextExtractorTest extends SapphireTest {
|
|
|
|
function testExtraction() {
|
|
$extractor = new PDFTextExtractor();
|
|
if(!$extractor->isAvailable()) $this->markTestSkipped('pdftotext not available');
|
|
|
|
$content = $extractor->getContent(Director::baseFolder() . '/textextraction/tests/fixtures/test1.pdf');
|
|
$this->assertContains('This is a test file with a link', $content);
|
|
}
|
|
|
|
}
|