PhpcsDiffFilterTest::testStrictMode()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 12
Code Lines 9

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 9
nc 1
nop 0
dl 0
loc 12
rs 9.9666
c 0
b 0
f 0
1
<?php
2
namespace exussum12\CoverageChecker\tests;
3
4
use PHPUnit\Framework\TestCase;
5
6
/**
7
 * Ignored due to acceptance test needing to write values
8
 * @SuppressWarnings(PHPMD.Superglobals)
9
 */
10
class PhpcsDiffFilterTest extends TestCase
11
{
12
13
    public function testValid()
14
    {
15
        $GLOBALS['argv'] = [
16
            'diffFilter',
17
            '--phpcs',
18
            __DIR__ . '/fixtures/change.txt',
19
            __DIR__ . '/fixtures/phpcs.json'
20
        ];
21
        ob_start();
22
        require(__DIR__ . "/../src/Runners/generic.php");
23
        $output = ob_get_clean();
24
        $this->assertContains('100.00%', $output);
25
    }
26
27
    public function testStrictMode()
28
    {
29
        $GLOBALS['argv'] = [
30
            'diffFilter',
31
            '--phpcs',
32
            __DIR__ . '/fixtures/change.txt',
33
            __DIR__ . '/fixtures/phpcsstrict.json'
34
        ];
35
        ob_start();
36
        require(__DIR__ . "/../src/Runners/generic.php");
37
        $output = ob_get_clean();
38
        $this->assertContains('100.00%', $output);
39
    }
40
}
41