From 6bb367f48803e187e423ea6296f978c82827c1ee Mon Sep 17 00:00:00 2001
From: Menno Holtkamp <menno.holtkamp@weev.nl>
Date: Thu, 20 Mar 2014 21:29:52 +0100
Subject: [PATCH] Added test to ensure boolean metadata is properly
 exported/serialized to XML

---
 .../AbstractClassMetadataExporterTest.php     | 21 +++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/tests/Doctrine/Tests/ORM/Tools/Export/AbstractClassMetadataExporterTest.php b/tests/Doctrine/Tests/ORM/Tools/Export/AbstractClassMetadataExporterTest.php
index 060345c83..229b3d67a 100644
--- a/tests/Doctrine/Tests/ORM/Tools/Export/AbstractClassMetadataExporterTest.php
+++ b/tests/Doctrine/Tests/ORM/Tools/Export/AbstractClassMetadataExporterTest.php
@@ -209,6 +209,27 @@ abstract class AbstractClassMetadataExporterTest extends \Doctrine\Tests\OrmTest
         return $class;
     }
 
+    /**
+     * @depends testExportDirectoryAndFilesAreCreated
+     */
+    public function testFieldsAreProperlySerialized()
+    {
+        $type = $this->_getType();
+        if ($type == 'xml') {
+            $xml = simplexml_load_file(__DIR__ . '/export/'.$type.'/Doctrine.Tests.ORM.Tools.Export.ExportedUser.dcm.xml');
+
+            $xml->registerXPathNamespace("d", "http://doctrine-project.org/schemas/orm/doctrine-mapping");
+            $nodes = $xml->xpath("/d:doctrine-mapping/d:entity/d:field[@name='name' and @type='string' and @nullable='true']");
+            $this->assertEquals(1, count($nodes));
+
+            $nodes = $xml->xpath("/d:doctrine-mapping/d:entity/d:field[@name='name' and @type='string' and @unique='true']");
+            $this->assertEquals(1, count($nodes));
+        }
+        else {
+            $this->markTestSkipped('Test available only for '.$type.' driver');
+        }
+    }
+
     /**
      * @depends testFieldsAreExported
      * @param ClassMetadataInfo $class