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
a87a12cc
Commit
a87a12cc
authored
Jan 10, 2016
by
Steve Müller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cover in test suite that platform generates inline column comment SQL
parent
a4dfce29
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
69 additions
and
0 deletions
+69
-0
AbstractPlatformTestCase.php
...octrine/Tests/DBAL/Platforms/AbstractPlatformTestCase.php
+49
-0
SqlitePlatformTest.php
tests/Doctrine/Tests/DBAL/Platforms/SqlitePlatformTest.php
+20
-0
No files found.
tests/Doctrine/Tests/DBAL/Platforms/AbstractPlatformTestCase.php
View file @
a87a12cc
...
@@ -1027,6 +1027,55 @@ abstract class AbstractPlatformTestCase extends \Doctrine\Tests\DbalTestCase
...
@@ -1027,6 +1027,55 @@ abstract class AbstractPlatformTestCase extends \Doctrine\Tests\DbalTestCase
);
);
}
}
/**
* @group DBAL-1176
*
* @dataProvider getGeneratesInlineColumnCommentSQL
*/
public
function
testGeneratesInlineColumnCommentSQL
(
$comment
,
$expectedSql
)
{
if
(
!
$this
->
_platform
->
supportsInlineColumnComments
())
{
$this
->
markTestSkipped
(
sprintf
(
'%s does not support inline column comments.'
,
get_class
(
$this
->
_platform
)));
}
$this
->
assertSame
(
$expectedSql
,
$this
->
_platform
->
getInlineColumnCommentSQL
(
$comment
));
}
public
function
getGeneratesInlineColumnCommentSQL
()
{
return
array
(
'regular comment'
=>
array
(
'Regular comment'
,
$this
->
getInlineColumnRegularCommentSQL
()),
'comment requiring escaping'
=>
array
(
sprintf
(
'Using inline comment delimiter %s works'
,
$this
->
getInlineColumnCommentDelimiter
()
),
$this
->
getInlineColumnCommentRequiringEscapingSQL
()
),
'empty comment'
=>
array
(
''
,
$this
->
getInlineColumnEmptyCommentSQL
()),
);
}
protected
function
getInlineColumnCommentDelimiter
()
{
return
"'"
;
}
protected
function
getInlineColumnRegularCommentSQL
()
{
return
"COMMENT 'Regular comment'"
;
}
protected
function
getInlineColumnCommentRequiringEscapingSQL
()
{
return
"COMMENT 'Using inline comment delimiter '' works'"
;
}
protected
function
getInlineColumnEmptyCommentSQL
()
{
return
"COMMENT ''"
;
}
protected
function
getQuotedStringLiteralWithoutQuoteCharacter
()
protected
function
getQuotedStringLiteralWithoutQuoteCharacter
()
{
{
return
"'No quote'"
;
return
"'No quote'"
;
...
...
tests/Doctrine/Tests/DBAL/Platforms/SqlitePlatformTest.php
View file @
a87a12cc
...
@@ -637,6 +637,26 @@ class SqlitePlatformTest extends AbstractPlatformTestCase
...
@@ -637,6 +637,26 @@ class SqlitePlatformTest extends AbstractPlatformTestCase
);
);
}
}
protected
function
getInlineColumnCommentDelimiter
()
{
return
"
\n
"
;
}
protected
function
getInlineColumnRegularCommentSQL
()
{
return
"--Regular comment
\n
"
;
}
protected
function
getInlineColumnCommentRequiringEscapingSQL
()
{
return
"--Using inline comment delimiter
\n
-- works
\n
"
;
}
protected
function
getInlineColumnEmptyCommentSQL
()
{
return
"--
\n
"
;
}
/**
/**
* {@inheritdoc}
* {@inheritdoc}
*/
*/
...
...
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