Skip to content

Commit 871f288

Browse files
committed
bug #3182 Drop Symfony PHPUnit Bridge in favor of PHPUnit >= 11.0 (Kocal)
This PR was squashed before being merged into the 3.x branch. Discussion ---------- Drop Symfony PHPUnit Bridge in favor of PHPUnit >= 11.0 | Q | A | -------------- | --- | Bug fix? | yes | New feature? | no <!-- please update src/**/CHANGELOG.md files --> | Deprecations? | no <!-- if yes, also update UPGRADE-*.md and src/**/CHANGELOG.md --> | Documentation? | no <!-- required for new features, or documentation updates --> | Issues | Fix #2784 <!-- prefix each issue number with "Fix #", no need to create an issue if none exist, explain below instead --> | License | MIT <!-- Replace this notice by a description of your feature/bugfix. This will help reviewers and should be a good start for the documentation. Additionally (see https://symfony.com/releases): - Always add tests and ensure they pass. - For new features, provide some code snippets to help understand usage. - Features and deprecations must be submitted against branch main. - Update/add documentation as required (we can help!) - Changelog entry should follow https://symfony.com/doc/current/contributing/code/conventions.html#writing-a-changelog-entry - Never break backward compatibility (see https://symfony.com/bc). --> Commits ------- 165b39b [Vue] Drop Symfony PHPUnit Bridge in favor of PHPUnit >= 11.0 5aa4860 [TwigComponent] Drop Symfony PHPUnit Bridge in favor of PHPUnit >= 11.0 7e19eaa [Turbo] Drop Symfony PHPUnit Bridge in favor of PHPUnit >= 11.0 c96987f [Translator] Drop Symfony PHPUnit Bridge in favor of PHPUnit >= 11.0 0d89567 [Toolkit] Drop Symfony PHPUnit Bridge in favor of PHPUnit >= 11.0 d451bd8 [Svelte] Drop Symfony PHPUnit Bridge in favor of PHPUnit >= 11.0 5bd2f3e [StimulusBundle] Drop Symfony PHPUnit Bridge in favor of PHPUnit >= 11.0 aa484e0 [React] Drop Symfony PHPUnit Bridge in favor of PHPUnit >= 11.0 c4ecc6f [Notify] Drop Symfony PHPUnit Bridge in favor of PHPUnit >= 11.0 0b6a1a6 [Map] Drop Symfony PHPUnit Bridge in favor of PHPUnit >= 11.0 18fbdf9 [LiveComponent] Drop Symfony PHPUnit Bridge in favor of PHPUnit >= 11.0 cbc0f2c [Icons] Drop Symfony PHPUnit Bridge in favor of PHPUnit >= 11.0 f5c1b6d [Dropzone] Drop Symfony PHPUnit Bridge in favor of PHPUnit >= 11.0 871a60f [Cropperjs] Drop Symfony PHPUnit Bridge in favor of PHPUnit >= 11.0 ba7d268 [Chartjs] Drop Symfony PHPUnit Bridge in favor of PHPUnit >= 11.0 22bc86a [Autocomplete] Drop Symfony PHPUnit Bridge in favor of PHPUnit >= 11.0 4458a43 [CI] Prepare migration to PHPUnit >= 11
2 parents 6741aa9 + 165b39b commit 871f288

File tree

127 files changed

+807
-582
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

127 files changed

+807
-582
lines changed

.github/workflows/code-quality.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,6 @@ jobs:
171171
echo COLUMNS=120 >> $GITHUB_ENV
172172
echo COMPOSER_MIN_STAB='composer config minimum-stability ${{ matrix.minimum-stability || 'stable' }} --ansi' >> $GITHUB_ENV
173173
echo COMPOSER_UP='composer update ${{ matrix.dependency-version == 'lowest' && '--prefer-lowest' || '' }} --no-progress --no-interaction --ansi' >> $GITHUB_ENV
174-
echo PHPUNIT_INSTALL='vendor/bin/simple-phpunit install' >> $GITHUB_ENV
175174
echo PHPSTAN='vendor/bin/phpstan' >> $GITHUB_ENV
176175
177176
# TODO: Only Turbo has PHPStan configuration, let's improve this later :)
@@ -211,4 +210,4 @@ jobs:
211210
run: |
212211
source .github/workflows/.utils.sh
213212
214-
echo "$PACKAGES" | xargs -n1 | parallel -j +3 "_run_task {} '(cd src/{} && $COMPOSER_MIN_STAB && $COMPOSER_UP && $PHPUNIT_INSTALL && $PHPSTAN)'"
213+
echo "$PACKAGES" | xargs -n1 | parallel -j +3 "_run_task {} '(cd src/{} && $COMPOSER_MIN_STAB && $COMPOSER_UP && $PHPSTAN)'"

.github/workflows/functional-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,6 @@ jobs:
9393
working-directory: src/Turbo
9494
run: |
9595
[ 'lowest' = '${{ matrix.dependency-version }}' ] && export SYMFONY_DEPRECATIONS_HELPER=weak
96-
vendor/bin/simple-phpunit
96+
vendor/bin/phpunit
9797
env:
9898
SYMFONY_DEPRECATIONS_HELPER: 'max[self]=1'

.github/workflows/unit-tests.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ jobs:
7474
echo COLUMNS=120 >> $GITHUB_ENV
7575
echo COMPOSER_MIN_STAB='composer config minimum-stability ${{ matrix.minimum-stability || 'stable' }} --ansi' >> $GITHUB_ENV
7676
echo COMPOSER_UP='composer update ${{ matrix.dependency-version == 'lowest' && '--prefer-lowest' || '' }} --no-progress --no-interaction --ansi' >> $GITHUB_ENV
77-
echo PHPUNIT='vendor/bin/simple-phpunit ${{ matrix.dependency-version == 'lowest' && '--exclude-group skip-on-lowest' || '' }} ${{ matrix.os == 'windows-latest' && '--exclude-group transient-on-windows' || '' }}' >> $GITHUB_ENV
77+
echo PHPUNIT='vendor/bin/phpunit ${{ matrix.dependency-version == 'lowest' && '--exclude-group skip-on-lowest' || '' }} ${{ matrix.os == 'windows-latest' && '--exclude-group transient-on-windows' || '' }}' >> $GITHUB_ENV
7878
[ 'lowest' = '${{ matrix.dependency-version }}' ] && export SYMFONY_DEPRECATIONS_HELPER=weak
7979
8080
# Turbo has its own workflow file

src/Autocomplete/.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
/vendor/
33
/composer.lock
44
/phpunit.xml
5-
/.phpunit.result.cache
5+
/.phpunit.cache
66

77
/var
8+
/config/reference.php

src/Autocomplete/composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,17 +37,17 @@
3737
"doctrine/orm": "^2.9.4|^3.0",
3838
"fakerphp/faker": "^1.22",
3939
"mtdowling/jmespath.php": "^2.6",
40+
"phpunit/phpunit": "^11.1|^12.0",
4041
"symfony/form": "^7.2|^8.0",
4142
"symfony/options-resolver": "^6.4|^7.0|^8.0",
4243
"symfony/framework-bundle": "^6.4|^7.0|^8.0",
4344
"symfony/maker-bundle": "^1.40",
44-
"symfony/phpunit-bridge": "^7.2|^8.0",
4545
"symfony/process": "^6.4|^7.0|^8.0",
4646
"symfony/security-bundle": "^6.4|^7.0|^8.0",
4747
"symfony/twig-bundle": "^6.4|^7.0|^8.0",
4848
"symfony/uid": "^6.4|^7.0|^8.0",
4949
"twig/twig": "^2.14.7|^3.0.4",
50-
"zenstruck/browser": "^1.1",
50+
"zenstruck/browser": "^1.9",
5151
"zenstruck/foundry": "^2.0"
5252
},
5353
"conflict": {

src/Autocomplete/phpunit.xml.dist renamed to src/Autocomplete/phpunit.dist.xml

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,18 @@
22
<!-- https://phpunit.de/manual/current/en/appendixes.configuration.html -->
33
<phpunit
44
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
5-
xsi:noNamespaceSchemaLocation="vendor/bin/.phpunit/phpunit.xsd"
5+
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
66
colors="true"
7-
bootstrap="vendor/autoload.php"
7+
bootstrap="tests/bootstrap.php"
8+
failOnDeprecation="true"
89
failOnRisky="true"
910
failOnWarning="true"
11+
cacheDirectory=".phpunit.cache"
1012
>
1113
<php>
1214
<ini name="error_reporting" value="-1"/>
1315
<env name="SHELL_VERBOSITY" value="-1"/>
14-
<env name="SYMFONY_DEPRECATIONS_HELPER" value="max[self]=0&amp;max[direct]=0"/>
16+
1517
<env name="KERNEL_CLASS" value="Symfony\UX\Autocomplete\Tests\Fixtures\Kernel"/>
1618
<env name="DATABASE_URL" value="sqlite:///%kernel.project_dir%/var/data.db"/>
1719
</php>
@@ -22,13 +24,18 @@
2224
</testsuite>
2325
</testsuites>
2426

25-
<coverage>
27+
<source
28+
ignoreSuppressionOfDeprecations="true"
29+
ignoreIndirectDeprecations="true"
30+
restrictNotices="true"
31+
restrictWarnings="true"
32+
>
2633
<include>
27-
<directory>./src</directory>
34+
<directory>src</directory>
2835
</include>
29-
</coverage>
3036

31-
<listeners>
32-
<listener class="Symfony\Bridge\PhpUnit\SymfonyTestsListener"/>
33-
</listeners>
37+
<deprecationTrigger>
38+
<function>trigger_deprecation</function>
39+
</deprecationTrigger>
40+
</source>
3441
</phpunit>

src/Autocomplete/tests/Unit/Form/AsEntityAutocompleteFieldTest.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,14 @@
1111

1212
namespace Symfony\UX\Autocomplete\Tests\Unit\Form;
1313

14+
use PHPUnit\Framework\Attributes\DataProvider;
1415
use PHPUnit\Framework\TestCase;
1516
use Symfony\UX\Autocomplete\Form\AsEntityAutocompleteField;
1617
use Symfony\UX\Autocomplete\Tests\Fixtures\Form\ProductType;
1718

1819
class AsEntityAutocompleteFieldTest extends TestCase
1920
{
20-
/**
21-
* @dataProvider provideClassNames
22-
*/
21+
#[DataProvider('provideClassNames')]
2322
public function testShortName(string $shortName, string $className)
2423
{
2524
$this->assertEquals($shortName, AsEntityAutocompleteField::shortName($className));
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <[email protected]>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
12+
use Symfony\Component\ErrorHandler\ErrorHandler;
13+
14+
require __DIR__.'/../vendor/autoload.php';
15+
16+
// @see https://github.com/symfony/symfony/issues/53812
17+
ErrorHandler::register(null, false);

src/Chartjs/.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
/vendor/
33
/composer.lock
44
/phpunit.xml
5-
/.phpunit.result.cache
5+
/.phpunit.cache

src/Chartjs/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@
3535
"symfony/stimulus-bundle": "^2.9.1"
3636
},
3737
"require-dev": {
38+
"phpunit/phpunit": "^11.1|^12.0",
3839
"symfony/framework-bundle": "^6.4|^7.0|^8.0",
39-
"symfony/phpunit-bridge": "^7.2|^8.0",
4040
"symfony/twig-bundle": "^6.4|^7.0|^8.0",
4141
"symfony/var-dumper": "^6.4|^7.0|^8.0"
4242
},

0 commit comments

Comments
 (0)