Skip to content

Commit 096c874

Browse files
committed
run tests using PHPUnit 11.5
1 parent 28aba13 commit 096c874

File tree

4 files changed

+21
-19
lines changed

4 files changed

+21
-19
lines changed

Tests/Extension/Core/EventListener/ResizeFormListenerTest.php

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
namespace Symfony\Component\Form\Tests\Extension\Core\EventListener;
1313

1414
use Doctrine\Common\Collections\ArrayCollection;
15+
use PHPUnit\Framework\Attributes\Group;
16+
use PHPUnit\Framework\Attributes\IgnoreDeprecations;
1517
use PHPUnit\Framework\TestCase;
1618
use Symfony\Component\EventDispatcher\EventDispatcher;
1719
use Symfony\Component\Form\AbstractType;
@@ -43,9 +45,8 @@ protected function getBuilder($name = 'name')
4345
return new FormBuilder($name, null, new EventDispatcher(), $this->factory);
4446
}
4547

46-
/**
47-
* @group legacy
48-
*/
48+
#[IgnoreDeprecations]
49+
#[Group('legacy')]
4950
public function testPreSetDataResizesForm()
5051
{
5152
$this->builder->add($this->getBuilder('0'));
@@ -93,9 +94,8 @@ public function testPostSetDataResizesForm()
9394
$this->assertSame('string', $form->get('2')->getData());
9495
}
9596

96-
/**
97-
* @group legacy
98-
*/
97+
#[IgnoreDeprecations]
98+
#[Group('legacy')]
9999
public function testPreSetDataRequiresArrayOrTraversable()
100100
{
101101
$this->expectException(UnexpectedTypeException::class);
@@ -119,9 +119,8 @@ public function testPostSetDataRequiresArrayOrTraversable()
119119
$listener->postSetData($event);
120120
}
121121

122-
/**
123-
* @group legacy
124-
*/
122+
#[IgnoreDeprecations]
123+
#[Group('legacy')]
125124
public function testPreSetDataDealsWithNullData()
126125
{
127126
$data = null;

Tests/Extension/Core/Type/UrlTypeTest.php

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,17 @@
1111

1212
namespace Symfony\Component\Form\Tests\Extension\Core\Type;
1313

14-
use Symfony\Bridge\PhpUnit\ExpectUserDeprecationMessageTrait;
14+
use PHPUnit\Framework\Attributes\Group;
15+
use PHPUnit\Framework\Attributes\IgnoreDeprecations;
1516
use Symfony\Component\Form\Extension\Core\Type\UrlType;
1617
use Symfony\Component\OptionsResolver\Exception\InvalidOptionsException;
1718

1819
class UrlTypeTest extends TextTypeTest
1920
{
20-
use ExpectUserDeprecationMessageTrait;
21-
2221
public const TESTED_TYPE = UrlType::class;
2322

24-
/**
25-
* @group legacy
26-
*/
23+
#[IgnoreDeprecations]
24+
#[Group('legacy')]
2725
public function testSubmitAddsDefaultProtocolIfNoneIsIncluded()
2826
{
2927
$this->expectUserDeprecationMessage('Since symfony/form 7.1: Not configuring the "default_protocol" option when using the UrlType is deprecated. It will default to "null" in 8.0.');

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
},
2929
"require-dev": {
3030
"doctrine/collections": "^1.0|^2.0",
31-
"symfony/validator": "^6.4|^7.0|^8.0",
31+
"symfony/validator": "^6.4.12|^7.1.5|^8.0",
3232
"symfony/dependency-injection": "^6.4|^7.0|^8.0",
3333
"symfony/expression-language": "^6.4|^7.0|^8.0",
3434
"symfony/clock": "^6.4|^7.0|^8.0",

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)