Skip to content

Commit a335022

Browse files
committed
run tests using PHPUnit 11.5
1 parent b8be991 commit a335022

File tree

3 files changed

+16
-15
lines changed

3 files changed

+16
-15
lines changed

Tests/Type/CollectionTypeTest.php

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

1212
namespace Symfony\Component\TypeInfo\Tests\Type;
1313

14+
use PHPUnit\Framework\Attributes\Group;
15+
use PHPUnit\Framework\Attributes\IgnoreDeprecations;
1416
use PHPUnit\Framework\TestCase;
15-
use Symfony\Bridge\PhpUnit\ExpectUserDeprecationMessageTrait;
1617
use Symfony\Component\TypeInfo\Exception\InvalidArgumentException;
1718
use Symfony\Component\TypeInfo\Type;
1819
use Symfony\Component\TypeInfo\Type\CollectionType;
@@ -21,8 +22,6 @@
2122

2223
class CollectionTypeTest extends TestCase
2324
{
24-
use ExpectUserDeprecationMessageTrait;
25-
2625
public function testCannotCreateInvalidBuiltinType()
2726
{
2827
$this->expectException(InvalidArgumentException::class);
@@ -126,9 +125,8 @@ public function testAccepts()
126125
$this->assertFalse($type->accepts(new \ArrayObject([0 => true, 1 => 'string'])));
127126
}
128127

129-
/**
130-
* @group legacy
131-
*/
128+
#[IgnoreDeprecations]
129+
#[Group('legacy')]
132130
public function testCannotCreateIterableList()
133131
{
134132
$this->expectUserDeprecationMessage('Since symfony/type-info 7.3: Creating a "Symfony\Component\TypeInfo\Type\CollectionType" that is a list and not an array is deprecated and will throw a "Symfony\Component\TypeInfo\Exception\InvalidArgumentException" in 8.0.');

Tests/TypeFactoryTest.php

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

1212
namespace Symfony\Component\TypeInfo\Tests;
1313

14+
use PHPUnit\Framework\Attributes\Group;
15+
use PHPUnit\Framework\Attributes\IgnoreDeprecations;
1416
use PHPUnit\Framework\TestCase;
15-
use Symfony\Bridge\PhpUnit\ExpectUserDeprecationMessageTrait;
1617
use Symfony\Component\TypeInfo\Tests\Fixtures\DummyBackedEnum;
1718
use Symfony\Component\TypeInfo\Tests\Fixtures\DummyEnum;
1819
use Symfony\Component\TypeInfo\Type;
@@ -31,8 +32,6 @@
3132

3233
class TypeFactoryTest extends TestCase
3334
{
34-
use ExpectUserDeprecationMessageTrait;
35-
3635
public function testCreateBuiltin()
3736
{
3837
$this->assertEquals(new BuiltinType(TypeIdentifier::INT), Type::builtin(TypeIdentifier::INT));
@@ -288,9 +287,8 @@ public function offsetUnset(mixed $offset): void
288287
yield [Type::collection(Type::object($arrayAccess::class)), $arrayAccess];
289288
}
290289

291-
/**
292-
* @group legacy
293-
*/
290+
#[IgnoreDeprecations]
291+
#[Group('legacy')]
294292
public function testCannotCreateIterableList()
295293
{
296294
$this->expectUserDeprecationMessage('Since symfony/type-info 7.3: The third argument of "Symfony\Component\TypeInfo\TypeFactoryTrait::iterable()" is deprecated. Use the "Symfony\Component\TypeInfo\Type::list()" method to create a list instead.');

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)