Skip to content

Commit

Permalink
Fix scrutinizer violations
Browse files Browse the repository at this point in the history
  • Loading branch information
frankdekker committed Apr 2, 2021
1 parent e910232 commit aa6de32
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
11 changes: 4 additions & 7 deletions src/test/php/PHPMD/Renderer/BaselineRendererTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ public function testRenderReport()
);

$report = $this->getReportWithNoViolation();
$report->expects(static::once())
->method('getRuleViolations')
$report->method('getRuleViolations')
->willReturn(new ArrayIterator($violations));

$renderer = new BaselineRenderer('/src');
Expand All @@ -47,7 +46,7 @@ public function testRenderReportShouldWriteMethodName()
{
$writer = new WriterStub();
$violationMock = $this->getRuleViolationMock('/src/php/bar.php');
$violationMock->expects(static::once())->method('getMethodName')->willReturn('foo');
$violationMock->method('getMethodName')->willReturn('foo');

$report = $this->getReportWithNoViolation();
$report->expects(static::once())
Expand Down Expand Up @@ -77,8 +76,7 @@ public function testRenderReportShouldDeduplicateSimilarViolations()

// add the same violation twice
$report = $this->getReportWithNoViolation();
$report->expects(static::once())
->method('getRuleViolations')
$report->method('getRuleViolations')
->willReturn(new ArrayIterator(array($violationMock, $violationMock)));

$renderer = new BaselineRenderer('/src');
Expand All @@ -100,8 +98,7 @@ public function testRenderEmptyReport()
{
$writer = new WriterStub();
$report = $this->getReportWithNoViolation();
$report->expects(static::once())
->method('getRuleViolations')
$report->method('getRuleViolations')
->willReturn(new ArrayIterator(array()));

$renderer = new BaselineRenderer('/src');
Expand Down
4 changes: 2 additions & 2 deletions src/test/php/PHPMD/ReportTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -195,9 +195,9 @@ public function testGetErrorsReturnsPreviousAddedProcessingError()
*/
public function testReportShouldIgnoreBaselineViolation()
{
/** @var RuleViolation|PHPUnit_Framework_MockObject_MockObject $ruleA */
/** @var RuleViolation $ruleA */
$ruleA = $this->getRuleViolationMock('foo.txt');
/** @var RuleViolation|PHPUnit_Framework_MockObject_MockObject $ruleB */
/** @var RuleViolation $ruleB */
$ruleB = $this->getRuleViolationMock('bar.txt', 1, 2);

// setup baseline
Expand Down

0 comments on commit aa6de32

Please sign in to comment.