diff options
author | Andreas Fischer <bantu@phpbb.com> | 2013-01-23 15:47:28 +0100 |
---|---|---|
committer | Andreas Fischer <bantu@phpbb.com> | 2013-01-23 15:47:28 +0100 |
commit | ec97e60e17ad18d96ed73fc563b766a365005e58 (patch) | |
tree | 255eeb6b2d2e15b9eee41129614c97d07a7fb509 | |
parent | 85611150c402a7376c5a3ca08f305697a987ae34 (diff) | |
parent | 9a0992f6a0618d8423d15db7fd7780fdfd4c1670 (diff) | |
download | forums-ec97e60e17ad18d96ed73fc563b766a365005e58.tar forums-ec97e60e17ad18d96ed73fc563b766a365005e58.tar.gz forums-ec97e60e17ad18d96ed73fc563b766a365005e58.tar.bz2 forums-ec97e60e17ad18d96ed73fc563b766a365005e58.tar.xz forums-ec97e60e17ad18d96ed73fc563b766a365005e58.zip |
Merge branch 'develop-olympus' into develop
* develop-olympus:
[ticket/11295] Drop tables rather than database for postgres in test suite.
Conflicts:
tests/test_framework/phpbb_database_test_connection_manager.php
-rw-r--r-- | tests/test_framework/phpbb_database_test_connection_manager.php | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/test_framework/phpbb_database_test_connection_manager.php b/tests/test_framework/phpbb_database_test_connection_manager.php index 03097a10a0..c9bdd185d6 100644 --- a/tests/test_framework/phpbb_database_test_connection_manager.php +++ b/tests/test_framework/phpbb_database_test_connection_manager.php @@ -186,6 +186,16 @@ class phpbb_database_test_connection_manager $this->purge_extras(); break; + case 'postgres': + $this->connect(); + // Drop all of the tables + foreach ($this->get_tables() as $table) + { + $this->pdo->exec('DROP TABLE ' . $table . ' CASCADE'); + } + $this->purge_extras(); + break; + default: $this->connect(false); @@ -418,6 +428,19 @@ class phpbb_database_test_connection_manager $queries[] = 'DROP SEQUENCE ' . current($row); } break; + + case 'postgres': + $sql = 'SELECT sequence_name + FROM information_schema.sequences'; + $result = $this->pdo->query($sql); + + while ($row = $result->fetch(PDO::FETCH_NUM)) + { + $queries[] = 'DROP SEQUENCE ' . current($row); + } + + $queries[] = 'DROP TYPE IF EXISTS varchar_ci CASCADE'; + break; } foreach ($queries as $query) |