Skip to content

Commit

Permalink
Refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianbergmann committed Dec 20, 2024
1 parent 9c6bd39 commit 3449010
Showing 1 changed file with 16 additions and 19 deletions.
35 changes: 16 additions & 19 deletions tests/unit/TextUI/Configuration/Xml/MigratorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,35 +9,32 @@
*/
namespace PHPUnit\TextUI\XmlConfiguration;

use PHPUnit\Framework\Attributes\TestDox;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\TestCase;
use PHPUnit\Util\Xml\Loader as XmlLoader;

final class MigratorTest extends TestCase
{
#[TestDox('Can migrate PHPUnit 9.2 configuration')]
public function testCanMigratePhpUnit92Configuration(): void
public static function provider(): array
{
$this->assertEquals(
(new XmlLoader)->loadFile(__DIR__ . '/../../../../_files/XmlConfigurationMigration/output-9.2.xml'),
(new XmlLoader)->load(
(new Migrator)->migrate(
__DIR__ . '/../../../../_files/XmlConfigurationMigration/input-9.2.xml',
),
),
);
return [
'PHPUnit 9.2' => [
__DIR__ . '/../../../../_files/XmlConfigurationMigration/output-9.2.xml',
__DIR__ . '/../../../../_files/XmlConfigurationMigration/input-9.2.xml',
],
'PHPUnit 9.5' => [
__DIR__ . '/../../../../_files/XmlConfigurationMigration/output-9.5.xml',
__DIR__ . '/../../../../_files/XmlConfigurationMigration/input-9.5.xml',
],
];
}

#[TestDox('Can migrate PHPUnit 9.5 configuration')]
public function testCanMigratePhpUnit95Configuration(): void
#[DataProvider('provider')]
public function testCanMigrateConfigurationFileThatValidatesAgainstPreviousSchema(string $output, string $input): void
{
$this->assertEquals(
(new XmlLoader)->loadFile(__DIR__ . '/../../../../_files/XmlConfigurationMigration/output-9.5.xml'),
(new XmlLoader)->load(
(new Migrator)->migrate(
__DIR__ . '/../../../../_files/XmlConfigurationMigration/input-9.5.xml',
),
),
(new XmlLoader)->loadFile($output),
(new XmlLoader)->load((new Migrator)->migrate($input)),
);
}
}

0 comments on commit 3449010

Please sign in to comment.