Skip to content

Commit 0eaf0bc

Browse files
authored
Merge pull request #43 from anne-gaelle123inkt/master
warning when custom coverage is above or equal to global coverage
2 parents 434e41b + 3d8167a commit 0eaf0bc

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/Lib/Metrics/Inspection/CustomCoverageAboveGlobalInspection.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public function inspect(?PathInspectionConfig $fileConfig, FileMetric $metric):
2424
$customCoverage = $fileConfig->getMinimumCoverage();
2525

2626
// custom coverage is lower than global coverage, and file is above global coverage
27-
if ($customCoverage < $globalCoverage && $metric->getCoverage() >= $globalCoverage) {
27+
if ($customCoverage <= $globalCoverage && $metric->getCoverage() >= $globalCoverage) {
2828
return new Failure($metric, $fileConfig->getMinimumCoverage(), Failure::UNNECESSARY_CUSTOM_COVERAGE);
2929
}
3030

tests/Unit/Lib/Config/ConfigFactoryTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ public function testCreateInspectConfigDuplicateOutputReport(): void
150150
touch($coveragePath);
151151

152152
$input = $this->createMock(InputInterface::class);
153-
$input->expects(self::exactly(5))->method('getOption')->willReturn($configPath, null, null, null);
153+
$input->expects(self::exactly(5))->method('getOption')->willReturn($configPath, null, null, null, null);
154154
$input->expects(self::once())->method('getArgument')->with('coverage')->willReturn([$coveragePath]);
155155

156156
$config = $this->factory->createInspectConfig($input);

0 commit comments

Comments
 (0)