Added test to ensure boolean metadata is properly exported/serialized to XML
This commit is contained in:
parent
ef4e73f987
commit
6e651b13c9
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user