Skip to content

Commit 91ed6ee

Browse files
committed
[React] Drop Symfony PHPUnit Bridge in favor of PHPUnit >= 11.0
1 parent e6b79cc commit 91ed6ee

File tree

5 files changed

+36
-14
lines changed

5 files changed

+36
-14
lines changed

src/React/.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/React/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@
3232
"symfony/stimulus-bundle": "^2.9.1"
3333
},
3434
"require-dev": {
35+
"phpunit/phpunit": "^11.1|^12.0",
3536
"symfony/asset-mapper": "^6.4|^7.0|^8.0",
3637
"symfony/finder": "^6.4|^7.0|^8.0",
3738
"symfony/framework-bundle": "^6.4|^7.0|^8.0",
38-
"symfony/phpunit-bridge": "^7.2|^8.0",
3939
"symfony/twig-bundle": "^6.4|^7.0|^8.0",
4040
"symfony/var-dumper": "^6.4|^7.0|^8.0"
4141
},

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

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,17 @@
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"/>
1516
</php>
1617

1718
<testsuites>
@@ -20,13 +21,18 @@
2021
</testsuite>
2122
</testsuites>
2223

23-
<coverage>
24+
<source
25+
ignoreSuppressionOfDeprecations="true"
26+
ignoreIndirectDeprecations="true"
27+
restrictNotices="true"
28+
restrictWarnings="true"
29+
>
2430
<include>
25-
<directory>./src</directory>
31+
<directory>src</directory>
2632
</include>
27-
</coverage>
2833

29-
<listeners>
30-
<listener class="Symfony\Bridge\PhpUnit\SymfonyTestsListener"/>
31-
</listeners>
34+
<deprecationTrigger>
35+
<function>trigger_deprecation</function>
36+
</deprecationTrigger>
37+
</source>
3238
</phpunit>

src/React/tests/Twig/ReactComponentExtensionTest.php

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

1212
namespace Symfony\UX\React\Tests\Twig;
1313

14+
use PHPUnit\Framework\Attributes\DataProvider;
1415
use PHPUnit\Framework\TestCase;
1516
use Symfony\UX\React\Tests\Kernel\TwigAppKernel;
1617
use Symfony\UX\React\Twig\ReactComponentExtension;
@@ -41,9 +42,7 @@ public function testRenderComponent()
4142
);
4243
}
4344

44-
/**
45-
* @dataProvider provideOptions
46-
*/
45+
#[DataProvider('provideOptions')]
4746
public function testRenderComponentWithOptions(array $options, string|false $expected)
4847
{
4948
$kernel = new TwigAppKernel('test', true);

src/React/tests/bootstrap.php

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);

0 commit comments

Comments
 (0)