Skip to content

Commit fb1fcb6

Browse files
F#78299 US#190650 T#207172 add the support of multi coverage file for the baseline command + raises an error when the custom coverage can be increased
1 parent e21d5d3 commit fb1fcb6

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

tests/Unit/Renderer/RendererHelperTest.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,15 @@ public function testRenderReasonCustomCoverageTooLow(): void
4040
static::assertSame('Custom file coverage is configured at 30%. Current coverage is at 70%. Improve coverage for this class.', $message);
4141
}
4242

43+
public function testRenderReasonCustomCoverageTooHigh(): void
44+
{
45+
$metric = new FileMetric('foobar', 0, 50, [], []);
46+
$failure = new Failure($metric, 70, Failure::CUSTOM_COVERAGE_TOO_HIGH, 5);
47+
48+
$message = RendererHelper::renderReason($this->config, $failure);
49+
static::assertSame('Custom file coverage is configured at 70%. Current coverage is at 50%. Edit the phpfci baseline for this class.', $message);
50+
}
51+
4352
public function testRenderReasonMissingMethodCoverage(): void
4453
{
4554
$metric = new FileMetric('foobar', 0, 70, [new MethodMetric('coveredMethod', 100, 80), new MethodMetric('uncoveredMethod', 105, 0)], []);

0 commit comments

Comments
 (0)