From c6d839869b36c5370a7ed54ee9aa832841ebefb7 Mon Sep 17 00:00:00 2001 From: Marco Pivetta Date: Wed, 14 Jan 2015 16:30:20 +0100 Subject: [PATCH] #881 DDC-2825 - annotation mapping tests for explicitly defined schema name on mappings --- .../Models/DDC2825/ExplicitSchemaAndTable.php | 17 +++++++++++++++++ .../Tests/ORM/Mapping/AnnotationDriverTest.php | 14 ++++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 tests/Doctrine/Tests/Models/DDC2825/ExplicitSchemaAndTable.php diff --git a/tests/Doctrine/Tests/Models/DDC2825/ExplicitSchemaAndTable.php b/tests/Doctrine/Tests/Models/DDC2825/ExplicitSchemaAndTable.php new file mode 100644 index 000000000..73c83b416 --- /dev/null +++ b/tests/Doctrine/Tests/Models/DDC2825/ExplicitSchemaAndTable.php @@ -0,0 +1,17 @@ +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()); + } } /**