-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Try to validate configuration file against all known schema definitio…
…ns before attempting migration
- Loading branch information
1 parent
68bf9de
commit 5dbc551
Showing
4 changed files
with
40 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
tests/end-to-end/migration/_files/unsupported-schema/phpunit.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/0.0/phpunit.xsd" | ||
> | ||
<foo>bar</foo> | ||
</phpunit> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
--TEST-- | ||
Configuration migration is not possible when the configuration file does not validate against any known schema | ||
--FILE-- | ||
<?php declare(strict_types=1); | ||
$_SERVER['argv'][] = '--do-not-cache-result'; | ||
$_SERVER['argv'][] = '--migrate-configuration'; | ||
|
||
chdir(sys_get_temp_dir()); | ||
copy(__DIR__ . '/_files/unsupported-schema/phpunit.xml', 'phpunit.xml'); | ||
|
||
require_once __DIR__ . '/../../bootstrap.php'; | ||
|
||
PHPUnit\TextUI\Command::main(); | ||
--EXPECTF-- | ||
PHPUnit %s by Sebastian Bergmann and contributors. | ||
|
||
%sphpunit.xml does not validate against any know schema. | ||
--CLEAN-- | ||
<?php declare(strict_types=1); | ||
unlink(sys_get_temp_dir() . '/phpunit.xml'); | ||
unlink(sys_get_temp_dir() . '/phpunit.xml.bak'); |