aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorNils Adermann <naderman@naderman.de>2012-04-10 01:14:04 +0200
committerNils Adermann <naderman@naderman.de>2012-04-10 01:14:04 +0200
commitef297ec63e8328dc13a8d79d7c01d2d7322a263b (patch)
tree7d0f13142f4183afcc842de29dcdadef7388916b /tests
parent156ae40d6fae2067a65a2125924e39e8dc5f35e1 (diff)
parentef8160e8a2a1dbb51cd2603eefcd9309d2daece8 (diff)
downloadforums-ef297ec63e8328dc13a8d79d7c01d2d7322a263b.tar
forums-ef297ec63e8328dc13a8d79d7c01d2d7322a263b.tar.gz
forums-ef297ec63e8328dc13a8d79d7c01d2d7322a263b.tar.bz2
forums-ef297ec63e8328dc13a8d79d7c01d2d7322a263b.tar.xz
forums-ef297ec63e8328dc13a8d79d7c01d2d7322a263b.zip
Merge remote-tracking branch 'github-bantu/ticket/10774' into develop-olympus
* github-bantu/ticket/10774: [ticket/10774] Correctly specify index name when creating unique index on MySQL. [ticket/10774] Add unit tests for UNIQUE index existence and creation.
Diffstat (limited to 'tests')
-rw-r--r--tests/dbal/db_tools_test.php11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/dbal/db_tools_test.php b/tests/dbal/db_tools_test.php
index fbde636b58..c7ddb88ce8 100644
--- a/tests/dbal/db_tools_test.php
+++ b/tests/dbal/db_tools_test.php
@@ -354,9 +354,20 @@ class phpbb_dbal_db_tools_test extends phpbb_database_test_case
$this->assertTrue($this->tools->sql_index_exists('prefix_table_name', 'i_simple'));
}
+ public function test_unique_index_exists()
+ {
+ $this->assertTrue($this->tools->sql_unique_index_exists('prefix_table_name', 'i_uniq'));
+ }
+
public function test_create_index_against_index_exists()
{
$this->tools->sql_create_index('prefix_table_name', 'fookey', array('c_timestamp', 'c_decimal'));
$this->assertTrue($this->tools->sql_index_exists('prefix_table_name', 'fookey'));
}
+
+ public function test_create_unique_index_against_unique_index_exists()
+ {
+ $this->tools->sql_create_unique_index('prefix_table_name', 'i_uniq_ts_id', array('c_timestamp', 'c_id'));
+ $this->assertTrue($this->tools->sql_unique_index_exists('prefix_table_name', 'i_uniq_ts_id'));
+ }
}