2012-08-22 18:23:06 +02:00
|
|
|
<?php
|
|
|
|
class HTMLTextExtractorTest extends SapphireTest {
|
|
|
|
|
|
|
|
function testExtraction() {
|
|
|
|
$extractor = new HTMLTextExtractor();
|
|
|
|
|
|
|
|
$content = $extractor->getContent(Director::baseFolder() . '/textextraction/tests/fixtures/test1.html');
|
|
|
|
$this->assertContains('Test Headline', $content);
|
2012-09-06 13:41:21 +02:00
|
|
|
$this->assertNotContains('Test Comment', $content, 'Strips HTML comments');
|
|
|
|
$this->assertNotContains('Test Style', $content, 'Strips non-content style tags');
|
|
|
|
$this->assertNotContains('Test Script', $content, 'Strips non-content script tags');
|
2012-08-22 18:23:06 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|