|
20 | 20 | use Symfony\Component\DependencyInjection\Definition;
|
21 | 21 | use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException;
|
22 | 22 | use Symfony\Component\DependencyInjection\Exception\InvalidParameterTypeException;
|
| 23 | +use Symfony\Component\DependencyInjection\Parameter; |
23 | 24 | use Symfony\Component\DependencyInjection\ParameterBag\EnvPlaceholderParameterBag;
|
24 | 25 | use Symfony\Component\DependencyInjection\Reference;
|
25 | 26 | use Symfony\Component\DependencyInjection\Tests\Fixtures\CheckTypeDeclarationsPass\Bar;
|
|
28 | 29 | use Symfony\Component\DependencyInjection\Tests\Fixtures\CheckTypeDeclarationsPass\BarOptionalArgument;
|
29 | 30 | use Symfony\Component\DependencyInjection\Tests\Fixtures\CheckTypeDeclarationsPass\BarOptionalArgumentNotNull;
|
30 | 31 | use Symfony\Component\DependencyInjection\Tests\Fixtures\CheckTypeDeclarationsPass\Deprecated;
|
| 32 | +use Symfony\Component\DependencyInjection\Tests\Fixtures\CheckTypeDeclarationsPass\ExpectsIntegerArgument; |
| 33 | +use Symfony\Component\DependencyInjection\Tests\Fixtures\CheckTypeDeclarationsPass\ExpectsIntegerArgumentWrapper; |
31 | 34 | use Symfony\Component\DependencyInjection\Tests\Fixtures\CheckTypeDeclarationsPass\Foo;
|
32 | 35 | use Symfony\Component\DependencyInjection\Tests\Fixtures\CheckTypeDeclarationsPass\FooObject;
|
33 | 36 | use Symfony\Component\DependencyInjection\Tests\Fixtures\CheckTypeDeclarationsPass\IntersectionConstructor;
|
@@ -642,6 +645,27 @@ public function testProcessSuccessWhenExpressionReturnsObject()
|
642 | 645 | $this->addToAssertionCount(1);
|
643 | 646 | }
|
644 | 647 |
|
| 648 | + public function testErrorOnEvaluatingExpressionDoesNotStopTheProcess() |
| 649 | + { |
| 650 | + $container = new ContainerBuilder(new EnvPlaceholderParameterBag([ |
| 651 | + 'some_int' => '%env(SOME_INT)%', |
| 652 | + ])); |
| 653 | + |
| 654 | + $container |
| 655 | + ->register('eia', ExpectsIntegerArgument::class) |
| 656 | + ->setPublic(true) |
| 657 | + ->setShared(false) |
| 658 | + ->setFactory([ExpectsIntegerArgument::class, 'create']) |
| 659 | + ->addArgument(new Parameter('some_int')); |
| 660 | + $container |
| 661 | + ->register('eia_wrapper', ExpectsIntegerArgumentWrapper::class) |
| 662 | + ->addArgument(new Expression('service("eia").instance()')); |
| 663 | + |
| 664 | + (new CheckTypeDeclarationsPass(true))->process($container); |
| 665 | + |
| 666 | + $this->addToAssertionCount(1); |
| 667 | + } |
| 668 | + |
645 | 669 | public function testProcessHandleMixedEnvPlaceholder()
|
646 | 670 | {
|
647 | 671 | $container = new ContainerBuilder(new EnvPlaceholderParameterBag([
|
|
0 commit comments