aboutsummaryrefslogtreecommitdiffstats
path: root/tests/dbal
diff options
context:
space:
mode:
authorNils Adermann <naderman@naderman.de>2011-10-14 17:48:15 +0200
committerNils Adermann <naderman@naderman.de>2011-10-14 17:48:15 +0200
commit8a82ec95a56f70b7b5ea10cfe9e98574e5230195 (patch)
treecf302fef439e6816b09e532e47cd75bf5d51e8d5 /tests/dbal
parent207a73537b2bb7f4608509f3ec79aaa313608ccb (diff)
parent4effe8fb8bdf493e539b7bf883fbf1e290bf7ab2 (diff)
downloadforums-8a82ec95a56f70b7b5ea10cfe9e98574e5230195.tar
forums-8a82ec95a56f70b7b5ea10cfe9e98574e5230195.tar.gz
forums-8a82ec95a56f70b7b5ea10cfe9e98574e5230195.tar.bz2
forums-8a82ec95a56f70b7b5ea10cfe9e98574e5230195.tar.xz
forums-8a82ec95a56f70b7b5ea10cfe9e98574e5230195.zip
Merge branch 'develop-olympus' into develop
* develop-olympus: [ticket/8240] Add ability to get a list of columns of a tables to db_tools. [ticket/8240] Add ability to get a list of tables to db_tools.
Diffstat (limited to 'tests/dbal')
-rw-r--r--tests/dbal/db_tools_test.php15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/dbal/db_tools_test.php b/tests/dbal/db_tools_test.php
index 927bce4597..b34b471e5c 100644
--- a/tests/dbal/db_tools_test.php
+++ b/tests/dbal/db_tools_test.php
@@ -234,6 +234,14 @@ class phpbb_dbal_db_tools_test extends phpbb_database_test_case
$this->assertEquals($row2, $row_actual);
}
+ public function test_list_columns()
+ {
+ $this->assertEquals(
+ array_keys($this->table_data['COLUMNS']),
+ array_values($this->tools->sql_list_columns('prefix_table_name'))
+ );
+ }
+
public function test_column_exists()
{
$this->assertTrue($this->tools->sql_column_exists('prefix_table_name', 'c_id'));
@@ -258,6 +266,13 @@ class phpbb_dbal_db_tools_test extends phpbb_database_test_case
$this->assertFalse($this->tools->sql_column_exists('prefix_table_name', 'c_id'));
}
+ public function test_list_tables()
+ {
+ $tables = $this->tools->sql_list_tables();
+ $this->assertTrue(isset($tables['prefix_table_name']));
+ $this->assertFalse(isset($tables['prefix_does_not_exist']));
+ }
+
public function test_table_exists()
{
$this->assertTrue($this->tools->sql_table_exists('prefix_table_name'));