File tree Expand file tree Collapse file tree 3 files changed +16
-15
lines changed
Expand file tree Collapse file tree 3 files changed +16
-15
lines changed Original file line number Diff line number Diff line change 1111
1212namespace Symfony \Component \TypeInfo \Tests \Type ;
1313
14+ use PHPUnit \Framework \Attributes \Group ;
15+ use PHPUnit \Framework \Attributes \IgnoreDeprecations ;
1416use PHPUnit \Framework \TestCase ;
15- use Symfony \Bridge \PhpUnit \ExpectUserDeprecationMessageTrait ;
1617use Symfony \Component \TypeInfo \Exception \InvalidArgumentException ;
1718use Symfony \Component \TypeInfo \Type ;
1819use Symfony \Component \TypeInfo \Type \CollectionType ;
2122
2223class 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. ' );
Original file line number Diff line number Diff line change 1111
1212namespace Symfony \Component \TypeInfo \Tests ;
1313
14+ use PHPUnit \Framework \Attributes \Group ;
15+ use PHPUnit \Framework \Attributes \IgnoreDeprecations ;
1416use PHPUnit \Framework \TestCase ;
15- use Symfony \Bridge \PhpUnit \ExpectUserDeprecationMessageTrait ;
1617use Symfony \Component \TypeInfo \Tests \Fixtures \DummyBackedEnum ;
1718use Symfony \Component \TypeInfo \Tests \Fixtures \DummyEnum ;
1819use Symfony \Component \TypeInfo \Type ;
3132
3233class 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. ' );
Original file line number Diff line number Diff line change 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 >
1819 </testsuite >
1920 </testsuites >
2021
21- <coverage >
22+ <source ignoreSuppressionOfDeprecations = " true " >
2223 <include >
2324 <directory >./</directory >
2425 </include >
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 >
You can’t perform that action at this time.
0 commit comments