_loadDriver(); $class = new ClassMetadata($className); $mappingDriver->loadMetadataForClass($className, $class); $expectedMap = array( "foo" => "Doctrine\Tests\ORM\Mapping\CTIFoo", "bar" => "Doctrine\Tests\ORM\Mapping\CTIBar", "baz" => "Doctrine\Tests\ORM\Mapping\CTIBaz", ); $this->assertEquals(3, count($class->discriminatorMap)); $this->assertEquals($expectedMap, $class->discriminatorMap); } public function testValidateXmlSchema() { $xsdSchemaFile = __DIR__ . "/../../../../../doctrine-mapping.xsd"; $dom = new \DOMDocument('UTF-8'); $dom->load(__DIR__ . "/xml/Doctrine.Tests.ORM.Mapping.CTI.dcm.xml"); $this->assertTrue($dom->schemaValidate($xsdSchemaFile)); $dom = new \DOMDocument('UTF-8'); $dom->load(__DIR__ . "/xml/Doctrine.Tests.ORM.Mapping.User.dcm.xml"); $this->assertTrue($dom->schemaValidate($xsdSchemaFile)); } } class CTI { public $id; } class CTIFoo extends CTI {} class CTIBar extends CTI {} class CTIBaz extends CTI {}