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

#881 DDC-2825 - annotation mapping tests for explicitly defined schema name on mappings

This commit is contained in:
Marco Pivetta 2015-01-14 16:30:20 +01:00
parent 0dbc6a12ee
commit c6d839869b
2 changed files with 31 additions and 0 deletions

View File

@ -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;
}

View File

@ -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());
}
}
/**