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

WarningParserTest::processProvider()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 12
Code Lines 9

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 12
rs 9.4285
cc 1
eloc 9
nc 1
nop 0
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