SchemaManager test added

parent fc4dc7c8
......@@ -736,6 +736,31 @@ class SchemaManagerFunctionalTestCase extends \Doctrine\Tests\DbalFunctionalTest
$this->assertInstanceOf('Doctrine\DBAL\Types\ArrayType', $columns['arr']->getType(), "The Doctrine2 should be detected from comment hint.");
}
/**
* @group DBAL-1228
*/
public function testCommentHintOnDateIntervalTypeColumn()
{
if ( ! $this->_conn->getDatabasePlatform()->supportsInlineColumnComments() &&
! $this->_conn->getDatabasePlatform()->supportsCommentOnStatement() &&
$this->_conn->getDatabasePlatform()->getName() != 'mssql') {
$this->markTestSkipped('Database does not support column comments.');
}
$table = new Table('column_dateinterval_comment');
$table->addColumn('id', 'integer', array('comment' => 'This is a comment'));
$table->addColumn('date_interval', 'dateinterval', array('comment' => 'This is a comment'));
$table->setPrimaryKey(array('id'));
$this->_sm->createTable($table);
$columns = $this->_sm->listTableColumns("column_dateinterval_comment");
$this->assertEquals(2, count($columns));
$this->assertEquals('This is a comment', $columns['id']->getComment());
$this->assertEquals('This is a comment', $columns['date_interval']->getComment(), "The Doctrine2 Typehint should be stripped from comment.");
$this->assertInstanceOf('Doctrine\DBAL\Types\DateIntervalType', $columns['date_interval']->getType(), "The Doctrine2 should be detected from comment hint.");
}
/**
* @group DBAL-825
*/
......
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