Skip to content

Commit 32a7f3e

Browse files
An extra test
1 parent 7757d1e commit 32a7f3e

File tree

2 files changed

+23
-1
lines changed

2 files changed

+23
-1
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ return [
9393
This example will enforce:
9494

9595
- A minimum total coverage of *20%*
96-
- A minimum coverage of *80%* for all classes in namespace `RobinIngelbrecht\PHPUnitCoverageTools`, but will `exit = 1` if it fails
96+
- A minimum coverage of *80%* for all classes in namespace `RobinIngelbrecht\PHPUnitCoverageTools`, but will NOT `exit = 1` if it fails
9797
- *100%* code coverage for the class `ApplicationFinishedSubscriber`
9898
- *100%* code coverage for the classes ending with `CommandHandler`
9999

tests/Subscriber/Application/ApplicationFinishedSubscriberTest.php

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -381,6 +381,28 @@ public function testFromConfigurationAndParameters(): void
381381
);
382382
}
383383

384+
public function testFromConfigurationAndParameters2(): void
385+
{
386+
$this->assertEquals(
387+
new ApplicationFinishedSubscriber(
388+
relativePathToCloverXml: 'tests/clover.xml',
389+
minCoverageRules: MinCoverageRules::fromInt(90, true),
390+
cleanUpCloverXml: true,
391+
exitter: new Exitter(),
392+
consoleOutput: new ConsoleOutput(new \Symfony\Component\Console\Output\ConsoleOutput()),
393+
),
394+
ApplicationFinishedSubscriber::fromConfigurationAndParameters(
395+
(new Builder())->build([
396+
'--coverage-clover=tests/clover.xml',
397+
]),
398+
ParameterCollection::fromArray([
399+
'exitOnLowCoverage' => '1',
400+
]),
401+
['--min-coverage=90', '--clean-up-clover-xml']
402+
),
403+
);
404+
}
405+
384406
public function testFromConfigurationAndParametersFromFile(): void
385407
{
386408
$this->assertEquals(

0 commit comments

Comments
 (0)