Unverified Commit 2dda57a9 authored by belgattitude's avatar belgattitude Committed by Luís Cobucci

Added final tests for default escaping

parent 61bed75d
...@@ -976,4 +976,19 @@ abstract class AbstractPostgreSqlPlatformTestCase extends AbstractPlatformTestCa ...@@ -976,4 +976,19 @@ abstract class AbstractPostgreSqlPlatformTestCase extends AbstractPlatformTestCa
true true
); );
} }
public function testGetDefaultValueDeclarationSQLIsQuotedWithLiteral()
{
$field = [
'type' => Type::getType('string'),
'default' => "'O'Connor said: \"Hello\" \ \r'"
];
self::assertSame(sprintf(
' DEFAULT %s',
$this->_platform->quoteStringLiteral("'O'Connor said: \"Hello\" \ \r'")
),
$this->_platform->getDefaultValueDeclarationSQL($field)
);
}
} }
...@@ -90,5 +90,4 @@ class MariaDb102PlatformTest extends AbstractMySQLPlatformTestCase ...@@ -90,5 +90,4 @@ class MariaDb102PlatformTest extends AbstractMySQLPlatformTestCase
self::assertFalse($comparator->diffTable($table, $diffTable)); self::assertFalse($comparator->diffTable($table, $diffTable));
} }
} }
...@@ -874,4 +874,19 @@ EOD; ...@@ -874,4 +874,19 @@ EOD;
{ {
self::assertContains("'Foo''Bar\\\\'", $this->_platform->getListTableColumnsSQL('foo_table', "Foo'Bar\\"), '', true); self::assertContains("'Foo''Bar\\\\'", $this->_platform->getListTableColumnsSQL('foo_table', "Foo'Bar\\"), '', true);
} }
public function testGetDefaultValueDeclarationSQLIsQuotedWithLiteral()
{
$field = [
'type' => Type::getType('string'),
'default' => "'O'Connor said: \"Hello\" \ \r'"
];
self::assertSame(sprintf(
' DEFAULT %s',
$this->_platform->quoteStringLiteral("'O'Connor said: \"Hello\" \ \r'")
),
$this->_platform->getDefaultValueDeclarationSQL($field)
);
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment