Passed
Pull Request — master (#73)
by Dave
02:16
created

expectParseAtLocationExceptionForResult()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 3
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 5
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace DaveLiddament\StaticAnalysisResultsBaseliner\Tests\Unit\Plugins\ResultsParsers;
6
7
use DaveLiddament\StaticAnalysisResultsBaseliner\Domain\Utils\ParseAtLocationException;
8
9
trait ExpectParseExceptionWithResultTrait
10
{
11
    private function expectParseAtLocationExceptionForResult(int $resultWithIssue): void
12
    {
13
        $this->expectException(ParseAtLocationException::class);
0 ignored issues
show
Bug introduced by
It seems like expectException() must be provided by classes using this trait. How about adding it as abstract method to this trait? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

13
        $this->/** @scrutinizer ignore-call */ 
14
               expectException(ParseAtLocationException::class);
Loading history...
14
        $messageContainsRegEx = "/^Issue with result \[$resultWithIssue\]/";
15
        $this->expectExceptionMessageMatches($messageContainsRegEx);
0 ignored issues
show
Bug introduced by
It seems like expectExceptionMessageMatches() must be provided by classes using this trait. How about adding it as abstract method to this trait? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

15
        $this->/** @scrutinizer ignore-call */ 
16
               expectExceptionMessageMatches($messageContainsRegEx);
Loading history...
16
    }
17
}
18