-
-
Notifications
You must be signed in to change notification settings - Fork 498
Make PHPUnit 10 config more consistent with PHPUnitBridge behavior #1402
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
Merged
Conversation
This file contains hidden or 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
Applies symfony#889 to the PHPUnit recipe.
Thanks for the PR 😍 How to test these changes in your application
Diff between recipe versionsIn order to help with the review stage, I'm in charge of computing the diff between the various versions of patched recipes. phpunit/phpunit4.7 vs 9.3diff --git a/phpunit/phpunit/4.7/phpunit.xml.dist b/phpunit/phpunit/9.3/phpunit.xml.dist
index db2b29d..23ea5cf 100644
--- a/phpunit/phpunit/4.7/phpunit.xml.dist
+++ b/phpunit/phpunit/9.3/phpunit.xml.dist
@@ -6,12 +6,15 @@
backupGlobals="false"
colors="true"
bootstrap="tests/bootstrap.php"
+ convertDeprecationsToExceptions="false"
>
<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="9.5" />
</php>
<testsuites>
@@ -20,11 +23,11 @@
</testsuite>
</testsuites>
- <filter>
- <whitelist processUncoveredFilesFromWhitelist="true">
+ <coverage processUncoveredFiles="true">
+ <include>
<directory suffix=".php">src</directory>
- </whitelist>
- </filter>
+ </include>
+ </coverage>
<listeners>
<listener class="Symfony\Bridge\PhpUnit\SymfonyTestsListener" /> 9.3 vs 9.6diff --git a/phpunit/phpunit/9.3/phpunit.xml.dist b/phpunit/phpunit/9.6/phpunit.xml.dist
index 23ea5cf..6c4bfed 100644
--- a/phpunit/phpunit/9.3/phpunit.xml.dist
+++ b/phpunit/phpunit/9.6/phpunit.xml.dist
@@ -33,8 +33,6 @@
<listener class="Symfony\Bridge\PhpUnit\SymfonyTestsListener" />
</listeners>
- <!-- Uncomment when adding extensions
<extensions>
</extensions>
- -->
</phpunit> 9.6 vs 10.0diff --git a/phpunit/phpunit/9.6/.env.test b/phpunit/phpunit/10.0/.env.test
index 9e7162f..24a43c0 100644
--- a/phpunit/phpunit/9.6/.env.test
+++ b/phpunit/phpunit/10.0/.env.test
@@ -2,5 +2,3 @@
KERNEL_CLASS='App\Kernel'
APP_SECRET='$ecretf0rt3st'
SYMFONY_DEPRECATIONS_HELPER=999999
-PANTHER_APP_ENV=panther
-PANTHER_ERROR_SCREENSHOT_DIR=./var/error-screenshots
diff --git a/phpunit/phpunit/9.6/manifest.json b/phpunit/phpunit/10.0/manifest.json
index 8af7b3b..a35670a 100644
--- a/phpunit/phpunit/9.6/manifest.json
+++ b/phpunit/phpunit/10.0/manifest.json
@@ -1,11 +1,11 @@
{
"copy-from-recipe": {
".env.test": ".env.test",
- "phpunit.xml.dist": "phpunit.xml.dist",
+ "phpunit.dist.xml": "phpunit.dist.xml",
"tests/": "tests/"
},
"gitignore": [
"/phpunit.xml",
- ".phpunit.result.cache"
+ "/.phpunit.cache/"
]
}
diff --git a/phpunit/phpunit/9.6/phpunit.xml.dist b/phpunit/phpunit/10.0/phpunit.dist.xml
similarity index 67%
rename from phpunit/phpunit/9.6/phpunit.xml.dist
rename to phpunit/phpunit/10.0/phpunit.dist.xml
index 6c4bfed..0b31da2 100644
--- a/phpunit/phpunit/9.6/phpunit.xml.dist
+++ b/phpunit/phpunit/10.0/phpunit.dist.xml
@@ -5,16 +5,16 @@
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
backupGlobals="false"
colors="true"
+ failOnNotice="true"
+ failOnWarning="true"
bootstrap="tests/bootstrap.php"
- convertDeprecationsToExceptions="false"
+ cacheDirectory=".phpunit.cache"
>
<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="9.5" />
</php>
<testsuites>
@@ -23,15 +23,11 @@
</testsuite>
</testsuites>
- <coverage processUncoveredFiles="true">
+ <source ignoreSuppressionOfDeprecations="true" restrictNotices="true" restrictWarnings="true">
<include>
- <directory suffix=".php">src</directory>
+ <directory>src</directory>
</include>
- </coverage>
-
- <listeners>
- <listener class="Symfony\Bridge\PhpUnit\SymfonyTestsListener" />
- </listeners>
+ </source>
<extensions>
</extensions>
diff --git a/phpunit/phpunit/9.6/tests/bootstrap.php b/phpunit/phpunit/10.0/tests/bootstrap.php
index 8276338..47a5855 100644
--- a/phpunit/phpunit/9.6/tests/bootstrap.php
+++ b/phpunit/phpunit/10.0/tests/bootstrap.php
@@ -7,3 +7,7 @@ require dirname(__DIR__).'/vendor/autoload.php';
if (method_exists(Dotenv::class, 'bootEnv')) {
(new Dotenv())->bootEnv(dirname(__DIR__).'/.env');
}
+
+if ($_SERVER['APP_DEBUG']) {
+ umask(0000);
+} |
fabpot
approved these changes
Apr 13, 2025
stof
approved these changes
Apr 14, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
failOnNotice
/failOnWarning
options are part of PHPUnit's own recommended configuration file, I think it's worth adding these to our recommendation as wellrestrictDeprecations="true"
only reports deprecations triggered by application code (which is not related to "direct" deprecations). We should not recommend it. PHPUnit 11 comes with the correct alternative (see Add PHPUnit 11 recipe, treat PHPUnitBridge only as a PHPUnit extension #1401)ignoreSuppressionOfDeprecations="true"
is a must-have for Symfony deprecations, given we silence all deprecation triggers.I know we normally don't edit existing recipe versions, but I think especially (2) and (3) are worth considering a bug. Besides this, the PHPUnit 10 recipe is relatively new (#1239)