Merge branch 'methods_for_schema_builder' of https://github.com/vaseninm/yii2 into vaseninm-methods_for_schema_builder

This commit is contained in:
SilverFire - Dmitry Naumenko
2016-04-19 12:21:33 +03:00
22 changed files with 811 additions and 2 deletions

View File

@@ -95,4 +95,30 @@ class PostgreSQLQueryBuilderTest extends QueryBuilderTest
$sql = $qb->alterColumn('foo1', 'bar', 'reset xyz');
$this->assertEquals($expected, $sql);
}
public function testCommentColumn()
{
$qb = $this->getQueryBuilder();
$expected = "COMMENT ON COLUMN \"comment\".\"text\" IS 'This is my column.'";
$sql = $qb->addCommentOnColumn('comment', 'text', 'This is my column.');
$this->assertEquals($expected, $sql);
$expected = "COMMENT ON COLUMN \"comment\".\"text\" IS NULL";
$sql = $qb->dropCommentFromColumn('comment', 'text');
$this->assertEquals($expected, $sql);
}
public function testCommentTable()
{
$qb = $this->getQueryBuilder();
$expected = "COMMENT ON TABLE \"comment\" IS 'This is my table.'";
$sql = $qb->addCommentOnTable('comment', 'This is my table.');
$this->assertEquals($expected, $sql);
$expected = "COMMENT ON TABLE \"comment\" IS NULL";
$sql = $qb->dropCommentFromTable('comment');
$this->assertEquals($expected, $sql);
}
}