PhpcsDiffFilterTest   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 19
dl 0
loc 29
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A testValid() 0 12 1
A testStrictMode() 0 12 1
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