|
19 | 19 | use Symfony\Bridge\Doctrine\Form\ChoiceList\DoctrineChoiceLoader;
|
20 | 20 | use Symfony\Bridge\Doctrine\Form\ChoiceList\EntityLoaderInterface;
|
21 | 21 | use Symfony\Bridge\Doctrine\Form\ChoiceList\IdReader;
|
| 22 | +use Symfony\Bridge\PhpUnit\ExpectDeprecationTrait; |
22 | 23 | use Symfony\Component\Form\ChoiceList\ArrayChoiceList;
|
23 | 24 | use Symfony\Component\Form\ChoiceList\Factory\ChoiceListFactoryInterface;
|
24 | 25 |
|
|
27 | 28 | */
|
28 | 29 | class DoctrineChoiceLoaderTest extends TestCase
|
29 | 30 | {
|
| 31 | + use ExpectDeprecationTrait; |
| 32 | + |
30 | 33 | /**
|
31 | 34 | * @var ChoiceListFactoryInterface|MockObject
|
32 | 35 | */
|
@@ -192,11 +195,10 @@ public function testLoadValuesForChoicesDoesNotLoadIfEmptyChoices()
|
192 | 195 |
|
193 | 196 | /**
|
194 | 197 | * @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. |
197 | 198 | */
|
198 | 199 | public function testLoadValuesForChoicesDoesNotLoadIfSingleIntId()
|
199 | 200 | {
|
| 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.'); |
200 | 202 | $loader = new DoctrineChoiceLoader(
|
201 | 203 | $this->om,
|
202 | 204 | $this->class,
|
@@ -295,11 +297,10 @@ public function testLoadChoicesForValuesDoesNotLoadIfEmptyValues()
|
295 | 297 |
|
296 | 298 | /**
|
297 | 299 | * @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. |
300 | 300 | */
|
301 | 301 | public function legacyTestLoadChoicesForValuesLoadsOnlyChoicesIfValueUseIdReader()
|
302 | 302 | {
|
| 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.'); |
303 | 304 | $loader = new DoctrineChoiceLoader(
|
304 | 305 | $this->om,
|
305 | 306 | $this->class,
|
|
0 commit comments