Updating Media dependent modules to versions compatible with core Media.
[yaffs-website] / vendor / symfony / dependency-injection / Tests / Compiler / ResolveBindingsPassTest.php
index 16e486afafe2e553aed76a176de2124f320d604a..65f5ceb80fd0cf4267c59711560d717c400a76b6 100644 (file)
@@ -18,6 +18,7 @@ use Symfony\Component\DependencyInjection\Compiler\ResolveBindingsPass;
 use Symfony\Component\DependencyInjection\ContainerBuilder;
 use Symfony\Component\DependencyInjection\Reference;
 use Symfony\Component\DependencyInjection\Tests\Fixtures\NamedArgumentsDummy;
+use Symfony\Component\DependencyInjection\Tests\Fixtures\ParentNotExists;
 use Symfony\Component\DependencyInjection\Tests\Fixtures\CaseSensitiveClass;
 use Symfony\Component\DependencyInjection\TypedReference;
 
@@ -61,6 +62,21 @@ class ResolveBindingsPassTest extends TestCase
         $pass->process($container);
     }
 
+    /**
+     * @expectedException \Symfony\Component\DependencyInjection\Exception\InvalidArgumentException
+     * @expectedExceptionMessageRegexp Unused binding "$quz" in service [\s\S]+ Invalid service ".*\\ParentNotExists": class NotExists not found\.
+     */
+    public function testMissingParent()
+    {
+        $container = new ContainerBuilder();
+
+        $definition = $container->register(ParentNotExists::class, ParentNotExists::class);
+        $definition->setBindings(array('$quz' => '123'));
+
+        $pass = new ResolveBindingsPass();
+        $pass->process($container);
+    }
+
     public function testTypedReferenceSupport()
     {
         $container = new ContainerBuilder();