Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / vendor / symfony / dependency-injection / Tests / Compiler / CheckDefinitionValidityPassTest.php
index 585bb357669b4f6258941be4e09544b6ff86ec95..f698ed02dc744d766a8de648ed23135ae04c546f 100644 (file)
@@ -76,6 +76,42 @@ class CheckDefinitionValidityPassTest extends TestCase
         $this->process($container);
     }
 
+    /**
+     * @expectedException \Symfony\Component\DependencyInjection\Exception\EnvParameterException
+     */
+    public function testDynamicPublicServiceName()
+    {
+        $container = new ContainerBuilder();
+        $env = $container->getParameterBag()->get('env(BAR)');
+        $container->register("foo.$env", 'class')->setPublic(true);
+
+        $this->process($container);
+    }
+
+    /**
+     * @expectedException \Symfony\Component\DependencyInjection\Exception\EnvParameterException
+     */
+    public function testDynamicPublicAliasName()
+    {
+        $container = new ContainerBuilder();
+        $env = $container->getParameterBag()->get('env(BAR)');
+        $container->setAlias("foo.$env", 'class')->setPublic(true);
+
+        $this->process($container);
+    }
+
+    public function testDynamicPrivateName()
+    {
+        $container = new ContainerBuilder();
+        $env = $container->getParameterBag()->get('env(BAR)');
+        $container->register("foo.$env", 'class');
+        $container->setAlias("bar.$env", 'class');
+
+        $this->process($container);
+
+        $this->addToAssertionCount(1);
+    }
+
     protected function process(ContainerBuilder $container)
     {
         $pass = new CheckDefinitionValidityPass();