Skip to content

Commit 15f34af

Browse files
Merge branch '10.5' into 11.5
2 parents 6ca2c7c + e4e732d commit 15f34af

File tree

7 files changed

+58
-47
lines changed

7 files changed

+58
-47
lines changed

ChangeLog-11.5.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ All notable changes of the PHPUnit 11.5 release series are documented in this fi
77
### Fixed
88

99
* [#6082](https://github.com/sebastianbergmann/phpunit/issues/6082): `assertArrayHasKey()`, `assertArrayNotHasKey()`, `arrayHasKey()`, and `ArrayHasKey::__construct()` do not support all possible key types
10+
* [#6087](https://github.com/sebastianbergmann/phpunit/issues/6087): `--migrate-configuration` does not remove `beStrictAboutTodoAnnotatedTests` attribute from XML configuration file
1011

1112
## [11.5.1] - 2024-12-11
1213

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,10 @@
6464
MoveCoverageDirectoriesToSource::class,
6565
],
6666

67+
'10.4' => [
68+
RemoveBeStrictAboutTodoAnnotatedTestsAttribute::class,
69+
],
70+
6771
'10.5' => [
6872
RemoveRegisterMockObjectsFromTestArgumentsRecursivelyAttribute::class,
6973
],
@@ -77,6 +81,10 @@
7781
RemoveCoverageElementCacheDirectoryAttribute::class,
7882
],
7983

84+
'11.2' => [
85+
RemoveBeStrictAboutTodoAnnotatedTestsAttribute::class,
86+
],
87+
8088
'11.4' => [
8189
RemoveCoverageElementIncludeUncoveredFilesAttribute::class,
8290
],
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
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.1/phpunit.xsd"
4+
beStrictAboutTodoAnnotatedTests="true"
5+
>
6+
<testsuites>
7+
<testsuite name="default">
8+
<directory>tests</directory>
9+
</testsuite>
10+
</testsuites>
11+
</phpunit>
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
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.5/phpunit.xsd"
4+
>
5+
<testsuites>
6+
<testsuite name="default">
7+
<directory>tests</directory>
8+
</testsuite>
9+
</testsuites>
10+
</phpunit>

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

Lines changed: 28 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -9,63 +9,44 @@
99
*/
1010
namespace PHPUnit\TextUI\XmlConfiguration;
1111

12-
use PHPUnit\Framework\Attributes\TestDox;
13-
use PHPUnit\Framework\Attributes\Ticket;
12+
use PHPUnit\Framework\Attributes\DataProvider;
1413
use PHPUnit\Framework\TestCase;
1514
use PHPUnit\Util\Xml\Loader as XmlLoader;
1615

1716
final class MigratorTest extends TestCase
1817
{
19-
#[TestDox('Can migrate PHPUnit 9.2 configuration')]
20-
public function testCanMigratePhpUnit92Configuration(): void
18+
public static function provider(): array
2119
{
22-
$this->assertEquals(
23-
(new XmlLoader)->loadFile(__DIR__ . '/../../../../_files/XmlConfigurationMigration/output-9.2.xml'),
24-
(new XmlLoader)->load(
25-
(new Migrator)->migrate(
26-
__DIR__ . '/../../../../_files/XmlConfigurationMigration/input-9.2.xml',
27-
),
28-
),
29-
);
30-
}
31-
32-
#[TestDox('Can migrate PHPUnit 9.5 configuration')]
33-
public function testCanMigratePhpUnit95Configuration(): void
34-
{
35-
$this->assertEquals(
36-
(new XmlLoader)->loadFile(__DIR__ . '/../../../../_files/XmlConfigurationMigration/output-9.5.xml'),
37-
(new XmlLoader)->load(
38-
(new Migrator)->migrate(
39-
__DIR__ . '/../../../../_files/XmlConfigurationMigration/input-9.5.xml',
40-
),
41-
),
42-
);
43-
}
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-
);
20+
return [
21+
'PHPUnit 9.2' => [
22+
__DIR__ . '/../../../../_files/XmlConfigurationMigration/output-9.2.xml',
23+
__DIR__ . '/../../../../_files/XmlConfigurationMigration/input-9.2.xml',
24+
],
25+
'PHPUnit 9.5' => [
26+
__DIR__ . '/../../../../_files/XmlConfigurationMigration/output-9.5.xml',
27+
__DIR__ . '/../../../../_files/XmlConfigurationMigration/input-9.5.xml',
28+
],
29+
'Relative Path' => [
30+
__DIR__ . '/../../../../_files/XmlConfigurationMigration/output-relative-schema-path.xml',
31+
__DIR__ . '/../../../../_files/XmlConfigurationMigration/input-relative-schema-path.xml',
32+
],
33+
'Issue 5859' => [
34+
__DIR__ . '/../../../../_files/XmlConfigurationMigration/output-issue-5859.xml',
35+
__DIR__ . '/../../../../_files/XmlConfigurationMigration/input-issue-5859.xml',
36+
],
37+
'Issue 6087' => [
38+
__DIR__ . '/../../../../_files/XmlConfigurationMigration/output-issue-6087.xml',
39+
__DIR__ . '/../../../../_files/XmlConfigurationMigration/input-issue-6087.xml',
40+
],
41+
];
5742
}
5843

59-
#[TestDox('Keep relative schema path when present')]
60-
public function testKeepRelativeSchema(): void
44+
#[DataProvider('provider')]
45+
public function testCanMigrateConfigurationFileThatValidatesAgainstPreviousSchema(string $output, string $input): void
6146
{
6247
$this->assertEquals(
63-
(new XmlLoader)->loadFile(__DIR__ . '/../../../../_files/XmlConfigurationMigration/output-relative-schema-path.xml'),
64-
(new XmlLoader)->load(
65-
(new Migrator)->migrate(
66-
__DIR__ . '/../../../../_files/XmlConfigurationMigration/input-relative-schema-path.xml',
67-
),
68-
),
48+
(new XmlLoader)->loadFile($output),
49+
(new XmlLoader)->load((new Migrator)->migrate($input)),
6950
);
7051
}
7152
}

0 commit comments

Comments
 (0)