aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorIgor Wiedler <igor@wiedler.ch>2011-10-14 14:35:21 +0200
committerIgor Wiedler <igor@wiedler.ch>2011-10-14 14:35:21 +0200
commit37d9e7e30c3edbd14bb4e0f098ce676f1d7fe07b (patch)
tree791e2ce3980c27ce7a2db589c91a2ec4abc9eb0a /tests
parent8f6e99740b018e0ba09c9ec91c24f865c2b4fead (diff)
parent1657339e6d0b9a04463ce63fefa6332cab8aad14 (diff)
downloadforums-37d9e7e30c3edbd14bb4e0f098ce676f1d7fe07b.tar
forums-37d9e7e30c3edbd14bb4e0f098ce676f1d7fe07b.tar.gz
forums-37d9e7e30c3edbd14bb4e0f098ce676f1d7fe07b.tar.bz2
forums-37d9e7e30c3edbd14bb4e0f098ce676f1d7fe07b.tar.xz
forums-37d9e7e30c3edbd14bb4e0f098ce676f1d7fe07b.zip
Merge branch 'develop-olympus' into develop
* develop-olympus: [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));
+ }
}