-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Migrate configuration from 10.5 to 11.4 #6023
Comments
FYI: related to my previous report #6019, when there is a change in configuration (even if it's not expected, like |
While I agree that losing indentation is an inconvenience, it is annoying enough to invest time/effort in finding a solution to keep it. |
I've noticed that documentation still identify the So, after re-introduced the attribute missing in my
I think it's an issue, because |
Oops, I've in mind schema 10.5 and I present schema 10.4, but both identify correctly the missing attribute. @see https://github.com/sebastianbergmann/phpunit/blob/main/schema/10.5.xsd#L65 |
Agree with you that it's time consuming. But I'll give you the solution, because I wanted to learn more about PHPUnit migration command. With DOMDocument, when you set Preserve indentation <?php
$filename = __DIR__ . DIRECTORY_SEPARATOR . 'phpunit.xml.dist';
$configurationDocument = new \DOMDocument();
// either
//$configurationDocument->load($filename);
// or
$configurationDocument->loadXML(file_get_contents($filename));
$configurationDocument->preserveWhiteSpace = false;
$configurationDocument->formatOutput = true;
var_export($configurationDocument->saveXML()); DO NOT preserve indentation <?php
$filename = __DIR__ . DIRECTORY_SEPARATOR . 'phpunit.xml.dist';
$configurationDocument = new \DOMDocument();
$configurationDocument->preserveWhiteSpace = false;
$configurationDocument->formatOutput = true;
// either
//$configurationDocument->load($filename);
// or
$configurationDocument->loadXML(file_get_contents($filename));
var_export($configurationDocument->saveXML()); In summary to fix PHPUnit, you have just to remove the line https://github.com/sebastianbergmann/phpunit/blob/11.4/src/Util/Xml/Loader.php#L67 because the good lines in right place are already defined at https://github.com/sebastianbergmann/phpunit/blob/11.4/src/TextUI/Configuration/Xml/Migration/Migrator.php#L47-L48 |
@sebastianbergmann Not really sure if it's related to that thread but got warnings with many tags since migrating to 11.4
Here is my phpunit.xml.dist file <?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
backupGlobals="false"
colors="true"
bootstrap="tests/bootstrap.php"
convertDeprecationsToExceptions="true"
displayDetailsOnTestsThatTriggerDeprecations="true"
displayDetailsOnTestsThatTriggerErrors="true"
displayDetailsOnTestsThatTriggerNotices="true"
displayDetailsOnTestsThatTriggerWarnings="true"
displayDetailsOnPhpunitDeprecations="true"
>
<php>
<ini name="display_errors" value="1"/>
<ini name="error_reporting" value="-1"/>
<server name="APP_ENV" value="test" force="true"/>
<server name="SHELL_VERBOSITY" value="-1"/>
<server name="SYMFONY_PHPUNIT_REMOVE" value=""/>
<server name="SYMFONY_PHPUNIT_VERSION" value="11.5"/>
<!-- ###+ snc/redis-bundle ### -->
<!-- passwords that contain special characters (@, %, :, +) must be urlencoded -->
<env name="REDIS_URL" value="redis://localhost"/>
<server name="SYMFONY_DEPRECATIONS_HELPER"
value="max[self]=0&max[direct]=0&quiet[]=indirect&quiet[]=other"/>
<!-- ###- snc/redis-bundle ### -->
</php>
<testsuites>
<testsuite name="Project Test Suite">
<directory>tests</directory>
</testsuite>
</testsuites>
<coverage includeUncoveredFiles="true">
<include>
<directory suffix=".php">src</directory>
</include>
</coverage>
<listeners>
<listener class="Symfony\Bridge\PhpUnit\SymfonyTestsListener"/>
</listeners>
<extensions>
<bootstrap class="Zenstruck\Browser\Test\BrowserExtension"/>
<bootstrap class="DAMA\DoctrineTestBundle\PHPUnit\PHPUnitExtension"/>
</extensions>
</phpunit> Here is the result of
Changing to |
Hello,
Working on my project BOX Manifest and wanted to migrate from PHPUnit 10 to 11, I've noticed that include uncovered files option was not included during migration process.
After installing PHPUnit 11.4.3, I've checks for regressions with following command :
And got this output :
So I've run migration process with following command :
Anf got result :
But when I compare versions, I was surprised on
coverage
section that missed previous attributeincludeUncoveredFiles
Checks with command :
That prints :
BTW, it will be cool if we can same identation after migration. Even if my PHP editor is able to easily re-indent code !
The text was updated successfully, but these errors were encountered: