#881 DDC-2825 - annotation mapping tests for explicitly defined schema name on mappings
This commit is contained in:
parent
0dbc6a12ee
commit
c6d839869b
@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
namespace Doctrine\Tests\Models\DDC2825;
|
||||
|
||||
/**
|
||||
* @Entity
|
||||
* @Table(name="mytable2", schema="myschema")
|
||||
*/
|
||||
class ExplicitSchemaAndTable
|
||||
{
|
||||
const CLASSNAME = __CLASS__;
|
||||
|
||||
/**
|
||||
* @Id @Column()
|
||||
*/
|
||||
public $id;
|
||||
}
|
@ -4,6 +4,7 @@ namespace Doctrine\Tests\ORM\Mapping;
|
||||
|
||||
use Doctrine\ORM\Mapping\ClassMetadata;
|
||||
use Doctrine\ORM\Events;
|
||||
use Doctrine\Tests\Models\DDC2825\ExplicitSchemaAndTable;
|
||||
|
||||
class AnnotationDriverTest extends AbstractMappingDriverTest
|
||||
{
|
||||
@ -230,6 +231,19 @@ class AnnotationDriverTest extends AbstractMappingDriverTest
|
||||
$this->assertArrayHasKey('example_trait_bar_id', $metadataWithoutOverride->associationMappings['bar']['joinColumnFieldNames']);
|
||||
$this->assertArrayHasKey('example_entity_overridden_bar_id', $metadataWithOverride->associationMappings['bar']['joinColumnFieldNames']);
|
||||
}
|
||||
|
||||
/**
|
||||
* @group DDC-2825
|
||||
* @group 881
|
||||
*/
|
||||
public function testSchemaDefinitionViaExplicitTableSchemaAnnotationProperty()
|
||||
{
|
||||
/* @var $metadata \Doctrine\ORM\Mapping\ClassMetadata */
|
||||
$metadata = $this->createClassMetadataFactory()->getMetadataFor(ExplicitSchemaAndTable::CLASSNAME);
|
||||
|
||||
$this->assertSame('myschema', $metadata->getSchemaName());
|
||||
$this->assertSame('mytable', $metadata->getTableName());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user