Permalink
Browse files

DDC-628 - Fix missing precision and scale attributes on doctrine-mapp…

…ing.xsd
  • Loading branch information...
1 parent af76c5f commit f2aacf44c89029caed4a441a001e9ca94e725ae7 @beberlei beberlei committed Jun 13, 2010
View
4 doctrine-mapping.xsd
@@ -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">
View
13 tests/Doctrine/Tests/ORM/Mapping/XmlMappingDriverTest.php
@@ -32,6 +32,19 @@ public function testClassTableInheritanceDiscriminatorMap()
$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
View
7 tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.ORM.Mapping.CTI.dcm.xml
@@ -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"/>
View
8 tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.ORM.Mapping.User.dcm.xml
@@ -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">

0 comments on commit f2aacf4

Please sign in to comment.