mirror of
https://github.com/silverstripe/silverstripe-textextraction
synced 2024-10-22 11:06:00 +02:00
23 lines
726 B
PHP
23 lines
726 B
PHP
<?php
|
|
|
|
namespace SilverStripe\TextExtraction\Tests;
|
|
|
|
use SilverStripe\Dev\SapphireTest;
|
|
use SilverStripe\TextExtraction\Extractor\FileTextExtractor\Exception;
|
|
use SilverStripe\TextExtraction\Extractor\PDFTextExtractor;
|
|
|
|
class PDFTextExtractorTest extends SapphireTest
|
|
{
|
|
public function testExtraction()
|
|
{
|
|
$extractor = new PDFTextExtractor();
|
|
if (!$extractor->isAvailable()) {
|
|
$this->expectException(Exception::class);
|
|
$this->expectExceptionMessage('getRawOutput called on unavailable extractor');
|
|
}
|
|
|
|
$content = $extractor->getContent(dirname(__FILE__) . '/fixtures/test1.pdf');
|
|
$this->assertContains('This is a test file with a link', $content);
|
|
}
|
|
}
|