Skip to content

Commit a9bd9b1

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 fb1fcb6 commit a9bd9b1

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

tests/Unit/Renderer/RendererHelperTest.php

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,6 @@ class RendererHelperTest extends TestCase
1717
{
1818
private InspectionConfig $config;
1919

20-
protected function setUp(): void
21-
{
22-
$this->config = new InspectionConfig('base-path', 80);
23-
}
24-
2520
public function testRenderReasonGlobalCoverageTooLow(): void
2621
{
2722
$metric = new FileMetric('foobar', 0, 80, [], []);
@@ -46,7 +41,10 @@ public function testRenderReasonCustomCoverageTooHigh(): void
4641
$failure = new Failure($metric, 70, Failure::CUSTOM_COVERAGE_TOO_HIGH, 5);
4742

4843
$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);
44+
static::assertSame(
45+
'Custom file coverage is configured at 70%. Current coverage is at 50%. Edit the phpfci baseline for this class.',
46+
$message
47+
);
5048
}
5149

5250
public function testRenderReasonMissingMethodCoverage(): void
@@ -79,4 +77,9 @@ public function testRenderReasonShouldThrowExceptionWhenInvalid(): void
7977
$this->expectException(RuntimeException::class);
8078
RendererHelper::renderReason($this->config, $failure);
8179
}
80+
81+
protected function setUp(): void
82+
{
83+
$this->config = new InspectionConfig('base-path', 80);
84+
}
8285
}

0 commit comments

Comments
 (0)