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
0a34a67c
Unverified
Commit
0a34a67c
authored
7 years ago
by
belgattitude
Committed by
Luís Cobucci
7 years ago
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
More tests for escaping
parent
d2ddd2f0
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
7 deletions
+13
-7
MySqlSchemaManagerTest.php
...e/Tests/DBAL/Functional/Schema/MySqlSchemaManagerTest.php
+12
-6
AbstractMySQLPlatformTestCase.php
...ne/Tests/DBAL/Platforms/AbstractMySQLPlatformTestCase.php
+1
-1
No files found.
tests/Doctrine/Tests/DBAL/Functional/Schema/MySqlSchemaManagerTest.php
View file @
0a34a67c
...
...
@@ -390,22 +390,28 @@ class MySqlSchemaManagerTest extends SchemaManagerFunctionalTestCase
}
/**
* Test that default value escaping does not trigger a schema change
* using different escaping options.
* @link https://mariadb.com/kb/en/library/string-literals
* @link https://dev.mysql.com/doc/refman/5.7/en/string-literals.html
*/
public
function
testColumnDefaultValuesEscaping
()
:
void
{
$table
=
new
Table
(
"test_column_default_values_escaping"
);
$table
->
addColumn
(
'no_quotes'
,
'string'
,
[
'notnull'
=>
false
,
'default'
=>
'az'
]);
$table
->
addColumn
(
'backslash'
,
'string'
,
[
'notnull'
=>
false
,
'default'
=>
'a\\\z'
]);
$table
->
addColumn
(
'repeated_single_quotes'
,
'string'
,
[
'notnull'
=>
false
,
'default'
=>
"a''z"
]);
$table
->
addColumn
(
'double_backslash'
,
'string'
,
[
'default'
=>
'F\\Q\\D\\N'
]);
$table
->
addColumn
(
'triple_backslash'
,
'string'
,
[
'default'
=>
'a\\\z'
]);
$table
->
addColumn
(
'repeated_single_quotes'
,
'string'
,
[
'default'
=>
"a''z"
]);
$table
->
addColumn
(
'backslash_double_quote'
,
'string'
,
[
'default'
=>
'a\"z'
]);
$table
->
addColumn
(
'backslash_newline'
,
'string'
,
[
'default'
=>
'a\nz'
]);
$this
->
_sm
->
dropAndCreateTable
(
$table
);
$onlineTable
=
$this
->
_sm
->
listTableDetails
(
"test_column_default_values_escaping"
);
self
::
assertSame
(
"az"
,
$onlineTable
->
getColumn
(
'no_quotes
'
)
->
getDefault
());
self
::
assertSame
(
'a\\\z'
,
$onlineTable
->
getColumn
(
'backslash'
)
->
getDefault
());
self
::
assertSame
(
'F\\Q\\D\\N'
,
$onlineTable
->
getColumn
(
'double_backslash
'
)
->
getDefault
());
self
::
assertSame
(
'a\\\z'
,
$onlineTable
->
getColumn
(
'
triple_
backslash'
)
->
getDefault
());
self
::
assertSame
(
"a''z"
,
$onlineTable
->
getColumn
(
'repeated_single_quotes'
)
->
getDefault
());
self
::
assertSame
(
'a\"z'
,
$onlineTable
->
getColumn
(
'backslash_double_quote'
)
->
getDefault
());
self
::
assertSame
(
'a\nz'
,
$onlineTable
->
getColumn
(
'backslash_newline'
)
->
getDefault
());
$comparator
=
new
Comparator
();
...
...
This diff is collapsed.
Click to expand it.
tests/Doctrine/Tests/DBAL/Platforms/AbstractMySQLPlatformTestCase.php
View file @
0a34a67c
...
...
@@ -917,7 +917,7 @@ abstract class AbstractMySQLPlatformTestCase extends AbstractPlatformTestCase
];
self
::
assertSame
(
sprintf
(
" DEFAULT %s"
,
' DEFAULT %s'
,
$this
->
_platform
->
quoteStringLiteral
(
"'O'Connor said:
\"
Hello
\"
\
\r
'"
)
),
$this
->
_platform
->
getDefaultValueDeclarationSQL
(
$field
)
...
...
This diff is collapsed.
Click to expand it.
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