Skip to content

Commit b887fce

Browse files
committed
Drop Symfony PHPUnit bridge for PHPUnit
1 parent ab44abf commit b887fce

23 files changed

+176
-129
lines changed

.github/workflows/test.yaml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,13 @@ jobs:
124124

125125
- name: ${{ matrix.component }} Tests
126126
working-directory: "src/${{ matrix.component }}"
127-
run: vendor/bin/simple-phpunit
127+
run: |
128+
# For packages that use the simple-phpunit runner
129+
if [[ -f vendor/bin/simple-phpunit ]]; then
130+
vendor/bin/simple-phpunit
131+
else
132+
vendor/bin/phpunit
133+
fi
128134
129135
tests-js:
130136
runs-on: ubuntu-latest

src/Map/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@
3636
"symfony/stimulus-bundle": "^2.18.1"
3737
},
3838
"require-dev": {
39+
"phpunit/phpunit": "^12.0",
3940
"symfony/asset-mapper": "^6.4|^7.0",
4041
"symfony/framework-bundle": "^6.4|^7.0",
41-
"symfony/phpunit-bridge": "^6.4|^7.0",
4242
"symfony/twig-bundle": "^6.4|^7.0",
4343
"symfony/ux-twig-component": "^2.18",
4444
"symfony/ux-icons": "^2.18"

src/Map/phpunit.xml.dist

Lines changed: 24 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,33 @@
1-
<?xml version="1.0" encoding="UTF-8"?>
1+
<?xml version="1.0" encoding="UTF-8" ?>
22
<!-- https://phpunit.de/manual/current/en/appendixes.configuration.html -->
3-
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4-
xsi:noNamespaceSchemaLocation="vendor/bin/.phpunit/phpunit.xsd"
5-
colors="true"
6-
bootstrap="vendor/autoload.php"
7-
failOnRisky="true"
8-
failOnWarning="true"
3+
<phpunit
4+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
5+
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
6+
colors="true"
7+
bootstrap="tests/bootstrap.php"
8+
failOnRisky="true"
9+
failOnWarning="true"
10+
displayDetailsOnTestsThatTriggerWarnings="true"
911
>
10-
<coverage processUncoveredFiles="true">
11-
<include>
12-
<directory suffix=".php">./src</directory>
13-
</include>
14-
</coverage>
15-
1612
<php>
13+
<ini name="display_errors" value="1"/>
1714
<ini name="error_reporting" value="-1"/>
18-
<server name="SYMFONY_DEPRECATIONS_HELPER" value="max[self]=0&amp;max[direct]=0"/>
15+
<server name="APP_ENV" value="test" force="true"/>
16+
<server name="SHELL_VERBOSITY" value="-1"/>
1917
</php>
2018

19+
<source ignoreSuppressionOfDeprecations="true"
20+
ignoreIndirectDeprecations="true"
21+
>
22+
<include>
23+
<directory>./src</directory>
24+
</include>
25+
26+
<deprecationTrigger>
27+
<function>trigger_deprecation</function>
28+
</deprecationTrigger>
29+
</source>
30+
2131
<testsuites>
2232
<testsuite name="Test Suite">
2333
<directory>tests</directory>

src/Map/src/Bridge/Google/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"symfony/ux-map": "^2.19"
2222
},
2323
"require-dev": {
24-
"symfony/phpunit-bridge": "^6.4|^7.0",
24+
"phpunit/phpunit": "^12.0",
2525
"symfony/ux-icons": "^2.18"
2626
},
2727
"autoload": {
Lines changed: 25 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,36 @@
1-
<?xml version="1.0" encoding="UTF-8"?>
1+
<?xml version="1.0" encoding="UTF-8" ?>
22
<!-- https://phpunit.de/manual/current/en/appendixes.configuration.html -->
3-
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4-
xsi:noNamespaceSchemaLocation="vendor/bin/.phpunit/phpunit.xsd"
5-
colors="true"
6-
bootstrap="vendor/autoload.php"
7-
failOnRisky="true"
8-
failOnWarning="true"
3+
<phpunit
4+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
5+
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
6+
colors="true"
7+
bootstrap="tests/bootstrap.php"
8+
failOnRisky="true"
9+
failOnWarning="true"
10+
displayDetailsOnTestsThatTriggerWarnings="true"
911
>
10-
<coverage processUncoveredFiles="true">
11-
<include>
12-
<directory suffix=".php">./src</directory>
13-
</include>
14-
</coverage>
15-
1612
<php>
13+
<ini name="display_errors" value="1"/>
1714
<ini name="error_reporting" value="-1"/>
18-
<server name="SYMFONY_DEPRECATIONS_HELPER" value="max[self]=0&amp;max[direct]=0"/>
15+
<server name="APP_ENV" value="test" force="true"/>
16+
<server name="SHELL_VERBOSITY" value="-1"/>
1917
</php>
2018

19+
<source ignoreSuppressionOfDeprecations="true"
20+
ignoreIndirectDeprecations="true"
21+
>
22+
<include>
23+
<directory>./src</directory>
24+
</include>
25+
26+
<deprecationTrigger>
27+
<function>trigger_deprecation</function>
28+
</deprecationTrigger>
29+
</source>
30+
2131
<testsuites>
2232
<testsuite name="Test Suite">
23-
<directory>./tests</directory>
33+
<directory>tests</directory>
2434
</testsuite>
2535
</testsuites>
2636
</phpunit>

src/Map/src/Bridge/Google/tests/GoogleRendererTest.php

Lines changed: 14 additions & 14 deletions
Large diffs are not rendered by default.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
use Symfony\Component\ErrorHandler\ErrorHandler;
6+
7+
require dirname(__DIR__).'/vendor/autoload.php';
8+
9+
// Prevent "Test code or tested code did not remove its own exception handlers" errors when booting a kernel.
10+
// @see https://github.com/symfony/symfony/issues/53812#issuecomment-1962740145
11+
set_exception_handler([new ErrorHandler(), 'handleException']);

src/Map/src/Bridge/Leaflet/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"symfony/ux-map": "^2.19"
2222
},
2323
"require-dev": {
24-
"symfony/phpunit-bridge": "^6.4|^7.0",
24+
"phpunit/phpunit": "^12.0",
2525
"symfony/ux-icons": "^2.18"
2626
},
2727
"autoload": {
Lines changed: 25 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,36 @@
1-
<?xml version="1.0" encoding="UTF-8"?>
1+
<?xml version="1.0" encoding="UTF-8" ?>
22
<!-- https://phpunit.de/manual/current/en/appendixes.configuration.html -->
3-
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4-
xsi:noNamespaceSchemaLocation="vendor/bin/.phpunit/phpunit.xsd"
5-
colors="true"
6-
bootstrap="vendor/autoload.php"
7-
failOnRisky="true"
8-
failOnWarning="true"
3+
<phpunit
4+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
5+
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
6+
colors="true"
7+
bootstrap="tests/bootstrap.php"
8+
failOnRisky="true"
9+
failOnWarning="true"
10+
displayDetailsOnTestsThatTriggerWarnings="true"
911
>
10-
<coverage processUncoveredFiles="true">
11-
<include>
12-
<directory suffix=".php">./src</directory>
13-
</include>
14-
</coverage>
15-
1612
<php>
13+
<ini name="display_errors" value="1"/>
1714
<ini name="error_reporting" value="-1"/>
18-
<server name="SYMFONY_DEPRECATIONS_HELPER" value="max[self]=0&amp;max[direct]=0"/>
15+
<server name="APP_ENV" value="test" force="true"/>
16+
<server name="SHELL_VERBOSITY" value="-1"/>
1917
</php>
2018

19+
<source ignoreSuppressionOfDeprecations="true"
20+
ignoreIndirectDeprecations="true"
21+
>
22+
<include>
23+
<directory>./src</directory>
24+
</include>
25+
26+
<deprecationTrigger>
27+
<function>trigger_deprecation</function>
28+
</deprecationTrigger>
29+
</source>
30+
2131
<testsuites>
2232
<testsuite name="Test Suite">
23-
<directory>./tests</directory>
33+
<directory>tests</directory>
2434
</testsuite>
2535
</testsuites>
2636
</phpunit>

0 commit comments

Comments
 (0)