DDC-118 - Fixed introduced regression and added tests for future
This commit is contained in:
parent
3678b65186
commit
7220cb2e8b
@ -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';
|
||||||
|
@ -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()));
|
||||||
|
}
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user