1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-01-30 04:58:37 +01:00

[ticket/10774] Add unit tests for UNIQUE index existence and creation.

PHPBB3-10774
This commit is contained in:
Andreas Fischer 2012-04-10 00:46:24 +02:00
parent 156ae40d6f
commit 41ef41ac63

View File

@ -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'));
}
}