浏览代码

simplified Doctrine unit tests

Fabien Potencier 14 年之前
父节点
当前提交
12f3497281

+ 1 - 5
src/Symfony/Bundle/DoctrineBundle/Tests/ContainerTest.php

@@ -11,7 +11,6 @@
 
 namespace Symfony\Bundle\DoctrineBundle\Tests;
 
-use Symfony\Component\DependencyInjection\Dumper\PhpDumper;
 use Symfony\Component\DependencyInjection\ContainerBuilder;
 use Symfony\Component\DependencyInjection\ParameterBag\ParameterBag;
 use Symfony\Bundle\DoctrineBundle\DependencyInjection\DoctrineExtension;
@@ -46,10 +45,7 @@ class ContainerTest extends TestCase
 
         $container->setDefinition('my.platform', new \Symfony\Component\DependencyInjection\Definition('Doctrine\DBAL\Platforms\MySqlPlatform'));
 
-        $dumper = new PhpDumper($container);
-        $code = $dumper->dump(array('class' => 'DoctrineBundleTestsProjectServiceContainer'));
-        eval(str_replace('<?php', null, $code));
-        return new \DoctrineBundleTestsProjectServiceContainer;
+        return $container;
     }
 
     public function testContainer()

+ 1 - 5
src/Symfony/Bundle/DoctrineMongoDBBundle/Tests/ContainerTest.php

@@ -11,7 +11,6 @@
 
 namespace Symfony\Bundle\DoctrineMongoDBBundle\Tests;
 
-use Symfony\Component\DependencyInjection\Dumper\PhpDumper;
 use Symfony\Component\DependencyInjection\ContainerBuilder;
 use Symfony\Component\DependencyInjection\ParameterBag\ParameterBag;
 use Symfony\Bundle\DoctrineMongoDBBundle\DependencyInjection\DoctrineMongoDBExtension;
@@ -30,10 +29,7 @@ class ContainerTest extends TestCase
         $container->registerExtension($loader);
         $loader->mongodbLoad(array('mappings' => array('YamlBundle' => array())), $container);
 
-        $dumper = new PhpDumper($container);
-        $code = $dumper->dump(array('class' => 'DoctrineMongoDBBundleTestsProjectServiceContainer'));
-        eval(str_replace('<?php', null, $code));
-        return new \DoctrineMongoDBBundleTestsProjectServiceContainer;
+        return $container;
     }
 
     public function testContainer()