mirror of
https://github.com/yiisoft/yii2.git
synced 2026-03-21 06:33:43 +01:00
merge from yiisoft/yii2
This commit is contained in:
@@ -353,4 +353,29 @@ class QueryBuilderTest extends \yiiunit\framework\db\QueryBuilderTest
|
||||
|
||||
return $items;
|
||||
}
|
||||
|
||||
public function testDropIndex()
|
||||
{
|
||||
$qb = $this->getQueryBuilder();
|
||||
|
||||
$expected = 'DROP INDEX "index"';
|
||||
$sql = $qb->dropIndex('index', '{{table}}');
|
||||
$this->assertEquals($expected, $sql);
|
||||
|
||||
$expected = 'DROP INDEX "schema"."index"';
|
||||
$sql = $qb->dropIndex('index', '{{schema.table}}');
|
||||
$this->assertEquals($expected, $sql);
|
||||
|
||||
$expected = 'DROP INDEX "schema"."index"';
|
||||
$sql = $qb->dropIndex('schema.index', '{{schema2.table}}');
|
||||
$this->assertEquals($expected, $sql);
|
||||
|
||||
$expected = 'DROP INDEX "schema"."index"';
|
||||
$sql = $qb->dropIndex('index', '{{schema.%table}}');
|
||||
$this->assertEquals($expected, $sql);
|
||||
|
||||
$expected = 'DROP INDEX {{%schema.index}}';
|
||||
$sql = $qb->dropIndex('index', '{{%schema.table}}');
|
||||
$this->assertEquals($expected, $sql);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user