Updating Media dependent modules to versions compatible with core Media.
[yaffs-website] / vendor / symfony / dependency-injection / Tests / Compiler / ResolveChildDefinitionsPassTest.php
index 23a1915fd777c8dac4b38d363798ab47c1f27820..18c0fb7c5987fc6e680bb6c60d9464ae45137616 100644 (file)
@@ -382,6 +382,27 @@ class ResolveChildDefinitionsPassTest extends TestCase
         $this->assertSame(array(2, 1, 'foo' => 3), $def->getArguments());
     }
 
+    public function testBindings()
+    {
+        $container = new ContainerBuilder();
+
+        $container->register('parent', 'stdClass')
+            ->setBindings(array('a' => '1', 'b' => '2'))
+        ;
+
+        $child = $container->setDefinition('child', new ChildDefinition('parent'))
+            ->setBindings(array('b' => 'B', 'c' => 'C'))
+        ;
+
+        $this->process($container);
+
+        $bindings = array();
+        foreach ($container->getDefinition('child')->getBindings() as $k => $v) {
+            $bindings[$k] = $v->getValues()[0];
+        }
+        $this->assertEquals(array('b' => 'B', 'c' => 'C', 'a' => '1'), $bindings);
+    }
+
     public function testSetAutoconfiguredOnServiceIsParent()
     {
         $container = new ContainerBuilder();