Skip to content

Drop Symfony PHPUnit bridge for PHPUnit on UX packages PHP >= 8.3 #2659

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

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,13 @@ jobs:

- name: ${{ matrix.component }} Tests
working-directory: "src/${{ matrix.component }}"
run: vendor/bin/simple-phpunit
run: |
# For packages that use the simple-phpunit runner
if [[ -f vendor/bin/simple-phpunit ]]; then
vendor/bin/simple-phpunit
else
vendor/bin/phpunit
fi

tests-js:
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion src/Map/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@
"symfony/stimulus-bundle": "^2.18.1"
},
"require-dev": {
"phpunit/phpunit": "^12.0",
"symfony/asset-mapper": "^6.4|^7.0",
"symfony/framework-bundle": "^6.4|^7.0",
"symfony/phpunit-bridge": "^6.4|^7.0",
"symfony/twig-bundle": "^6.4|^7.0",
"symfony/ux-twig-component": "^2.18",
"symfony/ux-icons": "^2.18"
Expand Down
38 changes: 24 additions & 14 deletions src/Map/phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,23 +1,33 @@
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8" ?>
<!-- https://phpunit.de/manual/current/en/appendixes.configuration.html -->
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="vendor/bin/.phpunit/phpunit.xsd"
colors="true"
bootstrap="vendor/autoload.php"
failOnRisky="true"
failOnWarning="true"
<phpunit
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
colors="true"
bootstrap="tests/bootstrap.php"
failOnRisky="true"
failOnWarning="true"
displayDetailsOnTestsThatTriggerWarnings="true"
>
<coverage processUncoveredFiles="true">
<include>
<directory suffix=".php">./src</directory>
</include>
</coverage>

<php>
<ini name="display_errors" value="1"/>
<ini name="error_reporting" value="-1"/>
<server name="SYMFONY_DEPRECATIONS_HELPER" value="max[self]=0&amp;max[direct]=0"/>
<server name="APP_ENV" value="test" force="true"/>
<server name="SHELL_VERBOSITY" value="-1"/>
</php>

<source ignoreSuppressionOfDeprecations="true"
ignoreIndirectDeprecations="true"
>
<include>
<directory>./src</directory>
</include>

<deprecationTrigger>
<function>trigger_deprecation</function>
</deprecationTrigger>
</source>

<testsuites>
<testsuite name="Test Suite">
<directory>tests</directory>
Expand Down
2 changes: 1 addition & 1 deletion src/Map/src/Bridge/Google/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"symfony/ux-map": "^2.19"
},
"require-dev": {
"symfony/phpunit-bridge": "^6.4|^7.0",
"phpunit/phpunit": "^12.0",
"symfony/ux-icons": "^2.18"
},
"autoload": {
Expand Down
40 changes: 25 additions & 15 deletions src/Map/src/Bridge/Google/phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,26 +1,36 @@
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8" ?>
<!-- https://phpunit.de/manual/current/en/appendixes.configuration.html -->
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="vendor/bin/.phpunit/phpunit.xsd"
colors="true"
bootstrap="vendor/autoload.php"
failOnRisky="true"
failOnWarning="true"
<phpunit
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
colors="true"
bootstrap="tests/bootstrap.php"
failOnRisky="true"
failOnWarning="true"
displayDetailsOnTestsThatTriggerWarnings="true"
>
<coverage processUncoveredFiles="true">
<include>
<directory suffix=".php">./src</directory>
</include>
</coverage>

<php>
<ini name="display_errors" value="1"/>
<ini name="error_reporting" value="-1"/>
<server name="SYMFONY_DEPRECATIONS_HELPER" value="max[self]=0&amp;max[direct]=0"/>
<server name="APP_ENV" value="test" force="true"/>
<server name="SHELL_VERBOSITY" value="-1"/>
</php>

<source ignoreSuppressionOfDeprecations="true"
ignoreIndirectDeprecations="true"
>
<include>
<directory>./src</directory>
</include>

<deprecationTrigger>
<function>trigger_deprecation</function>
</deprecationTrigger>
</source>

<testsuites>
<testsuite name="Test Suite">
<directory>./tests</directory>
<directory>tests</directory>
</testsuite>
</testsuites>
</phpunit>
30 changes: 15 additions & 15 deletions src/Map/src/Bridge/Google/tests/GoogleRendererTest.php

Large diffs are not rendered by default.

20 changes: 20 additions & 0 deletions src/Map/src/Bridge/Google/tests/bootstrap.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?php

declare(strict_types=1);

/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

use Symfony\Component\ErrorHandler\ErrorHandler;

require dirname(__DIR__).'/vendor/autoload.php';

// Prevent "Test code or tested code did not remove its own exception handlers" errors when booting a kernel.
// @see https://github.com/symfony/symfony/issues/53812#issuecomment-1962740145
set_exception_handler([new ErrorHandler(), 'handleException']);
2 changes: 1 addition & 1 deletion src/Map/src/Bridge/Leaflet/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"symfony/ux-map": "^2.19"
},
"require-dev": {
"symfony/phpunit-bridge": "^6.4|^7.0",
"phpunit/phpunit": "^12.0",
"symfony/ux-icons": "^2.18"
},
"autoload": {
Expand Down
40 changes: 25 additions & 15 deletions src/Map/src/Bridge/Leaflet/phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,26 +1,36 @@
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8" ?>
<!-- https://phpunit.de/manual/current/en/appendixes.configuration.html -->
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="vendor/bin/.phpunit/phpunit.xsd"
colors="true"
bootstrap="vendor/autoload.php"
failOnRisky="true"
failOnWarning="true"
<phpunit
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
colors="true"
bootstrap="tests/bootstrap.php"
failOnRisky="true"
failOnWarning="true"
displayDetailsOnTestsThatTriggerWarnings="true"
>
<coverage processUncoveredFiles="true">
<include>
<directory suffix=".php">./src</directory>
</include>
</coverage>

<php>
<ini name="display_errors" value="1"/>
<ini name="error_reporting" value="-1"/>
<server name="SYMFONY_DEPRECATIONS_HELPER" value="max[self]=0&amp;max[direct]=0"/>
<server name="APP_ENV" value="test" force="true"/>
<server name="SHELL_VERBOSITY" value="-1"/>
</php>

<source ignoreSuppressionOfDeprecations="true"
ignoreIndirectDeprecations="true"
>
<include>
<directory>./src</directory>
</include>

<deprecationTrigger>
<function>trigger_deprecation</function>
</deprecationTrigger>
</source>

<testsuites>
<testsuite name="Test Suite">
<directory>./tests</directory>
<directory>tests</directory>
</testsuite>
</testsuites>
</phpunit>
Loading
Loading