DDC-806 - Fix xsd schema not allowing entities without id (in inheritance hierachies)
This commit is contained in:
parent
2e3c1506fb
commit
97e572e2d8
@ -63,7 +63,7 @@
|
||||
<xs:element name="discriminator-column" type="orm:discriminator-column" minOccurs="0"/>
|
||||
<xs:element name="discriminator-map" type="orm:discriminator-map" minOccurs="0"/>
|
||||
<xs:element name="lifecycle-callbacks" type="orm:lifecycle-callbacks" minOccurs="0" maxOccurs="1" />
|
||||
<xs:element name="id" type="orm:id" />
|
||||
<xs:element name="id" type="orm:id" minOccurs="0" maxOccurs="1" />
|
||||
<xs:element name="field" type="orm:field" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="one-to-one" type="orm:one-to-one" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="one-to-many" type="orm:one-to-many" minOccurs="0" maxOccurs="unbounded" />
|
||||
|
@ -33,18 +33,27 @@ class XmlMappingDriverTest extends AbstractMappingDriverTest
|
||||
$this->assertEquals($expectedMap, $class->discriminatorMap);
|
||||
}
|
||||
|
||||
public function testValidateXmlSchema()
|
||||
/**
|
||||
* @param string $xmlMappingFile
|
||||
* @dataProvider dataValidSchema
|
||||
*/
|
||||
public function testValidateXmlSchema($xmlMappingFile)
|
||||
{
|
||||
$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");
|
||||
$dom->load($xmlMappingFile);
|
||||
$this->assertTrue($dom->schemaValidate($xsdSchemaFile));
|
||||
}
|
||||
|
||||
static public function dataValidSchema()
|
||||
{
|
||||
return array(
|
||||
array(__DIR__ . "/xml/Doctrine.Tests.ORM.Mapping.CTI.dcm.xml"),
|
||||
array(__DIR__ . "/xml/Doctrine.Tests.ORM.Mapping.User.dcm.xml"),
|
||||
array(__DIR__ . "/xml/CatNoId.dcm.xml"),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class CTI
|
||||
|
8
tests/Doctrine/Tests/ORM/Mapping/xml/CatNoId.dcm.xml
Normal file
8
tests/Doctrine/Tests/ORM/Mapping/xml/CatNoId.dcm.xml
Normal file
@ -0,0 +1,8 @@
|
||||
<doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping
|
||||
http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd">
|
||||
<entity name="CatNoId">
|
||||
<field name="can_has_cheezburgers" type="boolean" />
|
||||
</entity>
|
||||
</doctrine-mapping>
|
Loading…
x
Reference in New Issue
Block a user