Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Forward ported PR 570

Change included allows model package name (directory structure) to
contain the `-` (dash) character.
  • Loading branch information...
commit e7c6c723322c5b8ce5dbb2a114c2ac107651ba11 1 parent 00381d6
@mhitza mhitza authored
View
6 resources/xsd/database.xsd
@@ -12,8 +12,8 @@
<xs:simpleType name="file">
<xs:restriction base="xs:string">
- <!-- Match any relative or absolute path and file containing letters, numbers and _ -->
- <xs:pattern value="((\.{1,2}|[\w_]*)/)*([\w_]*\.?)+"/>
+ <!-- Match any relative or absolute path and file containing letters, numbers, - and _ -->
+ <xs:pattern value="((\.{1,2}|[\w_-]*)/)*([\w_-]*\.?)+"/>
</xs:restriction>
</xs:simpleType>
@@ -801,7 +801,7 @@
</xs:documentation>
</xs:annotation>
</xs:attribute>
- <xs:attribute name="package" type="php_class" use="optional">
+ <xs:attribute name="package" type="file" use="optional">
<xs:annotation>
<xs:documentation xml:lang="en">
Specifies the "package" for the generated classes. Classes are created in subdirectories according to the package attribute value.
View
17 tests/Propel/Tests/Generator/Util/SchemaValidatorTest.php
@@ -59,6 +59,23 @@ public function testValidateReturnsTrueForValidSchema()
$this->assertTrue($validator->validate());
}
+ public function testDatabasePackageName()
+ {
+
+ $schema = <<<EOF
+<database name="bookstore" package="my.sub-directory">
+ <table name="book">
+ <column name="id" required="true" primaryKey="true" autoIncrement="true" type="INTEGER" />
+ <column name="title" type="VARCHAR" size="100" primaryString="true" />
+ </table>
+</database>
+EOF;
+ $dom = new \DomDocument('1.0', 'UTF-8');
+ $dom->loadXML($schema);
+
+ $this->assertTrue($dom->schemaValidate(__DIR__.'/../../../../../resources/xsd/database.xsd'));
+ }
+
public function testValidateReturnsFalseWhenTwoTablesHaveSamePhpName()
{
$table1 = new Table('foo');
Please sign in to comment.
Something went wrong with that request. Please try again.