mirror of
https://github.com/yiisoft/yii2.git
synced 2025-11-17 23:09:10 +08:00
Driver specific QueryBuilderTest::testCommentColumn() - improved to use replaceQuotes()
This commit is contained in:
@@ -33,25 +33,25 @@ class OracleQueryBuilderTest extends QueryBuilderTest
|
|||||||
{
|
{
|
||||||
$qb = $this->getQueryBuilder();
|
$qb = $this->getQueryBuilder();
|
||||||
|
|
||||||
$expected = "COMMENT ON COLUMN \"comment\".\"text\" IS 'This is my column.'";
|
$expected = "COMMENT ON COLUMN [[comment]].[[text]] IS 'This is my column.'";
|
||||||
$sql = $qb->addCommentOnColumn('comment', 'text', 'This is my column.');
|
$sql = $qb->addCommentOnColumn('comment', 'text', 'This is my column.');
|
||||||
$this->assertEquals($expected, $sql);
|
$this->assertEquals($this->replaceQuotes($expected), $sql);
|
||||||
|
|
||||||
$expected = "COMMENT ON COLUMN \"comment\".\"text\" IS ''";
|
$expected = "COMMENT ON COLUMN [[comment]].[[text]] IS ''";
|
||||||
$sql = $qb->dropCommentFromColumn('comment', 'text');
|
$sql = $qb->dropCommentFromColumn('comment', 'text');
|
||||||
$this->assertEquals($expected, $sql);
|
$this->assertEquals($this->replaceQuotes($expected), $sql);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testCommentTable()
|
public function testCommentTable()
|
||||||
{
|
{
|
||||||
$qb = $this->getQueryBuilder();
|
$qb = $this->getQueryBuilder();
|
||||||
|
|
||||||
$expected = "COMMENT ON TABLE \"comment\" IS 'This is my table.'";
|
$expected = "COMMENT ON TABLE [[comment]] IS 'This is my table.'";
|
||||||
$sql = $qb->addCommentOnTable('comment', 'This is my table.');
|
$sql = $qb->addCommentOnTable('comment', 'This is my table.');
|
||||||
$this->assertEquals($expected, $sql);
|
$this->assertEquals($this->replaceQuotes($expected), $sql);
|
||||||
|
|
||||||
$expected = "COMMENT ON TABLE \"comment\" IS ''";
|
$expected = "COMMENT ON TABLE [[comment]] IS ''";
|
||||||
$sql = $qb->dropCommentFromTable('comment');
|
$sql = $qb->dropCommentFromTable('comment');
|
||||||
$this->assertEquals($expected, $sql);
|
$this->assertEquals($this->replaceQuotes($expected), $sql);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -100,11 +100,11 @@ class PostgreSQLQueryBuilderTest extends QueryBuilderTest
|
|||||||
{
|
{
|
||||||
$qb = $this->getQueryBuilder();
|
$qb = $this->getQueryBuilder();
|
||||||
|
|
||||||
$expected = "COMMENT ON COLUMN \"comment\".\"text\" IS 'This is my column.'";
|
$expected = "COMMENT ON COLUMN [[comment]].[[text]] IS 'This is my column.'";
|
||||||
$sql = $qb->addCommentOnColumn('comment', 'text', 'This is my column.');
|
$sql = $qb->addCommentOnColumn('comment', 'text', 'This is my column.');
|
||||||
$this->assertEquals($expected, $sql);
|
$this->assertEquals($expected, $sql);
|
||||||
|
|
||||||
$expected = "COMMENT ON COLUMN \"comment\".\"text\" IS NULL";
|
$expected = "COMMENT ON COLUMN [[comment]].[[text]] IS NULL";
|
||||||
$sql = $qb->dropCommentFromColumn('comment', 'text');
|
$sql = $qb->dropCommentFromColumn('comment', 'text');
|
||||||
$this->assertEquals($expected, $sql);
|
$this->assertEquals($expected, $sql);
|
||||||
}
|
}
|
||||||
@@ -113,11 +113,11 @@ class PostgreSQLQueryBuilderTest extends QueryBuilderTest
|
|||||||
{
|
{
|
||||||
$qb = $this->getQueryBuilder();
|
$qb = $this->getQueryBuilder();
|
||||||
|
|
||||||
$expected = "COMMENT ON TABLE \"comment\" IS 'This is my table.'";
|
$expected = "COMMENT ON TABLE [[comment]] IS 'This is my table.'";
|
||||||
$sql = $qb->addCommentOnTable('comment', 'This is my table.');
|
$sql = $qb->addCommentOnTable('comment', 'This is my table.');
|
||||||
$this->assertEquals($expected, $sql);
|
$this->assertEquals($expected, $sql);
|
||||||
|
|
||||||
$expected = "COMMENT ON TABLE \"comment\" IS NULL";
|
$expected = "COMMENT ON TABLE [[comment]] IS NULL";
|
||||||
$sql = $qb->dropCommentFromTable('comment');
|
$sql = $qb->dropCommentFromTable('comment');
|
||||||
$this->assertEquals($expected, $sql);
|
$this->assertEquals($expected, $sql);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,11 +30,6 @@ class SqliteQueryBuilderTest extends QueryBuilderTest
|
|||||||
$this->markTestSkipped('Comments are not supported in SQLite');
|
$this->markTestSkipped('Comments are not supported in SQLite');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testCommentOnColumnSchemaBuilder()
|
|
||||||
{
|
|
||||||
$this->markTestSkipped('Comments are not supported in SQLite');
|
|
||||||
}
|
|
||||||
|
|
||||||
public function testCommentColumn()
|
public function testCommentColumn()
|
||||||
{
|
{
|
||||||
$this->markTestSkipped('Comments are not supported in SQLite');
|
$this->markTestSkipped('Comments are not supported in SQLite');
|
||||||
|
|||||||
Reference in New Issue
Block a user