[CI] Fix compatibility issues with Symfony 8 and spatie/phpunit-snapshot-assertions

This commit is contained in:
Hugo Alliaume
2026-01-09 09:45:01 +01:00
parent 97e5fd66c6
commit c14a0907be
3 changed files with 42 additions and 7 deletions

38
phpunit11.dist.xml Normal file
View File

@@ -0,0 +1,38 @@
<?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/phpunit/phpunit/phpunit.xsd"
colors="true"
bootstrap="tests/bootstrap.php"
failOnDeprecation="true"
failOnRisky="true"
failOnWarning="true"
cacheDirectory=".phpunit.cache"
>
<php>
<ini name="error_reporting" value="-1"/>
<env name="SHELL_VERBOSITY" value="-1"/>
</php>
<testsuites>
<testsuite name="Symfony UX Map Test Suite">
<directory>./tests</directory>
</testsuite>
</testsuites>
<source
ignoreSuppressionOfDeprecations="true"
ignoreIndirectDeprecations="true"
restrictNotices="true"
restrictWarnings="true"
>
<include>
<directory>src</directory>
</include>
<deprecationTrigger>
<function>trigger_deprecation</function>
</deprecationTrigger>
</source>
</phpunit>

View File

@@ -21,21 +21,21 @@ use Symfony\UX\Map\Renderer\RendererInterface;
final class NullRendererTest extends TestCase
{
public function provideTestRenderMap(): iterable
public static function provideTestRenderMap(): iterable
{
yield 'no bridges' => [
'expected_exception_message' => 'You must install at least one bridge package to use the Symfony UX Map component.',
'expectedExceptionMessage' => 'You must install at least one bridge package to use the Symfony UX Map component.',
'renderer' => new NullRenderer(),
];
yield 'one bridge' => [
'expected_exception_message' => 'You must install at least one bridge package to use the Symfony UX Map component.'
'expectedExceptionMessage' => 'You must install at least one bridge package to use the Symfony UX Map component.'
.\PHP_EOL.'Try running "composer require symfony/ux-leaflet-map".',
'renderer' => new NullRenderer(['symfony/ux-leaflet-map']),
];
yield 'two bridges' => [
'expected_exception_message' => 'You must install at least one bridge package to use the Symfony UX Map component.'
'expectedExceptionMessage' => 'You must install at least one bridge package to use the Symfony UX Map component.'
.\PHP_EOL.'Try running "composer require symfony/ux-leaflet-map" or "composer require symfony/ux-google-map".',
'renderer' => new NullRenderer(['symfony/ux-leaflet-map', 'symfony/ux-google-map']),
];

View File

@@ -11,7 +11,6 @@
namespace Symfony\UX\Map\Tests\Twig;
use Symfony\Bridge\PhpUnit\ExpectDeprecationTrait;
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
use Symfony\UX\Map\Map;
use Symfony\UX\Map\Point;
@@ -23,8 +22,6 @@ use Twig\Environment;
class MapExtensionTest extends KernelTestCase
{
use ExpectDeprecationTrait;
protected static function getKernelClass(): string
{
return TwigAppKernel::class;