mirror of
https://github.com/silverstripe/silverstripe-textextraction
synced 2024-10-22 11:06:00 +02:00
23 lines
658 B
PHP
23 lines
658 B
PHP
<?php
|
|
class FileTextExtractableTest extends SapphireTest {
|
|
|
|
protected $requiredExtensions = array(
|
|
'File' => array('FileTextExtractable')
|
|
);
|
|
|
|
function testExtractFileAsText() {
|
|
// Use HTML, since the extractor is always available
|
|
$file = new File(array(
|
|
'Name' => 'test1.html',
|
|
'Filename' => 'textextraction/tests/fixtures/test1.html'
|
|
));
|
|
// Don't write file, since it'd rename the file and make it inaccessible for subsequent tests
|
|
|
|
$content = $file->extractFileAsText();
|
|
$this->assertContains('Test Headline', $content);
|
|
$this->assertContains('Test Text', $content);
|
|
$this->assertEquals($content, $file->FileContentCache);
|
|
}
|
|
|
|
|
|
} |