DDC-628 - Fix missing precision and scale attributes on doctrine-mapping.xsd
This commit is contained in:
parent
af76c5f867
commit
f2aacf44c8
@ -124,6 +124,8 @@
|
||||
<xs:attribute name="nullable" type="xs:boolean" default="false" />
|
||||
<xs:attribute name="version" type="xs:boolean" />
|
||||
<xs:attribute name="column-definition" type="xs:string" />
|
||||
<xs:attribute name="precision" type="xs:integer" use="optional" />
|
||||
<xs:attribute name="scale" type="xs:integer" use="optional" />
|
||||
</xs:complexType>
|
||||
|
||||
<xs:complexType name="discriminator-column">
|
||||
@ -135,7 +137,7 @@
|
||||
|
||||
<xs:complexType name="unique-constraint">
|
||||
<xs:attribute name="name" type="xs:NMTOKEN" use="optional"/>
|
||||
<xs:attribute name="columns" type="xs:NMTOKENS" use="required"/>
|
||||
<xs:attribute name="columns" type="xs:string" use="required"/>
|
||||
</xs:complexType>
|
||||
|
||||
<xs:complexType name="unique-constraints">
|
||||
|
@ -32,6 +32,19 @@ class XmlMappingDriverTest extends AbstractMappingDriverTest
|
||||
$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
|
||||
|
@ -1,9 +1,10 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping"
|
||||
xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd">
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping
|
||||
http://www.doctrine-project.org/schemas/orm/doctrine-mapping.xsd">
|
||||
<entity name="Doctrine\Tests\ORM\Mapping\CTI">
|
||||
<discriminator-column name="discr" type="string" length=""/>
|
||||
<discriminator-column name="discr" type="string" length="60"/>
|
||||
<discriminator-map>
|
||||
<discriminator-mapping value="foo" class="CTIFoo"/>
|
||||
<discriminator-mapping value="bar" class="CTIBar"/>
|
||||
|
@ -18,8 +18,8 @@
|
||||
</lifecycle-callbacks>
|
||||
|
||||
<id name="id" type="integer" column="id">
|
||||
<sequence-generator sequence-name="tablename_seq" allocation-size="100" initial-value="1" />
|
||||
<generator strategy="AUTO"/>
|
||||
<sequence-generator sequence-name="tablename_seq" allocation-size="100" initial-value="1" />
|
||||
</id>
|
||||
|
||||
<field name="name" column="name" type="string" length="50" nullable="true" unique="true" />
|
||||
@ -31,12 +31,12 @@
|
||||
</one-to-one>
|
||||
|
||||
<one-to-many field="phonenumbers" target-entity="Phonenumber" mapped-by="user">
|
||||
<order-by>
|
||||
<order-by-field name="number" direction="ASC" />
|
||||
</order-by>
|
||||
<cascade>
|
||||
<cascade-persist/>
|
||||
</cascade>
|
||||
<order-by>
|
||||
<order-by-field name="number" direction="ASC" />
|
||||
</order-by>
|
||||
</one-to-many>
|
||||
|
||||
<many-to-many field="groups" target-entity="Group">
|
||||
|
Loading…
Reference in New Issue
Block a user