aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorIgor Wiedler <igor@wiedler.ch>2011-10-14 14:34:44 +0200
committerIgor Wiedler <igor@wiedler.ch>2011-10-14 14:34:44 +0200
commit1657339e6d0b9a04463ce63fefa6332cab8aad14 (patch)
treed60b7efa8357ee0742a59498113ab6949bf30232 /tests
parent893469c6528c165f5ba48062fa662b04727bb883 (diff)
parentd86fccf9c909602c37ec97577a19dc442e22206b (diff)
downloadforums-1657339e6d0b9a04463ce63fefa6332cab8aad14.tar
forums-1657339e6d0b9a04463ce63fefa6332cab8aad14.tar.gz
forums-1657339e6d0b9a04463ce63fefa6332cab8aad14.tar.bz2
forums-1657339e6d0b9a04463ce63fefa6332cab8aad14.tar.xz
forums-1657339e6d0b9a04463ce63fefa6332cab8aad14.zip
Merge remote-tracking branch 'bantu/ticket/10327' into develop-olympus
* bantu/ticket/10327: [ticket/10327] Change CREATE INDEX to ALTER TABLE table ADD INDEX for MySQL.
Diffstat (limited to 'tests')
-rw-r--r--tests/dbal/db_tools_test.php18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/dbal/db_tools_test.php b/tests/dbal/db_tools_test.php
index 753cc08fc5..927bce4597 100644
--- a/tests/dbal/db_tools_test.php
+++ b/tests/dbal/db_tools_test.php
@@ -333,4 +333,22 @@ class phpbb_dbal_db_tools_test extends phpbb_database_test_case
),
));
}
+
+ public function test_index_exists()
+ {
+ $db_tools = new phpbb_db_tools($this->db);
+
+ $this->assertTrue($db_tools->sql_index_exists('prefix_table_name', 'i_simple'));
+ }
+
+ public function test_create_index_against_index_exists()
+ {
+ $db_tools = new phpbb_db_tools($this->db);
+
+ $table_name = 'prefix_table_name';
+ $index_name = 'fookey';
+
+ $db_tools->sql_create_index($table_name, $index_name, array('c_timestamp', 'c_decimal'));
+ $this->assertTrue($db_tools->sql_index_exists($table_name, $index_name));
+ }
}