Completed
Push — master ( 734345...f5668f )
by Hannes
04:51
created

ReadmeTestCase   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 5

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A assertReadme() 0 10 2
1
<?php
2
3
namespace hanneskod\readmetester\PHPUnit;
4
5
use hanneskod\readmetester\ReadmeTester;
6
use hanneskod\readmetester\FileInfo;
7
8
class ReadmeTestCase extends \PHPUnit_Framework_TestCase
9
{
10
    public function assertReadme($filename)
11
    {
12
        $tester = new ReadmeTester;
13
        $this->addToAssertionCount(1);
14
        $result = $this->getTestResultObject();
15
16
        foreach ($tester->test(new FileInfo($filename)) as $line) {
17
            $result->addFailure($this, new \PHPUnit_Framework_AssertionFailedError($line), 0.0);
18
        }
19
    }
20
}
21