Test Failed
Pull Request — master (#30)
by Scott
02:49
created

PhpCsReflectionTest::testRelatedMethods()   B

Complexity

Conditions 2
Paths 3

Size

Total Lines 25
Code Lines 17

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 17
nc 3
nop 0
dl 0
loc 25
rs 8.8571
c 0
b 0
f 0
1
<?php
2
namespace exussum12\CoverageChecker\tests;
3
4
use Exception;
5
use PHPUnit\Framework\TestCase;
6
7
/**
8
 * Ignored due to acceptance test needing to write values
9
 * @SuppressWarnings(PHPMD.Superglobals)
10
 */
11
class PhpCsReflectionTest extends TestCase
12
{
13
    public function testRelatedMethods()
14
    {
15
        $GLOBALS['argv'] = [
16
            'diffFilter',
17
            '--phpcs',
18
            '--report=json',
19
            __DIR__ . '/fixtures/DocBlocks.txt',
20
            __DIR__ . '/fixtures/DocBlocks.json'
21
        ];
22
23
        try {
24
            ob_start();
25
            require(__DIR__ . "/../src/Runners/generic.php");
26
        } catch (Exception $exception) {
27
            $output = json_decode(ob_get_clean());
28
            $this->assertEquals(
29
                14,
30
                count($output->violations->{'DocBlocks.php'})
31
            );
32
33
            return true;
34
        }
35
36
        $this->fail('Exception not thrown when Expected');
37
    }
38
}
39