Commit 130a7748 authored by Steve Müller's avatar Steve Müller

cover in test suite that platform throws exception on generating inline column...

cover in test suite that platform throws exception on generating inline column comment SQL if unsupported
parent a87a12cc
...@@ -1608,9 +1608,15 @@ abstract class AbstractPlatform ...@@ -1608,9 +1608,15 @@ abstract class AbstractPlatform
* @param string $comment * @param string $comment
* *
* @return string * @return string
*
* @throws \Doctrine\DBAL\DBALException If not supported on this platform.
*/ */
public function getInlineColumnCommentSQL($comment) public function getInlineColumnCommentSQL($comment)
{ {
if (! $this->supportsInlineColumnComments()) {
throw DBALException::notSupported(__METHOD__);
}
return "COMMENT " . $this->quoteStringLiteral($comment); return "COMMENT " . $this->quoteStringLiteral($comment);
} }
......
...@@ -1091,6 +1091,24 @@ abstract class AbstractPlatformTestCase extends \Doctrine\Tests\DbalTestCase ...@@ -1091,6 +1091,24 @@ abstract class AbstractPlatformTestCase extends \Doctrine\Tests\DbalTestCase
return "''''"; return "''''";
} }
/**
* @group DBAL-1176
*/
public function testThrowsExceptionOnGeneratingInlineColumnCommentSQLIfUnsupported()
{
if ($this->_platform->supportsInlineColumnComments()) {
$this->markTestSkipped(sprintf('%s supports inline column comments.', get_class($this->_platform)));
}
$this->setExpectedException(
'Doctrine\DBAL\DBALException',
"Operation 'Doctrine\\DBAL\\Platforms\\AbstractPlatform::getInlineColumnCommentSQL' is not supported by platform.",
0
);
$this->_platform->getInlineColumnCommentSQL('unsupported');
}
public function testQuoteStringLiteral() public function testQuoteStringLiteral()
{ {
$c = $this->getStringLiteralQuoteCharacter(); $c = $this->getStringLiteralQuoteCharacter();
......
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