Skip to content

Commit

Permalink
Merge branch 'hotfix/#1216-tests-for-#1214-xml-driver-exporting'
Browse files Browse the repository at this point in the history
Close #1216
Close #1214
  • Loading branch information
Ocramius committed Dec 10, 2014
2 parents 1cc42d6 + b6bbf6a commit 5a6bbbd
Showing 1 changed file with 36 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,42 @@ public function testSequenceGenerator() {
</id>
</entity>
</doctrine-mapping>
XML;

$this->assertXmlStringEqualsXmlString($expectedFileContent, $exporter->exportClassMetadata($metadata));
}

/**
* @group 1214
* @group 1216
* @group DDC-3439
*/
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));
Expand Down

0 comments on commit 5a6bbbd

Please sign in to comment.