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:
parent
75e1d17d18
commit
7b71b3284d
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user