1
0
mirror of synced 2025-01-19 06:51:40 +03:00

test for #1214, XML export the field options

This commit is contained in:
Fedik 2014-12-09 20:49:51 +02:00
parent 1cc42d6a63
commit 68ed56ce27

View File

@ -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));