Skip to content

Commit 559d0c9

Browse files
Merge branch '11.2'
2 parents 10e47a2 + 4c37cbd commit 559d0c9

File tree

4 files changed

+29
-0
lines changed

4 files changed

+29
-0
lines changed

src/TextUI/Configuration/Xml/Migration/MigrationBuilder.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,10 @@
6969
'11.0' => [
7070
ReplaceRestrictDeprecationsWithIgnoreDeprecations::class,
7171
],
72+
73+
'11.1' => [
74+
RemoveCoverageElementCacheDirectoryAttribute::class,
75+
],
7276
];
7377

7478
/**
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/11.2/phpunit.xsd">
4+
<coverage cacheDirectory="var/.coverage-cache"/>
5+
</phpunit>
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/11.3/phpunit.xsd">
4+
<coverage/>
5+
</phpunit>

tests/unit/TextUI/Configuration/Xml/MigratorTest.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
namespace PHPUnit\TextUI\XmlConfiguration;
1111

1212
use PHPUnit\Framework\Attributes\TestDox;
13+
use PHPUnit\Framework\Attributes\Ticket;
1314
use PHPUnit\Framework\TestCase;
1415
use PHPUnit\Util\Xml\Loader as XmlLoader;
1516

@@ -40,4 +41,18 @@ public function testCanMigratePhpUnit95Configuration(): void
4041
),
4142
);
4243
}
44+
45+
#[TestDox('Remove cacheDirectory attribute from <coverage> element when migrating from PHPUnit 11.1 to PHPUnit 11.2')]
46+
#[Ticket('https://github.com/sebastianbergmann/phpunit/issues/5859')]
47+
public function testIssue5859(): void
48+
{
49+
$this->assertEquals(
50+
(new XmlLoader)->loadFile(__DIR__ . '/../../../../_files/XmlConfigurationMigration/output-5859.xml'),
51+
(new XmlLoader)->load(
52+
(new Migrator)->migrate(
53+
__DIR__ . '/../../../../_files/XmlConfigurationMigration/input-5859.xml',
54+
),
55+
),
56+
);
57+
}
4358
}

0 commit comments

Comments
 (0)