diff --git a/.psalm/baseline.xml b/.psalm/baseline.xml
index 1e8a176f62b..06601b0dfe8 100644
--- a/.psalm/baseline.xml
+++ b/.psalm/baseline.xml
@@ -1699,8 +1699,9 @@
-
+
clover
+ cobertura
crap4j
html
pathCoverage
@@ -1732,6 +1733,11 @@
target
+
+
+ target
+
+
target
@@ -1874,6 +1880,11 @@
createElement
+
+
+ createElement
+
+
createElement
diff --git a/phpunit.xsd b/phpunit.xsd
index 24374c3fc83..75a91e832f8 100644
--- a/phpunit.xsd
+++ b/phpunit.xsd
@@ -287,6 +287,7 @@
+
diff --git a/src/TextUI/CliArguments/Builder.php b/src/TextUI/CliArguments/Builder.php
index f7f4afd7d22..1353365f957 100644
--- a/src/TextUI/CliArguments/Builder.php
+++ b/src/TextUI/CliArguments/Builder.php
@@ -42,6 +42,7 @@ final class Builder
'warm-coverage-cache',
'coverage-filter=',
'coverage-clover=',
+ 'coverage-cobertura=',
'coverage-crap4j=',
'coverage-html=',
'coverage-php=',
@@ -151,6 +152,7 @@ public function fromParameters(array $parameters, array $additionalLongOptions):
$warmCoverageCache = null;
$coverageFilter = null;
$coverageClover = null;
+ $coverageCobertura = null;
$coverageCrap4J = null;
$coverageHtml = null;
$coveragePhp = null;
@@ -284,6 +286,11 @@ public function fromParameters(array $parameters, array $additionalLongOptions):
break;
+ case '--coverage-cobertura':
+ $coverageCobertura = $option[1];
+
+ break;
+
case '--coverage-crap4j':
$coverageCrap4J = $option[1];
@@ -781,6 +788,7 @@ public function fromParameters(array $parameters, array $additionalLongOptions):
$columns,
$configuration,
$coverageClover,
+ $coverageCobertura,
$coverageCrap4J,
$coverageHtml,
$coveragePhp,
diff --git a/src/TextUI/CliArguments/Configuration.php b/src/TextUI/CliArguments/Configuration.php
index d51e17b764b..0c3ff5a320b 100644
--- a/src/TextUI/CliArguments/Configuration.php
+++ b/src/TextUI/CliArguments/Configuration.php
@@ -92,6 +92,11 @@ final class Configuration
*/
private $coverageClover;
+ /**
+ * @var ?string
+ */
+ private $coverageCobertura;
+
/**
* @var ?string
*/
@@ -460,7 +465,7 @@ final class Configuration
/**
* @param null|int|string $columns
*/
- public function __construct(?string $argument, ?string $atLeastVersion, ?bool $backupGlobals, ?bool $backupStaticAttributes, ?bool $beStrictAboutChangesToGlobalState, ?bool $beStrictAboutResourceUsageDuringSmallTests, ?string $bootstrap, ?bool $cacheResult, ?string $cacheResultFile, ?bool $checkVersion, ?string $colors, $columns, ?string $configuration, ?string $coverageClover, ?string $coverageCrap4J, ?string $coverageHtml, ?string $coveragePhp, ?string $coverageText, ?bool $coverageTextShowUncoveredFiles, ?bool $coverageTextShowOnlySummary, ?string $coverageXml, ?bool $pathCoverage, ?string $coverageCacheDirectory, ?bool $warmCoverageCache, ?bool $debug, ?int $defaultTimeLimit, ?bool $disableCodeCoverageIgnore, ?bool $disallowTestOutput, ?bool $disallowTodoAnnotatedTests, ?bool $enforceTimeLimit, ?array $excludeGroups, ?int $executionOrder, ?int $executionOrderDefects, ?array $extensions, ?array $unavailableExtensions, ?bool $failOnEmptyTestSuite, ?bool $failOnIncomplete, ?bool $failOnRisky, ?bool $failOnSkipped, ?bool $failOnWarning, ?string $filter, ?bool $generateConfiguration, ?bool $migrateConfiguration, ?array $groups, ?bool $help, ?string $includePath, ?array $iniSettings, ?string $junitLogfile, ?bool $listGroups, ?bool $listSuites, ?bool $listTests, ?string $listTestsXml, ?string $loader, ?bool $noCoverage, ?bool $noExtensions, ?bool $noInteraction, ?bool $noLogging, ?string $printer, ?bool $processIsolation, ?int $randomOrderSeed, ?int $repeat, ?bool $reportUselessTests, ?bool $resolveDependencies, ?bool $reverseList, ?bool $stderr, ?bool $strictCoverage, ?bool $stopOnDefect, ?bool $stopOnError, ?bool $stopOnFailure, ?bool $stopOnIncomplete, ?bool $stopOnRisky, ?bool $stopOnSkipped, ?bool $stopOnWarning, ?string $teamcityLogfile, ?array $testdoxExcludeGroups, ?array $testdoxGroups, ?string $testdoxHtmlFile, ?string $testdoxTextFile, ?string $testdoxXmlFile, ?array $testSuffixes, ?string $testSuite, array $unrecognizedOptions, ?string $unrecognizedOrderBy, ?bool $useDefaultConfiguration, ?bool $verbose, ?bool $version, ?array $coverageFilter, ?string $xdebugFilterFile)
+ public function __construct(?string $argument, ?string $atLeastVersion, ?bool $backupGlobals, ?bool $backupStaticAttributes, ?bool $beStrictAboutChangesToGlobalState, ?bool $beStrictAboutResourceUsageDuringSmallTests, ?string $bootstrap, ?bool $cacheResult, ?string $cacheResultFile, ?bool $checkVersion, ?string $colors, $columns, ?string $configuration, ?string $coverageClover, ?string $coverageCobertura, ?string $coverageCrap4J, ?string $coverageHtml, ?string $coveragePhp, ?string $coverageText, ?bool $coverageTextShowUncoveredFiles, ?bool $coverageTextShowOnlySummary, ?string $coverageXml, ?bool $pathCoverage, ?string $coverageCacheDirectory, ?bool $warmCoverageCache, ?bool $debug, ?int $defaultTimeLimit, ?bool $disableCodeCoverageIgnore, ?bool $disallowTestOutput, ?bool $disallowTodoAnnotatedTests, ?bool $enforceTimeLimit, ?array $excludeGroups, ?int $executionOrder, ?int $executionOrderDefects, ?array $extensions, ?array $unavailableExtensions, ?bool $failOnEmptyTestSuite, ?bool $failOnIncomplete, ?bool $failOnRisky, ?bool $failOnSkipped, ?bool $failOnWarning, ?string $filter, ?bool $generateConfiguration, ?bool $migrateConfiguration, ?array $groups, ?bool $help, ?string $includePath, ?array $iniSettings, ?string $junitLogfile, ?bool $listGroups, ?bool $listSuites, ?bool $listTests, ?string $listTestsXml, ?string $loader, ?bool $noCoverage, ?bool $noExtensions, ?bool $noInteraction, ?bool $noLogging, ?string $printer, ?bool $processIsolation, ?int $randomOrderSeed, ?int $repeat, ?bool $reportUselessTests, ?bool $resolveDependencies, ?bool $reverseList, ?bool $stderr, ?bool $strictCoverage, ?bool $stopOnDefect, ?bool $stopOnError, ?bool $stopOnFailure, ?bool $stopOnIncomplete, ?bool $stopOnRisky, ?bool $stopOnSkipped, ?bool $stopOnWarning, ?string $teamcityLogfile, ?array $testdoxExcludeGroups, ?array $testdoxGroups, ?string $testdoxHtmlFile, ?string $testdoxTextFile, ?string $testdoxXmlFile, ?array $testSuffixes, ?string $testSuite, array $unrecognizedOptions, ?string $unrecognizedOrderBy, ?bool $useDefaultConfiguration, ?bool $verbose, ?bool $version, ?array $coverageFilter, ?string $xdebugFilterFile)
{
$this->argument = $argument;
$this->atLeastVersion = $atLeastVersion;
@@ -477,6 +482,7 @@ public function __construct(?string $argument, ?string $atLeastVersion, ?bool $b
$this->configuration = $configuration;
$this->coverageFilter = $coverageFilter;
$this->coverageClover = $coverageClover;
+ $this->coverageCobertura = $coverageCobertura;
$this->coverageCrap4J = $coverageCrap4J;
$this->coverageHtml = $coverageHtml;
$this->coveragePhp = $coveragePhp;
@@ -807,6 +813,23 @@ public function coverageClover(): string
return $this->coverageClover;
}
+ public function hasCoverageCobertura(): bool
+ {
+ return $this->coverageCobertura !== null;
+ }
+
+ /**
+ * @throws Exception
+ */
+ public function coverageCobertura(): string
+ {
+ if ($this->coverageCobertura === null) {
+ throw new Exception;
+ }
+
+ return $this->coverageCobertura;
+ }
+
public function hasCoverageCrap4J(): bool
{
return $this->coverageCrap4J !== null;
diff --git a/src/TextUI/CliArguments/Mapper.php b/src/TextUI/CliArguments/Mapper.php
index cda3e1f633f..8930de0f369 100644
--- a/src/TextUI/CliArguments/Mapper.php
+++ b/src/TextUI/CliArguments/Mapper.php
@@ -68,6 +68,10 @@ public function mapToLegacyArray(Configuration $arguments): array
$result['coverageClover'] = $arguments->coverageClover();
}
+ if ($arguments->hasCoverageCobertura()) {
+ $result['coverageCobertura'] = $arguments->coverageCobertura();
+ }
+
if ($arguments->hasCoverageCrap4J()) {
$result['coverageCrap4J'] = $arguments->coverageCrap4J();
}
diff --git a/src/TextUI/Help.php b/src/TextUI/Help.php
index c4e79849253..3322c7c10f8 100644
--- a/src/TextUI/Help.php
+++ b/src/TextUI/Help.php
@@ -36,6 +36,7 @@ final class Help
'Code Coverage Options' => [
['arg' => '--coverage-clover ', 'desc' => 'Generate code coverage report in Clover XML format'],
+ ['arg' => '--coverage-cobertura ', 'desc' => 'Generate code coverage report in Cobertura XML format'],
['arg' => '--coverage-crap4j ', 'desc' => 'Generate code coverage report in Crap4J XML format'],
['arg' => '--coverage-html ', 'desc' => 'Generate code coverage report in HTML format'],
['arg' => '--coverage-php ', 'desc' => 'Export PHP_CodeCoverage object to file'],
diff --git a/src/TextUI/TestRunner.php b/src/TextUI/TestRunner.php
index 6813468eb84..9d892aa266b 100644
--- a/src/TextUI/TestRunner.php
+++ b/src/TextUI/TestRunner.php
@@ -69,6 +69,7 @@
use SebastianBergmann\CodeCoverage\Exception as CodeCoverageException;
use SebastianBergmann\CodeCoverage\Filter as CodeCoverageFilter;
use SebastianBergmann\CodeCoverage\Report\Clover as CloverReport;
+use SebastianBergmann\CodeCoverage\Report\Cobertura as CoberturaReport;
use SebastianBergmann\CodeCoverage\Report\Crap4j as Crap4jReport;
use SebastianBergmann\CodeCoverage\Report\Html\Facade as HtmlReport;
use SebastianBergmann\CodeCoverage\Report\PHP as PhpReport;
@@ -389,6 +390,10 @@ public function run(TestSuite $suite, array $arguments = [], array $warnings = [
$codeCoverageReports++;
}
+ if (isset($arguments['coverageCobertura'])) {
+ $codeCoverageReports++;
+ }
+
if (isset($arguments['coverageCrap4J'])) {
$codeCoverageReports++;
}
@@ -691,6 +696,21 @@ public function run(TestSuite $suite, array $arguments = [], array $warnings = [
}
}
+ if (isset($arguments['coverageCobertura'])) {
+ $this->codeCoverageGenerationStart('Cobertura XML');
+
+ try {
+ $writer = new CoberturaReport;
+ $writer->process($codeCoverage, $arguments['coverageCobertura']);
+
+ $this->codeCoverageGenerationSucceeded();
+
+ unset($writer);
+ } catch (CodeCoverageException $e) {
+ $this->codeCoverageGenerationFailed($e);
+ }
+ }
+
if (isset($arguments['coverageCrap4J'])) {
$this->codeCoverageGenerationStart('Crap4J XML');
@@ -887,6 +907,10 @@ private function handleConfiguration(array &$arguments): void
$arguments['coverageClover'] = $codeCoverageConfiguration->clover()->target()->path();
}
+ if (!isset($arguments['coverageCobertura']) && $codeCoverageConfiguration->hasCobertura()) {
+ $arguments['coverageCobertura'] = $codeCoverageConfiguration->cobertura()->target()->path();
+ }
+
if (!isset($arguments['coverageCrap4J']) && $codeCoverageConfiguration->hasCrap4j()) {
$arguments['coverageCrap4J'] = $codeCoverageConfiguration->crap4j()->target()->path();
diff --git a/src/TextUI/XmlConfiguration/CodeCoverage/CodeCoverage.php b/src/TextUI/XmlConfiguration/CodeCoverage/CodeCoverage.php
index 422382b171f..33cbea3213a 100644
--- a/src/TextUI/XmlConfiguration/CodeCoverage/CodeCoverage.php
+++ b/src/TextUI/XmlConfiguration/CodeCoverage/CodeCoverage.php
@@ -12,6 +12,7 @@
use function count;
use PHPUnit\TextUI\XmlConfiguration\CodeCoverage\Filter\DirectoryCollection;
use PHPUnit\TextUI\XmlConfiguration\CodeCoverage\Report\Clover;
+use PHPUnit\TextUI\XmlConfiguration\CodeCoverage\Report\Cobertura;
use PHPUnit\TextUI\XmlConfiguration\CodeCoverage\Report\Crap4j;
use PHPUnit\TextUI\XmlConfiguration\CodeCoverage\Report\Html;
use PHPUnit\TextUI\XmlConfiguration\CodeCoverage\Report\Php;
@@ -82,6 +83,11 @@ final class CodeCoverage
*/
private $clover;
+ /**
+ * @var ?Cobertura
+ */
+ private $cobertura;
+
/**
* @var ?Crap4j
*/
@@ -107,7 +113,7 @@ final class CodeCoverage
*/
private $xml;
- public function __construct(?Directory $cacheDirectory, DirectoryCollection $directories, FileCollection $files, DirectoryCollection $excludeDirectories, FileCollection $excludeFiles, bool $pathCoverage, bool $includeUncoveredFiles, bool $processUncoveredFiles, bool $ignoreDeprecatedCodeUnits, bool $disableCodeCoverageIgnore, ?Clover $clover, ?Crap4j $crap4j, ?Html $html, ?Php $php, ?Text $text, ?Xml $xml)
+ public function __construct(?Directory $cacheDirectory, DirectoryCollection $directories, FileCollection $files, DirectoryCollection $excludeDirectories, FileCollection $excludeFiles, bool $pathCoverage, bool $includeUncoveredFiles, bool $processUncoveredFiles, bool $ignoreDeprecatedCodeUnits, bool $disableCodeCoverageIgnore, ?Clover $clover, ?Cobertura $cobertura, ?Crap4j $crap4j, ?Html $html, ?Php $php, ?Text $text, ?Xml $xml)
{
$this->cacheDirectory = $cacheDirectory;
$this->directories = $directories;
@@ -120,6 +126,7 @@ public function __construct(?Directory $cacheDirectory, DirectoryCollection $dir
$this->ignoreDeprecatedCodeUnits = $ignoreDeprecatedCodeUnits;
$this->disableCodeCoverageIgnore = $disableCodeCoverageIgnore;
$this->clover = $clover;
+ $this->cobertura = $cobertura;
$this->crap4j = $crap4j;
$this->html = $html;
$this->php = $php;
@@ -221,6 +228,28 @@ public function clover(): Clover
return $this->clover;
}
+ /**
+ * @psalm-assert-if-true !null $this->cobertura
+ */
+ public function hasCobertura(): bool
+ {
+ return $this->cobertura !== null;
+ }
+
+ /**
+ * @throws Exception
+ */
+ public function cobertura(): Cobertura
+ {
+ if (!$this->hasCobertura()) {
+ throw new Exception(
+ 'Code Coverage report "Cobertura XML" has not been configured'
+ );
+ }
+
+ return $this->cobertura;
+ }
+
/**
* @psalm-assert-if-true !null $this->crap4j
*/
diff --git a/src/TextUI/XmlConfiguration/CodeCoverage/Report/Cobertura.php b/src/TextUI/XmlConfiguration/CodeCoverage/Report/Cobertura.php
new file mode 100644
index 00000000000..e6ee7c9f620
--- /dev/null
+++ b/src/TextUI/XmlConfiguration/CodeCoverage/Report/Cobertura.php
@@ -0,0 +1,34 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+namespace PHPUnit\TextUI\XmlConfiguration\CodeCoverage\Report;
+
+use PHPUnit\TextUI\XmlConfiguration\File;
+
+/**
+ * @internal This class is not covered by the backward compatibility promise for PHPUnit
+ * @psalm-immutable
+ */
+final class Cobertura
+{
+ /**
+ * @var File
+ */
+ private $target;
+
+ public function __construct(File $target)
+ {
+ $this->target = $target;
+ }
+
+ public function target(): File
+ {
+ return $this->target;
+ }
+}
diff --git a/src/TextUI/XmlConfiguration/Loader.php b/src/TextUI/XmlConfiguration/Loader.php
index cee813380f7..36c7ec5527d 100644
--- a/src/TextUI/XmlConfiguration/Loader.php
+++ b/src/TextUI/XmlConfiguration/Loader.php
@@ -35,6 +35,7 @@
use PHPUnit\TextUI\XmlConfiguration\CodeCoverage\Filter\Directory as FilterDirectory;
use PHPUnit\TextUI\XmlConfiguration\CodeCoverage\Filter\DirectoryCollection as FilterDirectoryCollection;
use PHPUnit\TextUI\XmlConfiguration\CodeCoverage\Report\Clover;
+use PHPUnit\TextUI\XmlConfiguration\CodeCoverage\Report\Cobertura;
use PHPUnit\TextUI\XmlConfiguration\CodeCoverage\Report\Crap4j;
use PHPUnit\TextUI\XmlConfiguration\CodeCoverage\Report\Html as CodeCoverageHtml;
use PHPUnit\TextUI\XmlConfiguration\CodeCoverage\Report\Php as CodeCoveragePhp;
@@ -450,6 +451,20 @@ private function codeCoverage(string $filename, DOMXPath $xpath, DOMDocument $do
);
}
+ $cobertura = null;
+ $element = $this->element($xpath, 'coverage/report/cobertura');
+
+ if ($element) {
+ $cobertura = new Cobertura(
+ new File(
+ $this->toAbsolutePath(
+ $filename,
+ (string) $this->getStringAttribute($element, 'outputFile')
+ )
+ )
+ );
+ }
+
$crap4j = null;
$element = $this->element($xpath, 'coverage/report/crap4j');
@@ -537,6 +552,7 @@ private function codeCoverage(string $filename, DOMXPath $xpath, DOMDocument $do
$ignoreDeprecatedCodeUnits,
$disableCodeCoverageIgnore,
$clover,
+ $cobertura,
$crap4j,
$html,
$php,
@@ -583,12 +599,13 @@ private function legacyCodeCoverage(string $filename, DOMXPath $xpath, DOMDocume
}
}
- $clover = null;
- $crap4j = null;
- $html = null;
- $php = null;
- $text = null;
- $xml = null;
+ $clover = null;
+ $cobertura = null;
+ $crap4j = null;
+ $html = null;
+ $php = null;
+ $text = null;
+ $xml = null;
foreach ($xpath->query('logging/log') as $log) {
assert($log instanceof DOMElement);
@@ -610,6 +627,13 @@ private function legacyCodeCoverage(string $filename, DOMXPath $xpath, DOMDocume
break;
+ case 'coverage-cobertura':
+ $cobertura = new Cobertura(
+ new File($target)
+ );
+
+ break;
+
case 'coverage-crap4j':
$crap4j = new Crap4j(
new File($target),
@@ -664,6 +688,7 @@ private function legacyCodeCoverage(string $filename, DOMXPath $xpath, DOMDocume
$ignoreDeprecatedCodeUnits,
$disableCodeCoverageIgnore,
$clover,
+ $cobertura,
$crap4j,
$html,
$php,
diff --git a/src/TextUI/XmlConfiguration/Migration/MigrationBuilder.php b/src/TextUI/XmlConfiguration/Migration/MigrationBuilder.php
index abef49f10c3..8b75c834821 100644
--- a/src/TextUI/XmlConfiguration/Migration/MigrationBuilder.php
+++ b/src/TextUI/XmlConfiguration/Migration/MigrationBuilder.php
@@ -32,6 +32,7 @@ final class MigrationBuilder
MoveWhitelistExcludesToCoverage::class,
RemoveEmptyFilter::class,
CoverageCloverToReport::class,
+ CoverageCoberturaToReport::class,
CoverageCrap4jToReport::class,
CoverageHtmlToReport::class,
CoveragePhpToReport::class,
diff --git a/src/TextUI/XmlConfiguration/Migration/Migrations/CoverageCoberturaToReport.php b/src/TextUI/XmlConfiguration/Migration/Migrations/CoverageCoberturaToReport.php
new file mode 100644
index 00000000000..0d95d138995
--- /dev/null
+++ b/src/TextUI/XmlConfiguration/Migration/Migrations/CoverageCoberturaToReport.php
@@ -0,0 +1,31 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+namespace PHPUnit\TextUI\XmlConfiguration;
+
+use DOMElement;
+
+/**
+ * @internal This class is not covered by the backward compatibility promise for PHPUnit
+ */
+final class CoverageCoberturaToReport extends LogToReportMigration
+{
+ protected function forType(): string
+ {
+ return 'coverage-cobertura';
+ }
+
+ protected function toReportFormat(DOMElement $logNode): DOMElement
+ {
+ $cobertura = $logNode->ownerDocument->createElement('cobertura');
+ $cobertura->setAttribute('outputFile', $logNode->getAttribute('target'));
+
+ return $cobertura;
+ }
+}
diff --git a/tests/_files/configuration_codecoverage.xml b/tests/_files/configuration_codecoverage.xml
index 5c753833708..6c06a9a2b3c 100644
--- a/tests/_files/configuration_codecoverage.xml
+++ b/tests/_files/configuration_codecoverage.xml
@@ -21,6 +21,7 @@
+
diff --git a/tests/_files/configuration_legacy_codecoverage.xml b/tests/_files/configuration_legacy_codecoverage.xml
index 49e39691270..ae9cb3c3b8d 100644
--- a/tests/_files/configuration_legacy_codecoverage.xml
+++ b/tests/_files/configuration_legacy_codecoverage.xml
@@ -18,6 +18,7 @@
+
diff --git a/tests/end-to-end/cli/_files/output-cli-help-color.txt b/tests/end-to-end/cli/_files/output-cli-help-color.txt
index 17d4ac38965..a7a97f9d76b 100644
--- a/tests/end-to-end/cli/_files/output-cli-help-color.txt
+++ b/tests/end-to-end/cli/_files/output-cli-help-color.txt
@@ -5,6 +5,8 @@
[33mCode Coverage Options:[0m
[32m--coverage-clover [36m[0m [0m Generate code coverage report in Clover
XML format
+ [32m--coverage-cobertura [36m[0m[0m Generate code coverage report in
+ Cobertura XML format
[32m--coverage-crap4j [36m[0m [0m Generate code coverage report in Crap4J
XML format
[32m--coverage-html [36m[0m [0m Generate code coverage report in HTML
diff --git a/tests/end-to-end/cli/_files/output-cli-usage.txt b/tests/end-to-end/cli/_files/output-cli-usage.txt
index 8d6b90a2478..b6f06724d56 100644
--- a/tests/end-to-end/cli/_files/output-cli-usage.txt
+++ b/tests/end-to-end/cli/_files/output-cli-usage.txt
@@ -7,6 +7,7 @@ Usage:
Code Coverage Options:
--coverage-clover Generate code coverage report in Clover XML format
+ --coverage-cobertura Generate code coverage report in Cobertura XML format
--coverage-crap4j Generate code coverage report in Crap4J XML format
--coverage-html Generate code coverage report in HTML format
--coverage-php Export PHP_CodeCoverage object to file
diff --git a/tests/unit/TextUI/XmlConfigurationTest.php b/tests/unit/TextUI/XmlConfigurationTest.php
index f78a3c08595..c89b0534b1b 100644
--- a/tests/unit/TextUI/XmlConfigurationTest.php
+++ b/tests/unit/TextUI/XmlConfigurationTest.php
@@ -193,6 +193,9 @@ public function testCodeCoverageConfigurationIsReadCorrectly(): void
$this->assertTrue($codeCoverage->hasClover());
$this->assertSame(TEST_FILES_PATH . 'clover.xml', $codeCoverage->clover()->target()->path());
+ $this->assertTrue($codeCoverage->hasCobertura());
+ $this->assertSame(TEST_FILES_PATH . 'cobertura.xml', $codeCoverage->cobertura()->target()->path());
+
$this->assertTrue($codeCoverage->hasCrap4j());
$this->assertSame(TEST_FILES_PATH . 'crap4j.xml', $codeCoverage->crap4j()->target()->path());
@@ -251,6 +254,9 @@ public function testLegacyCodeCoverageConfigurationIsReadCorrectly(): void
$this->assertTrue($codeCoverage->hasClover());
$this->assertSame(TEST_FILES_PATH . 'clover.xml', $codeCoverage->clover()->target()->path());
+ $this->assertTrue($codeCoverage->hasCobertura());
+ $this->assertSame(TEST_FILES_PATH . 'cobertura.xml', $codeCoverage->cobertura()->target()->path());
+
$this->assertTrue($codeCoverage->hasCrap4j());
$this->assertSame(TEST_FILES_PATH . 'crap4j.xml', $codeCoverage->crap4j()->target()->path());
diff --git a/tests/unit/Util/XDebugFilterScriptGeneratorTest.php b/tests/unit/Util/XDebugFilterScriptGeneratorTest.php
index 6938f1d27b1..4fed96eaecb 100644
--- a/tests/unit/Util/XDebugFilterScriptGeneratorTest.php
+++ b/tests/unit/Util/XDebugFilterScriptGeneratorTest.php
@@ -101,6 +101,7 @@ public function testReturnsExpectedScript(): void
null,
null,
null,
+ null,
null
);