1
0
mirror of synced 2025-03-21 23:43:53 +03:00

DDC-3272 - cleanups, importing classes, optimized imports

This commit is contained in:
Marco Pivetta 2014-09-10 16:41:49 +02:00
parent b9090ef73e
commit ffe38e5088

View File

@ -2,13 +2,15 @@
namespace Doctrine\Tests\ORM\Tools; namespace Doctrine\Tests\ORM\Tools;
use Doctrine\ORM\Tools\SchemaTool; use Doctrine\Common\Annotations\AnnotationReader;
use Doctrine\ORM\Tools\EntityGenerator; use Doctrine\Common\Persistence\Mapping\RuntimeReflectionService;
use Doctrine\ORM\Tools\Export\ClassMetadataExporter; use Doctrine\ORM\Mapping\ClassMetadata;
use Doctrine\ORM\Mapping\ClassMetadataInfo;
use Doctrine\ORM\Mapping\ClassMetadataFactory; use Doctrine\ORM\Mapping\ClassMetadataFactory;
use Doctrine\Tests\Models\DDC2372\DDC2372User; use Doctrine\ORM\Mapping\ClassMetadataInfo;
use Doctrine\ORM\Mapping\Driver\AnnotationDriver;
use Doctrine\ORM\Tools\EntityGenerator;
use Doctrine\Tests\Models\DDC2372\DDC2372Admin; use Doctrine\Tests\Models\DDC2372\DDC2372Admin;
use Doctrine\Tests\Models\DDC2372\DDC2372User;
class EntityGeneratorTest extends \Doctrine\Tests\OrmTestCase class EntityGeneratorTest extends \Doctrine\Tests\OrmTestCase
{ {
@ -245,8 +247,8 @@ class EntityGeneratorTest extends \Doctrine\Tests\OrmTestCase
$book = $this->newInstance($metadata); $book = $this->newInstance($metadata);
$cm = new \Doctrine\ORM\Mapping\ClassMetadata($metadata->name); $cm = new ClassMetadata($metadata->name);
$cm->initializeReflection(new \Doctrine\Common\Persistence\Mapping\RuntimeReflectionService); $cm->initializeReflection(new RuntimeReflectionService);
$driver = $this->createAnnotationDriver(); $driver = $this->createAnnotationDriver();
$driver->loadMetadataForClass($cm->name, $cm); $driver->loadMetadataForClass($cm->name, $cm);
@ -266,13 +268,13 @@ class EntityGeneratorTest extends \Doctrine\Tests\OrmTestCase
$this->_generator->setAnnotationPrefix('ORM\\'); $this->_generator->setAnnotationPrefix('ORM\\');
$metadata = $this->generateBookEntityFixture(); $metadata = $this->generateBookEntityFixture();
$reader = new \Doctrine\Common\Annotations\AnnotationReader(); $reader = new AnnotationReader();
$driver = new \Doctrine\ORM\Mapping\Driver\AnnotationDriver($reader, array()); $driver = new AnnotationDriver($reader, array());
$book = $this->newInstance($metadata); $book = $this->newInstance($metadata);
$cm = new \Doctrine\ORM\Mapping\ClassMetadata($metadata->name); $cm = new ClassMetadata($metadata->name);
$cm->initializeReflection(new \Doctrine\Common\Persistence\Mapping\RuntimeReflectionService); $cm->initializeReflection(new RuntimeReflectionService);
$driver->loadMetadataForClass($cm->name, $cm); $driver->loadMetadataForClass($cm->name, $cm);
@ -300,14 +302,11 @@ class EntityGeneratorTest extends \Doctrine\Tests\OrmTestCase
// force instantiation (causes autoloading to kick in) // force instantiation (causes autoloading to kick in)
$this->newInstance($metadata); $this->newInstance($metadata);
$driver = new \Doctrine\ORM\Mapping\Driver\AnnotationDriver( $cm = new ClassMetadata($metadata->name);
new \Doctrine\Common\Annotations\AnnotationReader(),
array()
);
$cm = new \Doctrine\ORM\Mapping\ClassMetadata($metadata->name); $cm->initializeReflection(new RuntimeReflectionService);
$cm->initializeReflection(new \Doctrine\Common\Persistence\Mapping\RuntimeReflectionService); $driver = new AnnotationDriver(new AnnotationReader(), array());
$driver->loadMetadataForClass($cm->name, $cm); $driver->loadMetadataForClass($cm->name, $cm);