Completed
Push — master ( 6a83c2...6c3c1b )
by Alessandro
04:16
created

WarningParserTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A testParseAndContinue() 0 8 1
A processProvider() 0 12 1
1
<?php
2
3
namespace Paraunit\Tests\Unit;
4
5
use Paraunit\Parser\WarningParser;
6
use Paraunit\Tests\Stub\StubbedParaProcess;
7
use Paraunit\Tests\StubbedPHPUnitBaseTestCase;
8
9
class WarningParserTest extends StubbedPHPUnitBaseTestCase
10
{
11
    /**
12
     * @dataProvider processProvider
13
     */
14
    public function testParseAndContinue(StubbedParaProcess $process, $expectedWarningCount)
15
    {
16
        $parser = new WarningParser();
17
18
        $this->assertTrue($parser->parseAndContinue($process));
19
20
        $this->assertCount($expectedWarningCount, $process->getWarnings());
21
    }
22
23
    public function processProvider()
24
    {
25
        return array(
26
            array($this->getTestWithSingleWarning(), 1),
27
            array($this->getTestWithSingleError(), 0),
28
            array($this->getTestWithParserRegression(), 0),
29
            array($this->getTestWith2Errors2Failures(), 0),
30
            array($this->getTestWithAllGreen(), 0),
31
            array($this->getTestWithAllGreen5(), 0),
32
            array($this->getTestWithFatalError(), 0),
33
        );
34
    }
35
}
36