1
0
mirror of synced 2025-01-19 15:01:40 +03:00

#881 DDC-2825 - testing annotation driver with table name defining schema name as part of the name

This commit is contained in:
Marco Pivetta 2015-01-14 16:47:05 +01:00
parent 8b2b54c033
commit cf641cd0a3
2 changed files with 34 additions and 0 deletions

View File

@ -0,0 +1,20 @@
<?php
namespace Doctrine\Tests\Models\DDC2825;
/**
* Quoted column name to check that sequence names are
* correctly handled
*
* @Entity
* @Table(name="myschema.mytable")
*/
class SchemaAndTableInTableName
{
const CLASSNAME = __CLASS__;
/**
* @Id @Column()
*/
public $id;
}

View File

@ -5,6 +5,7 @@ namespace Doctrine\Tests\ORM\Mapping;
use Doctrine\ORM\Mapping\ClassMetadata;
use Doctrine\ORM\Events;
use Doctrine\Tests\Models\DDC2825\ExplicitSchemaAndTable;
use Doctrine\Tests\Models\DDC2825\SchemaAndTableInTableName;
class AnnotationDriverTest extends AbstractMappingDriverTest
{
@ -244,6 +245,19 @@ class AnnotationDriverTest extends AbstractMappingDriverTest
$this->assertSame('myschema', $metadata->getSchemaName());
$this->assertSame('mytable', $metadata->getTableName());
}
/**
* @group DDC-2825
* @group 881
*/
public function testSchemaDefinitionViaSchemaDefinedInTableNameInTableAnnotationProperty()
{
/* @var $metadata \Doctrine\ORM\Mapping\ClassMetadata */
$metadata = $this->createClassMetadataFactory()->getMetadataFor(SchemaAndTableInTableName::CLASSNAME);
$this->assertSame('myschema', $metadata->getSchemaName());
$this->assertSame('mytable', $metadata->getTableName());
}
}
/**