Completed
Push — master ( 05c065...78bb8c )
by Dave
13s queued 11s
created

ExpectParseExceptionWithResultTrait   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 7
Duplicated Lines 0 %

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A expectParseAtLocationExceptionForResult() 0 5 1
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