silverstripe-textextraction/tests/FileTextExtractableTest.php

23 lines
580 B
PHP
Raw Normal View History

2012-08-22 18:23:06 +02:00
<?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'
));
$file->write();
$content = $file->extractFileAsText();
$this->assertContains('Test Headline', $content);
$this->assertContains('Test Text', $content);
$this->assertEquals($content, $file->FileContentCache);
}
}