tests/Doctrine/Tests/DBAL/Platforms/AbstractPlatformTestCase.php 2 locations
|
@@ 566-578 (lines=13) @@
|
| 563 |
|
} |
| 564 |
|
} |
| 565 |
|
|
| 566 |
|
public function testGetDefaultValueDeclarationSQLForDateType() : void |
| 567 |
|
{ |
| 568 |
|
$currentDateSql = $this->_platform->getCurrentDateSQL(); |
| 569 |
|
$field = [ |
| 570 |
|
'type' => Type::getType('date'), |
| 571 |
|
'default' => $currentDateSql, |
| 572 |
|
]; |
| 573 |
|
|
| 574 |
|
self::assertSame( |
| 575 |
|
' DEFAULT ' . $currentDateSql, |
| 576 |
|
$this->_platform->getDefaultValueDeclarationSQL($field) |
| 577 |
|
); |
| 578 |
|
} |
| 579 |
|
|
| 580 |
|
/** |
| 581 |
|
* @group DBAL-45 |
|
@@ 831-843 (lines=13) @@
|
| 828 |
|
/** |
| 829 |
|
* @group DBAL-553 |
| 830 |
|
*/ |
| 831 |
|
public function testReturnsJsonTypeDeclarationSQL() |
| 832 |
|
{ |
| 833 |
|
$column = array( |
| 834 |
|
'length' => 666, |
| 835 |
|
'notnull' => true, |
| 836 |
|
'type' => Type::getType('json_array'), |
| 837 |
|
); |
| 838 |
|
|
| 839 |
|
self::assertSame( |
| 840 |
|
$this->_platform->getClobTypeDeclarationSQL($column), |
| 841 |
|
$this->_platform->getJsonTypeDeclarationSQL($column) |
| 842 |
|
); |
| 843 |
|
} |
| 844 |
|
|
| 845 |
|
/** |
| 846 |
|
* @group DBAL-234 |
tests/Doctrine/Tests/DBAL/Platforms/SQLServer2008PlatformTest.php 1 location
|
@@ 24-36 (lines=13) @@
|
| 21 |
|
); |
| 22 |
|
} |
| 23 |
|
|
| 24 |
|
public function testGetDefaultValueDeclarationSQLForDateType() : void |
| 25 |
|
{ |
| 26 |
|
$currentDateSql = $this->_platform->getCurrentDateSQL(); |
| 27 |
|
$field = [ |
| 28 |
|
'type' => Type::getType('date'), |
| 29 |
|
'default' => $currentDateSql, |
| 30 |
|
]; |
| 31 |
|
|
| 32 |
|
self::assertSame( |
| 33 |
|
" DEFAULT '" . $currentDateSql . "'", |
| 34 |
|
$this->_platform->getDefaultValueDeclarationSQL($field) |
| 35 |
|
); |
| 36 |
|
} |
| 37 |
|
} |
| 38 |
|
|
tests/Doctrine/Tests/DBAL/Platforms/SQLServer2012PlatformTest.php 1 location
|
@@ 376-388 (lines=13) @@
|
| 373 |
|
self::assertEquals($expectedSql, $sql); |
| 374 |
|
} |
| 375 |
|
|
| 376 |
|
public function testGetDefaultValueDeclarationSQLForDateType() : void |
| 377 |
|
{ |
| 378 |
|
$currentDateSql = $this->_platform->getCurrentDateSQL(); |
| 379 |
|
$field = [ |
| 380 |
|
'type' => Type::getType('date'), |
| 381 |
|
'default' => $currentDateSql, |
| 382 |
|
]; |
| 383 |
|
|
| 384 |
|
self::assertSame( |
| 385 |
|
" DEFAULT '" . $currentDateSql . "'", |
| 386 |
|
$this->_platform->getDefaultValueDeclarationSQL($field) |
| 387 |
|
); |
| 388 |
|
} |
| 389 |
|
} |
| 390 |
|
|
tests/Doctrine/Tests/DBAL/Platforms/SQLServerPlatformTest.php 1 location
|
@@ 62-74 (lines=13) @@
|
| 59 |
|
); |
| 60 |
|
} |
| 61 |
|
|
| 62 |
|
public function testGetDefaultValueDeclarationSQLForDateType() : void |
| 63 |
|
{ |
| 64 |
|
$currentDateSql = $this->_platform->getCurrentDateSQL(); |
| 65 |
|
$field = [ |
| 66 |
|
'type' => Type::getType('date'), |
| 67 |
|
'default' => $currentDateSql, |
| 68 |
|
]; |
| 69 |
|
|
| 70 |
|
self::assertSame( |
| 71 |
|
" DEFAULT '" . $currentDateSql . "'", |
| 72 |
|
$this->_platform->getDefaultValueDeclarationSQL($field) |
| 73 |
|
); |
| 74 |
|
} |
| 75 |
|
} |
| 76 |
|
|
tests/Doctrine/Tests/DBAL/Platforms/AbstractMySQLPlatformTestCase.php 1 location
|
@@ 912-925 (lines=14) @@
|
| 909 |
|
self::assertNotContains('DATABASE()', $sql); |
| 910 |
|
} |
| 911 |
|
|
| 912 |
|
public function testGetDefaultValueDeclarationSQLIsQuotedWithLiteral() |
| 913 |
|
{ |
| 914 |
|
$field = [ |
| 915 |
|
'type' => Type::getType('string'), |
| 916 |
|
'default' => "'O'Connor said: \"Hello\" \ \r'" |
| 917 |
|
]; |
| 918 |
|
|
| 919 |
|
self::assertSame(sprintf( |
| 920 |
|
' DEFAULT %s', |
| 921 |
|
$this->_platform->quoteStringLiteral("'O'Connor said: \"Hello\" \ \r'") |
| 922 |
|
), |
| 923 |
|
$this->_platform->getDefaultValueDeclarationSQL($field) |
| 924 |
|
); |
| 925 |
|
} |
| 926 |
|
} |
| 927 |
|
|