|
11 | 11 |
|
12 | 12 | namespace Symfony\Bundle\FrameworkBundle\Tests\Console\Descriptor; |
13 | 13 |
|
| 14 | +use Symfony\Bundle\FrameworkBundle\Tests\Fixtures\FooUnitEnum; |
| 15 | +use Symfony\Bundle\FrameworkBundle\Tests\Fixtures\Suit; |
14 | 16 | use Symfony\Component\DependencyInjection\Alias; |
15 | 17 | use Symfony\Component\DependencyInjection\Argument\IteratorArgument; |
16 | 18 | use Symfony\Component\DependencyInjection\ContainerBuilder; |
@@ -61,14 +63,26 @@ public static function getRoutes() |
61 | 63 |
|
62 | 64 | public static function getContainerParameters() |
63 | 65 | { |
64 | | - return [ |
65 | | - 'parameters_1' => new ParameterBag([ |
66 | | - 'integer' => 12, |
67 | | - 'string' => 'Hello world!', |
68 | | - 'boolean' => true, |
69 | | - 'array' => [12, 'Hello world!', true], |
70 | | - ]), |
71 | | - ]; |
| 66 | + yield 'parameters_1' => new ParameterBag([ |
| 67 | + 'integer' => 12, |
| 68 | + 'string' => 'Hello world!', |
| 69 | + 'boolean' => true, |
| 70 | + 'array' => [12, 'Hello world!', true], |
| 71 | + ]); |
| 72 | + |
| 73 | + if (\PHP_VERSION_ID < 80100) { |
| 74 | + return; |
| 75 | + } |
| 76 | + |
| 77 | + yield 'parameters_enums' => new ParameterBag([ |
| 78 | + 'unit_enum' => FooUnitEnum::BAR, |
| 79 | + 'backed_enum' => Suit::Hearts, |
| 80 | + 'array_of_enums' => Suit::cases(), |
| 81 | + 'map' => [ |
| 82 | + 'mixed' => [Suit::Hearts, FooUnitEnum::BAR], |
| 83 | + 'single' => FooUnitEnum::BAR, |
| 84 | + ], |
| 85 | + ]); |
72 | 86 | } |
73 | 87 |
|
74 | 88 | public static function getContainerParameter() |
|
0 commit comments