Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
doctrine-dbal
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Tomáš Trávníček
doctrine-dbal
Commits
6e3afd5f
Commit
6e3afd5f
authored
Sep 11, 2017
by
Marco Pivetta
Committed by
GitHub
Sep 11, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2851 from greg0ire/default_date_test
Test default value declaration for the date type
parents
24b4ebf0
f1f728f1
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
58 additions
and
0 deletions
+58
-0
AbstractPlatformTestCase.php
...octrine/Tests/DBAL/Platforms/AbstractPlatformTestCase.php
+14
-0
SQLServer2008PlatformTest.php
...ctrine/Tests/DBAL/Platforms/SQLServer2008PlatformTest.php
+15
-0
SQLServer2012PlatformTest.php
...ctrine/Tests/DBAL/Platforms/SQLServer2012PlatformTest.php
+15
-0
SQLServerPlatformTest.php
...s/Doctrine/Tests/DBAL/Platforms/SQLServerPlatformTest.php
+14
-0
No files found.
tests/Doctrine/Tests/DBAL/Platforms/AbstractPlatformTestCase.php
View file @
6e3afd5f
...
@@ -563,6 +563,20 @@ abstract class AbstractPlatformTestCase extends \Doctrine\Tests\DbalTestCase
...
@@ -563,6 +563,20 @@ abstract class AbstractPlatformTestCase extends \Doctrine\Tests\DbalTestCase
}
}
}
}
public
function
testGetDefaultValueDeclarationSQLForDateType
()
{
$currentDateSql
=
$this
->
_platform
->
getCurrentDateSQL
();
$field
=
array
(
'type'
=>
Type
::
getType
(
'date'
),
'default'
=>
$currentDateSql
,
);
$this
->
assertEquals
(
' DEFAULT '
.
$currentDateSql
,
$this
->
_platform
->
getDefaultValueDeclarationSQL
(
$field
)
);
}
/**
/**
* @group DBAL-45
* @group DBAL-45
*/
*/
...
...
tests/Doctrine/Tests/DBAL/Platforms/SQLServer2008PlatformTest.php
View file @
6e3afd5f
...
@@ -3,6 +3,7 @@
...
@@ -3,6 +3,7 @@
namespace
Doctrine\Tests\DBAL\Platforms
;
namespace
Doctrine\Tests\DBAL\Platforms
;
use
Doctrine\DBAL\Platforms\SQLServer2008Platform
;
use
Doctrine\DBAL\Platforms\SQLServer2008Platform
;
use
Doctrine\DBAL\Types\Type
;
class
SQLServer2008PlatformTest
extends
AbstractSQLServerPlatformTestCase
class
SQLServer2008PlatformTest
extends
AbstractSQLServerPlatformTestCase
{
{
...
@@ -19,4 +20,18 @@ class SQLServer2008PlatformTest extends AbstractSQLServerPlatformTestCase
...
@@ -19,4 +20,18 @@ class SQLServer2008PlatformTest extends AbstractSQLServerPlatformTestCase
array
())
array
())
);
);
}
}
public
function
testGetDefaultValueDeclarationSQLForDateType
()
{
$currentDateSql
=
$this
->
_platform
->
getCurrentDateSQL
();
$field
=
array
(
'type'
=>
Type
::
getType
(
'date'
),
'default'
=>
$currentDateSql
,
);
$this
->
assertEquals
(
" DEFAULT '"
.
$currentDateSql
.
"'"
,
$this
->
_platform
->
getDefaultValueDeclarationSQL
(
$field
)
);
}
}
}
tests/Doctrine/Tests/DBAL/Platforms/SQLServer2012PlatformTest.php
View file @
6e3afd5f
...
@@ -4,6 +4,7 @@ namespace Doctrine\Tests\DBAL\Platforms;
...
@@ -4,6 +4,7 @@ namespace Doctrine\Tests\DBAL\Platforms;
use
Doctrine\DBAL\Platforms\SQLServer2012Platform
;
use
Doctrine\DBAL\Platforms\SQLServer2012Platform
;
use
Doctrine\DBAL\Schema\Sequence
;
use
Doctrine\DBAL\Schema\Sequence
;
use
Doctrine\DBAL\Types\Type
;
class
SQLServer2012PlatformTest
extends
AbstractSQLServerPlatformTestCase
class
SQLServer2012PlatformTest
extends
AbstractSQLServerPlatformTestCase
{
{
...
@@ -371,4 +372,18 @@ class SQLServer2012PlatformTest extends AbstractSQLServerPlatformTestCase
...
@@ -371,4 +372,18 @@ class SQLServer2012PlatformTest extends AbstractSQLServerPlatformTestCase
$sql
=
$this
->
_platform
->
modifyLimitQuery
(
$querySql
,
10
);
$sql
=
$this
->
_platform
->
modifyLimitQuery
(
$querySql
,
10
);
self
::
assertEquals
(
$expectedSql
,
$sql
);
self
::
assertEquals
(
$expectedSql
,
$sql
);
}
}
public
function
testGetDefaultValueDeclarationSQLForDateType
()
{
$currentDateSql
=
$this
->
_platform
->
getCurrentDateSQL
();
$field
=
array
(
'type'
=>
Type
::
getType
(
'date'
),
'default'
=>
$currentDateSql
,
);
$this
->
assertEquals
(
" DEFAULT '"
.
$currentDateSql
.
"'"
,
$this
->
_platform
->
getDefaultValueDeclarationSQL
(
$field
)
);
}
}
}
tests/Doctrine/Tests/DBAL/Platforms/SQLServerPlatformTest.php
View file @
6e3afd5f
...
@@ -4,6 +4,7 @@ namespace Doctrine\Tests\DBAL\Platforms;
...
@@ -4,6 +4,7 @@ namespace Doctrine\Tests\DBAL\Platforms;
use
Doctrine\DBAL\LockMode
;
use
Doctrine\DBAL\LockMode
;
use
Doctrine\DBAL\Platforms\SQLServerPlatform
;
use
Doctrine\DBAL\Platforms\SQLServerPlatform
;
use
Doctrine\DBAL\Types\Type
;
class
SQLServerPlatformTest
extends
AbstractSQLServerPlatformTestCase
class
SQLServerPlatformTest
extends
AbstractSQLServerPlatformTestCase
{
{
...
@@ -58,4 +59,17 @@ class SQLServerPlatformTest extends AbstractSQLServerPlatformTestCase
...
@@ -58,4 +59,17 @@ class SQLServerPlatformTest extends AbstractSQLServerPlatformTestCase
);
);
}
}
public
function
testGetDefaultValueDeclarationSQLForDateType
()
{
$currentDateSql
=
$this
->
_platform
->
getCurrentDateSQL
();
$field
=
array
(
'type'
=>
Type
::
getType
(
'date'
),
'default'
=>
$currentDateSql
,
);
$this
->
assertEquals
(
" DEFAULT '"
.
$currentDateSql
.
"'"
,
$this
->
_platform
->
getDefaultValueDeclarationSQL
(
$field
)
);
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment