diff options
author | Andreas Fischer <bantu@phpbb.com> | 2012-04-10 00:46:24 +0200 |
---|---|---|
committer | Andreas Fischer <bantu@phpbb.com> | 2012-04-10 00:46:24 +0200 |
commit | 41ef41ac63af83f04d0e82cd1891c12060e90227 (patch) | |
tree | cd92754b6a6999b63507f9850ecacd274c02d048 | |
parent | 156ae40d6fae2067a65a2125924e39e8dc5f35e1 (diff) | |
download | forums-41ef41ac63af83f04d0e82cd1891c12060e90227.tar forums-41ef41ac63af83f04d0e82cd1891c12060e90227.tar.gz forums-41ef41ac63af83f04d0e82cd1891c12060e90227.tar.bz2 forums-41ef41ac63af83f04d0e82cd1891c12060e90227.tar.xz forums-41ef41ac63af83f04d0e82cd1891c12060e90227.zip |
[ticket/10774] Add unit tests for UNIQUE index existence and creation.
PHPBB3-10774
-rw-r--r-- | tests/dbal/db_tools_test.php | 11 |
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')); + } } |