Commit 7220cb2e authored by beberlei's avatar beberlei

DDC-118 - Fixed introduced regression and added tests for future

parent 3678b651
......@@ -279,7 +279,7 @@ class MySqlPlatform extends AbstractPlatform
*/
public function getDateTimeTypeDeclarationSql(array $fieldDeclaration)
{
if (isset($fieldDeclaration['version'])) {
if (isset($fieldDeclaration['version']) && $fieldDeclaration['version'] == true) {
return 'TIMESTAMP';
} else {
return 'DATETIME';
......
......@@ -195,4 +195,14 @@ class MySqlPlatformTest extends \Doctrine\Tests\DbalTestCase
$sql = $this->_platform->modifyLimitQuery('SELECT * FROM user', 10);
$this->assertEquals('SELECT * FROM user LIMIT 10', $sql);
}
/**
* @group DDC-118
*/
public function testGetDateTimeTypeDeclarationSql()
{
$this->assertEquals("DATETIME", $this->_platform->getDateTimeTypeDeclarationSql(array('version' => false)));
$this->assertEquals("TIMESTAMP", $this->_platform->getDateTimeTypeDeclarationSql(array('version' => true)));
$this->assertEquals("DATETIME", $this->_platform->getDateTimeTypeDeclarationSql(array()));
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment