AssertResultMatch   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
dl 0
loc 13
rs 10
c 1
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A assertMatch() 0 11 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace DaveLiddament\StaticAnalysisResultsBaseliner\Tests\Helpers;
6
7
use DaveLiddament\StaticAnalysisResultsBaseliner\Domain\Common\Severity;
8
use DaveLiddament\StaticAnalysisResultsBaseliner\Domain\ResultsParser\AnalysisResult;
9
use PHPUnit\Framework\Assert;
10
11
trait AssertResultMatch
12
{
13
    private function assertMatch(
14
        AnalysisResult $analysisResult,
15
        string $fileName,
16
        int $lineNumber,
17
        string $type,
18
        Severity $severity,
19
    ): void {
20
        Assert::assertSame($fileName, $analysisResult->getLocation()->getRelativeFileName()->getFileName());
21
        Assert::assertSame($lineNumber, $analysisResult->getLocation()->getLineNumber()->getLineNumber());
22
        Assert::assertSame($type, $analysisResult->getType()->getType());
23
        Assert::assertSame($severity->getSeverity(), $analysisResult->getSeverity()->getSeverity());
24
    }
25
}
26