Skip to content

Commit 090eb38

Browse files
committed
run tests using PHPUnit 11.5
1 parent 54ec94a commit 090eb38

File tree

3 files changed

+18
-9
lines changed

3 files changed

+18
-9
lines changed

Tests/Command/LintCommandTest.php

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

1212
namespace Symfony\Bridge\Twig\Tests\Command;
1313

14+
use PHPUnit\Framework\Attributes\Group;
15+
use PHPUnit\Framework\Attributes\IgnoreDeprecations;
1416
use PHPUnit\Framework\TestCase;
1517
use Symfony\Bridge\Twig\Command\LintCommand;
1618
use Symfony\Component\Console\Application;
@@ -71,10 +73,10 @@ public function testLintFileCompileTimeException()
7173
}
7274

7375
/**
74-
* When deprecations are not reported by the command, the testsuite reporter will catch them so we need to mark the test as legacy.
75-
*
76-
* @group legacy
76+
* When deprecations are not reported by the command, the testsuite reporter will catch them so we need to mark the test as ignoring deprecations.
7777
*/
78+
#[IgnoreDeprecations]
79+
#[Group('legacy')]
7880
public function testLintFileWithNotReportedDeprecation()
7981
{
8082
$tester = $this->createCommandTester();

Tests/Validator/Constraints/TwigValidatorTest.php

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

1212
namespace Symfony\Bridge\Twig\Tests\Validator\Constraints;
1313

14+
use PHPUnit\Framework\Attributes\Group;
15+
use PHPUnit\Framework\Attributes\IgnoreDeprecations;
1416
use Symfony\Bridge\Twig\Validator\Constraints\Twig;
1517
use Symfony\Bridge\Twig\Validator\Constraints\TwigValidator;
1618
use Symfony\Component\Validator\Test\ConstraintValidatorTestCase;
@@ -66,10 +68,10 @@ public function testInvalidValues($value, $message, $line)
6668
}
6769

6870
/**
69-
* When deprecations are skipped by the validator, the testsuite reporter will catch them so we need to mark the test as legacy.
70-
*
71-
* @group legacy
71+
* When deprecations are skipped by the validator, the testsuite reporter will catch them so we need to mark the test as ignoring deprecations.
7272
*/
73+
#[IgnoreDeprecations]
74+
#[Group('legacy')]
7375
public function testTwigWithSkipDeprecation()
7476
{
7577
$constraint = new Twig(skipDeprecations: true);

phpunit.xml.dist

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22

33
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4-
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/9.3/phpunit.xsd"
4+
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/11.3/phpunit.xsd"
55
backupGlobals="false"
66
colors="true"
77
bootstrap="vendor/autoload.php"
8+
failOnDeprecation="true"
89
failOnRisky="true"
910
failOnWarning="true"
1011
>
@@ -18,7 +19,7 @@
1819
</testsuite>
1920
</testsuites>
2021

21-
<coverage>
22+
<source ignoreSuppressionOfDeprecations="true">
2223
<include>
2324
<directory>./</directory>
2425
</include>
@@ -27,5 +28,9 @@
2728
<directory>./Tests</directory>
2829
<directory>./vendor</directory>
2930
</exclude>
30-
</coverage>
31+
</source>
32+
33+
<extensions>
34+
<bootstrap class="Symfony\Bridge\PhpUnit\SymfonyExtension" />
35+
</extensions>
3136
</phpunit>

0 commit comments

Comments
 (0)