|
13 | 13 |
|
14 | 14 | use PHPUnit\Framework\TestCase;
|
15 | 15 | use Symfony\Bridge\PhpUnit\ExpectDeprecationTrait;
|
| 16 | +use Symfony\Component\DependencyInjection\Argument\AbstractArgument; |
16 | 17 | use Symfony\Component\DependencyInjection\Argument\BoundArgument;
|
17 | 18 | use Symfony\Component\DependencyInjection\Argument\ServiceLocatorArgument;
|
18 | 19 | use Symfony\Component\DependencyInjection\Argument\TaggedIteratorArgument;
|
@@ -277,11 +278,23 @@ public function testBindWithNamedArgs()
|
277 | 278 | $definition->setArguments(['c' => 'C', 'hostName' => 'H']);
|
278 | 279 | $definition->setBindings($bindings);
|
279 | 280 |
|
280 |
| - $container->register('foo', CaseSensitiveClass::class); |
281 |
| - |
282 | 281 | $pass = new ResolveBindingsPass();
|
283 | 282 | $pass->process($container);
|
284 | 283 |
|
285 | 284 | $this->assertEquals(['C', 'K', 'H'], $definition->getArguments());
|
286 | 285 | }
|
| 286 | + |
| 287 | + public function testAbstractArg() |
| 288 | + { |
| 289 | + $container = new ContainerBuilder(); |
| 290 | + |
| 291 | + $definition = $container->register(NamedArgumentsDummy::class, NamedArgumentsDummy::class); |
| 292 | + $definition->setArguments([new AbstractArgument(), 'apiKey' => new AbstractArgument()]); |
| 293 | + $definition->setBindings(['$c' => new BoundArgument('C'), '$apiKey' => new BoundArgument('K')]); |
| 294 | + |
| 295 | + $pass = new ResolveBindingsPass(); |
| 296 | + $pass->process($container); |
| 297 | + |
| 298 | + $this->assertEquals(['C', 'K'], $definition->getArguments()); |
| 299 | + } |
287 | 300 | }
|
0 commit comments