Completed
Pull Request — master (#28)
by
unknown
08:00
created

HTMLTextExtractorTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 3
Bugs 0 Features 1
Metric Value
c 3
b 0
f 1
dl 0
loc 13
wmc 1
lcom 0
cbo 3
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A testExtraction() 0 10 1
1
<?php
2
class HTMLTextExtractorTest extends SapphireTest
0 ignored issues
show
Coding Style Compatibility introduced by
PSR1 recommends that each class must be in a namespace of at least one level to avoid collisions.

You can fix this by adding a namespace to your class:

namespace YourVendor;

class YourClass { }

When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.

Loading history...
3
{
4
    public function testExtraction()
5
    {
6
        $extractor = new HTMLTextExtractor();
7
8
        $content = $extractor->getContent(Director::baseFolder() . '/textextraction/tests/fixtures/test1.html');
9
        $this->assertContains('Test Headline', $content);
10
        $this->assertNotContains('Test Comment', $content, 'Strips HTML comments');
11
        $this->assertNotContains('Test Style', $content, 'Strips non-content style tags');
12
        $this->assertNotContains('Test Script', $content, 'Strips non-content script tags');
13
    }
14
}
15