1
0
mirror of synced 2025-01-18 14:31:40 +03:00

Fix failing test due to EntityGenerator assuming beginning with 2.2 the AnnotationReader is always used. There is still the simple reader though.

This commit is contained in:
Benjamin Eberlei 2011-10-15 20:41:07 +02:00
parent 75e1d17d18
commit 7b71b3284d
2 changed files with 6 additions and 5 deletions

View File

@ -304,9 +304,6 @@ public function <methodName>()
*/
public function setAnnotationPrefix($prefix)
{
if (version_compare(\Doctrine\Common\Version::VERSION, '2.2.0-DEV', '>=')) {
return;
}
$this->_annotationsPrefix = $prefix;
}

View File

@ -98,6 +98,8 @@ abstract class AbstractClassMetadataExporterTest extends \Doctrine\Tests\OrmTest
public function testExportDirectoryAndFilesAreCreated()
{
$this->_deleteDirectory(__DIR__ . '/export/'.$this->_getType());
$type = $this->_getType();
$metadataDriver = $this->_createMetadataDriver($type, __DIR__ . '/' . $type);
$em = $this->_createEntityManager($metadataDriver);
@ -113,6 +115,7 @@ abstract class AbstractClassMetadataExporterTest extends \Doctrine\Tests\OrmTest
$exporter = $cme->getExporter($type, __DIR__ . '/export/' . $type);
if ($type === 'annotation') {
$entityGenerator = new EntityGenerator();
$entityGenerator->setAnnotationPrefix("");
$exporter->setEntityGenerator($entityGenerator);
}
$this->_extension = $exporter->getExtension();
@ -139,6 +142,8 @@ abstract class AbstractClassMetadataExporterTest extends \Doctrine\Tests\OrmTest
$cmf = $this->_createClassMetadataFactory($em, $type);
$metadata = $cmf->getAllMetadata();
$this->assertEquals(1, count($metadata));
$class = current($metadata);
$this->assertEquals('Doctrine\Tests\ORM\Tools\Export\ExportedUser', $class->name);
@ -322,8 +327,7 @@ abstract class AbstractClassMetadataExporterTest extends \Doctrine\Tests\OrmTest
public function __destruct()
{
$type = $this->_getType();
$this->_deleteDirectory(__DIR__ . '/export/'.$this->_getType());
# $this->_deleteDirectory(__DIR__ . '/export/'.$this->_getType());
}
protected function _deleteDirectory($path)