Skip to content

Commit e21d5d3

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 268da1a commit e21d5d3

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

src/Command/BaselineCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ protected function configure(): void
2828
$this->setName("baseline")
2929
->setDescription("Generate phpfci.xml based on a given coverage.xml")
3030
->addArgument('coverage', InputArgument::REQUIRED | InputArgument::IS_ARRAY, 'Path to phpunit\'s coverage.xml')
31-
->addOption('config', 'c', InputOption::VALUE_REQUIRED, 'Path to write the configuration file')
31+
->addOption('config', '', InputOption::VALUE_REQUIRED, 'Path to write the configuration file')
3232
->addOption('threshold', '', InputOption::VALUE_REQUIRED, 'Minimum coverage threshold, defaults to 100', 100)
3333
->addOption('baseDir', '', InputOption::VALUE_REQUIRED, 'Base directory from where to determine the relative config paths');
3434
}

tests/Functional/Command/BaselineCommand/BaselineCommandTest.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,6 @@ class BaselineCommandTest extends TestCase
2020
/** @var vfsStreamDirectory */
2121
private $fileSystem;
2222

23-
protected function setUp(): void
24-
{
25-
parent::setUp();
26-
$this->fileSystem = vfsStream::setup('output');
27-
}
28-
2923
/**
3024
* @throws Exception
3125
*/
@@ -39,7 +33,7 @@ public function testBaselineCommand(): void
3933

4034
// prepare command
4135
$command = new BaselineCommand();
42-
$input = new ArgvInput(['phpfci', '--baseDir', $baseDir, $coveragePath, $output]);
36+
$input = new ArgvInput(['phpfci', $coveragePath, '--baseDir', $baseDir, '--config', $output]);
4337
$output = new BufferedOutput();
4438

4539
// run test case
@@ -53,4 +47,10 @@ public function testBaselineCommand(): void
5347

5448
static::assertSame($expected, $result);
5549
}
50+
51+
protected function setUp(): void
52+
{
53+
parent::setUp();
54+
$this->fileSystem = vfsStream::setup('output');
55+
}
5656
}

0 commit comments

Comments
 (0)