From 68ed56ce27adf30c77054fc218f80878001ea5d4 Mon Sep 17 00:00:00 2001 From: Fedik Date: Tue, 9 Dec 2014 20:49:51 +0200 Subject: [PATCH] test for #1214, XML export the field options --- .../Export/XmlClassMetadataExporterTest.php | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/tests/Doctrine/Tests/ORM/Tools/Export/XmlClassMetadataExporterTest.php b/tests/Doctrine/Tests/ORM/Tools/Export/XmlClassMetadataExporterTest.php index 0fe58b4ec..c9c3570b4 100644 --- a/tests/Doctrine/Tests/ORM/Tools/Export/XmlClassMetadataExporterTest.php +++ b/tests/Doctrine/Tests/ORM/Tools/Export/XmlClassMetadataExporterTest.php @@ -76,6 +76,40 @@ class XmlClassMetadataExporterTest extends AbstractClassMetadataExporterTest +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; $this->assertXmlStringEqualsXmlString($expectedFileContent, $exporter->exportClassMetadata($metadata));