Skip to content

Commit cb47b1a

Browse files
committed
replace expectDeprecation() with expectUserDeprecationMessage()
1 parent 5df4f84 commit cb47b1a

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

Tests/PropertyInfo/DoctrineExtractorTest.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
use Symfony\Bridge\Doctrine\Tests\PropertyInfo\Fixtures\DoctrineWithEmbedded;
3131
use Symfony\Bridge\Doctrine\Tests\PropertyInfo\Fixtures\EnumInt;
3232
use Symfony\Bridge\Doctrine\Tests\PropertyInfo\Fixtures\EnumString;
33-
use Symfony\Bridge\PhpUnit\ExpectDeprecationTrait;
33+
use Symfony\Bridge\PhpUnit\ExpectUserDeprecationMessageTrait;
3434
use Symfony\Component\PropertyInfo\Type as LegacyType;
3535
use Symfony\Component\TypeInfo\Type;
3636

@@ -39,7 +39,7 @@
3939
*/
4040
class DoctrineExtractorTest extends TestCase
4141
{
42-
use ExpectDeprecationTrait;
42+
use ExpectUserDeprecationMessageTrait;
4343

4444
private function createExtractor(): DoctrineExtractor
4545
{
@@ -117,7 +117,7 @@ public function testTestGetPropertiesWithEmbedded()
117117
*/
118118
public function testExtractLegacy(string $property, ?array $type = null)
119119
{
120-
$this->expectDeprecation('Since symfony/property-info 7.3: The "Symfony\Bridge\Doctrine\PropertyInfo\DoctrineExtractor::getTypes()" method is deprecated, use "Symfony\Bridge\Doctrine\PropertyInfo\DoctrineExtractor::getType()" instead.');
120+
$this->expectUserDeprecationMessage('Since symfony/property-info 7.3: The "Symfony\Bridge\Doctrine\PropertyInfo\DoctrineExtractor::getTypes()" method is deprecated, use "Symfony\Bridge\Doctrine\PropertyInfo\DoctrineExtractor::getType()" instead.');
121121

122122
$this->assertEquals($type, $this->createExtractor()->getTypes(DoctrineDummy::class, $property, []));
123123
}
@@ -127,7 +127,7 @@ public function testExtractLegacy(string $property, ?array $type = null)
127127
*/
128128
public function testExtractWithEmbeddedLegacy()
129129
{
130-
$this->expectDeprecation('Since symfony/property-info 7.3: The "Symfony\Bridge\Doctrine\PropertyInfo\DoctrineExtractor::getTypes()" method is deprecated, use "Symfony\Bridge\Doctrine\PropertyInfo\DoctrineExtractor::getType()" instead.');
130+
$this->expectUserDeprecationMessage('Since symfony/property-info 7.3: The "Symfony\Bridge\Doctrine\PropertyInfo\DoctrineExtractor::getTypes()" method is deprecated, use "Symfony\Bridge\Doctrine\PropertyInfo\DoctrineExtractor::getType()" instead.');
131131

132132
$expectedTypes = [new LegacyType(
133133
LegacyType::BUILTIN_TYPE_OBJECT,
@@ -149,7 +149,7 @@ public function testExtractWithEmbeddedLegacy()
149149
*/
150150
public function testExtractEnumLegacy()
151151
{
152-
$this->expectDeprecation('Since symfony/property-info 7.3: The "Symfony\Bridge\Doctrine\PropertyInfo\DoctrineExtractor::getTypes()" method is deprecated, use "Symfony\Bridge\Doctrine\PropertyInfo\DoctrineExtractor::getType()" instead.');
152+
$this->expectUserDeprecationMessage('Since symfony/property-info 7.3: The "Symfony\Bridge\Doctrine\PropertyInfo\DoctrineExtractor::getTypes()" method is deprecated, use "Symfony\Bridge\Doctrine\PropertyInfo\DoctrineExtractor::getType()" instead.');
153153

154154
$this->assertEquals([new LegacyType(LegacyType::BUILTIN_TYPE_OBJECT, false, EnumString::class)], $this->createExtractor()->getTypes(DoctrineEnum::class, 'enumString', []));
155155
$this->assertEquals([new LegacyType(LegacyType::BUILTIN_TYPE_OBJECT, false, EnumInt::class)], $this->createExtractor()->getTypes(DoctrineEnum::class, 'enumInt', []));
@@ -265,7 +265,7 @@ public function testGetPropertiesCatchException()
265265
*/
266266
public function testGetTypesCatchExceptionLegacy()
267267
{
268-
$this->expectDeprecation('Since symfony/property-info 7.3: The "Symfony\Bridge\Doctrine\PropertyInfo\DoctrineExtractor::getTypes()" method is deprecated, use "Symfony\Bridge\Doctrine\PropertyInfo\DoctrineExtractor::getType()" instead.');
268+
$this->expectUserDeprecationMessage('Since symfony/property-info 7.3: The "Symfony\Bridge\Doctrine\PropertyInfo\DoctrineExtractor::getTypes()" method is deprecated, use "Symfony\Bridge\Doctrine\PropertyInfo\DoctrineExtractor::getType()" instead.');
269269

270270
$this->assertNull($this->createExtractor()->getTypes('Not\Exist', 'baz'));
271271
}

0 commit comments

Comments
 (0)