From 7b758eee573a2667fccfe72dabacf3639c960911 Mon Sep 17 00:00:00 2001 From: Benjamin Eberlei Date: Sun, 8 Jul 2012 09:06:52 +0200 Subject: [PATCH] [DDC-1816] Verify XML element works as expected/documented in tests. --- .../Tests/ORM/Mapping/AbstractMappingDriverTest.php | 3 ++- .../Mapping/xml/Doctrine.Tests.ORM.Mapping.Animal.dcm.xml | 3 ++- .../Mapping/yaml/Doctrine.Tests.ORM.Mapping.Animal.dcm.yml | 6 +++++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/tests/Doctrine/Tests/ORM/Mapping/AbstractMappingDriverTest.php b/tests/Doctrine/Tests/ORM/Mapping/AbstractMappingDriverTest.php index e53881a91..fb8525e6e 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/AbstractMappingDriverTest.php +++ b/tests/Doctrine/Tests/ORM/Mapping/AbstractMappingDriverTest.php @@ -334,7 +334,7 @@ abstract class AbstractMappingDriverTest extends \Doctrine\Tests\OrmTestCase $class = $this->createClassMetadata('Doctrine\Tests\ORM\Mapping\Animal'); $this->assertEquals( - array('name' => 'dtype', 'type' => 'string', 'length' => 255, 'fieldName' => 'dtype'), + array('name' => 'discr', 'type' => 'string', 'length' => '32', 'fieldName' => 'discr', 'columnDefinition' => null), $class->discriminatorColumn ); } @@ -941,6 +941,7 @@ class User * @Entity * @InheritanceType("SINGLE_TABLE") * @DiscriminatorMap({"cat" = "Cat", "dog" = "Dog"}) + * @DiscriminatorColumn(name="discr", length=32, type="string") */ abstract class Animal { diff --git a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.ORM.Mapping.Animal.dcm.xml b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.ORM.Mapping.Animal.dcm.xml index 6981d0ba6..3f67a6b82 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.ORM.Mapping.Animal.dcm.xml +++ b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.ORM.Mapping.Animal.dcm.xml @@ -8,9 +8,10 @@ + - \ No newline at end of file + diff --git a/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.ORM.Mapping.Animal.dcm.yml b/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.ORM.Mapping.Animal.dcm.yml index 8fdfe3076..7bdad8240 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.ORM.Mapping.Animal.dcm.yml +++ b/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.ORM.Mapping.Animal.dcm.yml @@ -4,10 +4,14 @@ Doctrine\Tests\ORM\Mapping\Animal: discriminatorMap: cat: Cat dog: Dog + discriminatorColumn: + type: string + name: discr + length: 32 id: id: type: integer generator: strategy: CUSTOM customIdGenerator: - class: stdClass \ No newline at end of file + class: stdClass