Skip to content

Commit 3af12a0

Browse files
hkdobrevfabpot
authored andcommitted
[PhpUnitBridge] Deprecate @expectedDeprecation annotation
1 parent 43ce615 commit 3af12a0

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

Tests/Form/ChoiceList/DoctrineChoiceLoaderTest.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
use Symfony\Bridge\Doctrine\Form\ChoiceList\DoctrineChoiceLoader;
2020
use Symfony\Bridge\Doctrine\Form\ChoiceList\EntityLoaderInterface;
2121
use Symfony\Bridge\Doctrine\Form\ChoiceList\IdReader;
22+
use Symfony\Bridge\PhpUnit\ExpectDeprecationTrait;
2223
use Symfony\Component\Form\ChoiceList\ArrayChoiceList;
2324
use Symfony\Component\Form\ChoiceList\Factory\ChoiceListFactoryInterface;
2425

@@ -27,6 +28,8 @@
2728
*/
2829
class DoctrineChoiceLoaderTest extends TestCase
2930
{
31+
use ExpectDeprecationTrait;
32+
3033
/**
3134
* @var ChoiceListFactoryInterface|MockObject
3235
*/
@@ -192,11 +195,10 @@ public function testLoadValuesForChoicesDoesNotLoadIfEmptyChoices()
192195

193196
/**
194197
* @group legacy
195-
*
196-
* @expectedDeprecation Since symfony/doctrine-bridge 5.1: Not defining explicitly the IdReader as value callback when query can be optimized is deprecated. Don't pass the IdReader to "Symfony\Bridge\Doctrine\Form\ChoiceList\DoctrineChoiceLoader" or define the "choice_value" option instead.
197198
*/
198199
public function testLoadValuesForChoicesDoesNotLoadIfSingleIntId()
199200
{
201+
$this->expectDeprecation('Since symfony/doctrine-bridge 5.1: Not defining explicitly the IdReader as value callback when query can be optimized is deprecated. Don\'t pass the IdReader to "Symfony\Bridge\Doctrine\Form\ChoiceList\DoctrineChoiceLoader" or define the "choice_value" option instead.');
200202
$loader = new DoctrineChoiceLoader(
201203
$this->om,
202204
$this->class,
@@ -295,11 +297,10 @@ public function testLoadChoicesForValuesDoesNotLoadIfEmptyValues()
295297

296298
/**
297299
* @group legacy
298-
*
299-
* @expectedDeprecation Not defining explicitly the IdReader as value callback when query can be optimized has been deprecated in 5.1. Don't pass the IdReader to "Symfony\Bridge\Doctrine\Form\ChoiceList\DoctrineChoiceLoader" or define the choice_value instead.
300300
*/
301301
public function legacyTestLoadChoicesForValuesLoadsOnlyChoicesIfValueUseIdReader()
302302
{
303+
$this->expectDeprecation('Not defining explicitly the IdReader as value callback when query can be optimized has been deprecated in 5.1. Don\'t pass the IdReader to "Symfony\Bridge\Doctrine\Form\ChoiceList\DoctrineChoiceLoader" or define the choice_value instead.');
303304
$loader = new DoctrineChoiceLoader(
304305
$this->om,
305306
$this->class,

0 commit comments

Comments
 (0)