1
0
mirror of synced 2025-01-31 12:32:59 +03:00

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

This commit is contained in:
beberlei 2009-11-05 18:55:02 +00:00
parent 3678b65186
commit 7220cb2e8b
2 changed files with 11 additions and 1 deletions

View File

@ -279,7 +279,7 @@ class MySqlPlatform extends AbstractPlatform
*/ */
public function getDateTimeTypeDeclarationSql(array $fieldDeclaration) public function getDateTimeTypeDeclarationSql(array $fieldDeclaration)
{ {
if (isset($fieldDeclaration['version'])) { if (isset($fieldDeclaration['version']) && $fieldDeclaration['version'] == true) {
return 'TIMESTAMP'; return 'TIMESTAMP';
} else { } else {
return 'DATETIME'; return 'DATETIME';

View File

@ -195,4 +195,14 @@ class MySqlPlatformTest extends \Doctrine\Tests\DbalTestCase
$sql = $this->_platform->modifyLimitQuery('SELECT * FROM user', 10); $sql = $this->_platform->modifyLimitQuery('SELECT * FROM user', 10);
$this->assertEquals('SELECT * FROM user LIMIT 10', $sql); $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()));
}
} }