PHPUnitTest   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 9
dl 0
loc 20
rs 10
c 0
b 0
f 0
wmc 3

2 Methods

Rating   Name   Duplication   Size   Complexity  
A testPHPUnitError() 0 6 1
A testValid() 0 10 2
1
<?php
2
3
/**
4
 * This file is part of CaptainHook
5
 *
6
 * (c) Sebastian Feldmann <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace CaptainHook\App\Hook\PHP\CoverageResolver;
13
14
use Exception;
15
use PHPUnit\Framework\TestCase;
16
17
class PHPUnitTest extends TestCase
18
{
19
    public function testValid(): void
20
    {
21
        if (defined('PHP_WINDOWS_VERSION_MAJOR')) {
22
            $this->markTestSkipped('not tested on windows');
23
        }
24
25
        $resolver = new PHPUnit(CH_PATH_FILES . '/bin/phpunit');
26
        $coverage = $resolver->getCoverage();
27
28
        $this->assertEquals(95, $coverage);
29
    }
30
31
    public function testPHPUnitError(): void
32
    {
33
        $this->expectException(Exception::class);
34
35
        $resolver = new PHPUnit(CH_PATH_FILES . '/bin/failure');
36
        $resolver->getCoverage();
37
    }
38
}
39