fix: preserve explicit coverage report path

This commit is contained in:
nuno maduro
2026-10-12 22:06:43 +04:00
parent 5b2293f67a
commit 425cd93e27
4 changed files with 62 additions and 15 deletions
+20
View File
@@ -19,6 +19,26 @@ it('adds coverage if --coverage exist', function () {
->and($plugin->coverage)->toBeTrue();
})->skip(! Coverage::isAvailable() || ! function_exists('xdebug_info') || ! in_array('coverage', xdebug_info('mode'), true), 'Coverage is not available');
it('keeps the explicit coverage path when --coverage exists', function () {
foreach ([
['--coverage-php=test.cov'],
['--coverage-php', 'test.cov'],
] as $coverageArguments) {
$plugin = new CoveragePlugin(new ConsoleOutput);
$arguments = $plugin->handleArguments([
'--coverage',
'--coverage-text',
...$coverageArguments,
]);
expect(array_values($arguments))->toEqual([
'--coverage-text',
...$coverageArguments,
]);
}
})->skip(! Coverage::isAvailable() || ! function_exists('xdebug_info') || ! in_array('coverage', xdebug_info('mode'), true), 'Coverage is not available');
it('adds coverage if --min exist', function () {
$plugin = new CoveragePlugin(new ConsoleOutput);
expect($plugin->coverageMin)->toEqual(0.0)