test for #1214, XML export the field options
This commit is contained in:
parent
1cc42d6a63
commit
68ed56ce27
@ -76,6 +76,40 @@ class XmlClassMetadataExporterTest extends AbstractClassMetadataExporterTest
|
||||
</id>
|
||||
</entity>
|
||||
</doctrine-mapping>
|
||||
XML;
|
||||
|
||||
$this->assertXmlStringEqualsXmlString($expectedFileContent, $exporter->exportClassMetadata($metadata));
|
||||
}
|
||||
|
||||
/**
|
||||
* @url https://github.com/doctrine/doctrine2/pull/1214
|
||||
*/
|
||||
public function testFieldOptionsExport() {
|
||||
$exporter = new XmlExporter();
|
||||
$metadata = new ClassMetadata('entityTest');
|
||||
|
||||
$metadata->mapField(array(
|
||||
"fieldName" => 'myField',
|
||||
"type" => 'string',
|
||||
"columnName" => 'my_field',
|
||||
"options" => array(
|
||||
"default" => "default_string",
|
||||
"comment" => "The comment for the field",
|
||||
),
|
||||
));
|
||||
|
||||
$expectedFileContent = <<<'XML'
|
||||
<?xml version="1.0" encoding="utf-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="entityTest">
|
||||
<field name="myField" type="string" column="my_field">
|
||||
<options>
|
||||
<option name="default">default_string</option>
|
||||
<option name="comment">The comment for the field</option>
|
||||
</options>
|
||||
</field>
|
||||
</entity>
|
||||
</doctrine-mapping>
|
||||
XML;
|
||||
|
||||
$this->assertXmlStringEqualsXmlString($expectedFileContent, $exporter->exportClassMetadata($metadata));
|
||||
|
Loading…
x
Reference in New Issue
Block a user