use PHPUnit\Framework\TestCase;
use Symfony\Component\DependencyInjection\Argument\BoundArgument;
-use Symfony\Component\DependencyInjection\Definition;
use Symfony\Component\DependencyInjection\Compiler\CheckExceptionOnInvalidReferenceBehaviorPass;
-use Symfony\Component\DependencyInjection\Reference;
use Symfony\Component\DependencyInjection\ContainerBuilder;
+use Symfony\Component\DependencyInjection\Definition;
+use Symfony\Component\DependencyInjection\Reference;
class CheckExceptionOnInvalidReferenceBehaviorPassTest extends TestCase
{
$this->process($container);
}
- /**
- * @expectedException \Symfony\Component\DependencyInjection\Exception\InvalidArgumentException
- * @expectedExceptionMessage Invalid ignore-on-uninitialized reference found in service
- */
- public function testProcessThrowsExceptionOnNonSharedUninitializedReference()
- {
- $container = new ContainerBuilder();
-
- $container
- ->register('a', 'stdClass')
- ->addArgument(new Reference('b', $container::IGNORE_ON_UNINITIALIZED_REFERENCE))
- ;
-
- $container
- ->register('b', 'stdClass')
- ->setShared(false)
- ;
-
- $this->process($container);
- }
-
public function testProcessDefinitionWithBindings()
{
$container = new ContainerBuilder();