Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/phpmyadmin/phpmyadmin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilliam Desportes <williamdes@wdes.fr>2021-03-24 04:59:42 +0300
committerWilliam Desportes <williamdes@wdes.fr>2021-03-24 04:59:42 +0300
commit970d28617a48540c2c9432d0f807ba2fe36071e7 (patch)
treeade380859366d8153d2599c86f1cdc06f0cf25e4 /test/classes/TableTest.php
parent6cb41a844d1498a5266dc8e80effc112acf81a44 (diff)
Add tests for #16728
Signed-off-by: William Desportes <williamdes@wdes.fr>
Diffstat (limited to 'test/classes/TableTest.php')
-rw-r--r--test/classes/TableTest.php21
1 files changed, 21 insertions, 0 deletions
diff --git a/test/classes/TableTest.php b/test/classes/TableTest.php
index 83318b3f7b..034dff2593 100644
--- a/test/classes/TableTest.php
+++ b/test/classes/TableTest.php
@@ -1294,6 +1294,27 @@ class TableTest extends AbstractTestCase
}
/**
+ * Tests for getSqlQueryForIndexCreateOrEdit() method.
+ */
+ public function testGetSqlQueryForIndexCreateOrEditSecondFormat(): void
+ {
+ $db = 'pma_db';
+ $table = 'pma_table';
+ $index = new Index();
+ $error = false;
+
+ $_POST['old_index']['Key_name'] = 'PRIMARY';
+
+ $table = new Table($table, $db);
+ $sql = $table->getSqlQueryForIndexCreateOrEdit($index, $error);
+
+ $this->assertEquals(
+ 'ALTER TABLE `pma_db`.`pma_table` DROP PRIMARY KEY, ADD UNIQUE ;',
+ $sql
+ );
+ }
+
+ /**
* Test for getColumns
*/
public function testGetColumns(): void