Skip to content

Commit 22bc86a

Browse files
committed
[Autocomplete] Drop Symfony PHPUnit Bridge in favor of PHPUnit >= 11.0
1 parent 4458a43 commit 22bc86a

File tree

5 files changed

+39
-15
lines changed

5 files changed

+39
-15
lines changed

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

0 commit comments

Comments
 (0)