summaryrefslogtreecommitdiffstats
path: root/tests/lib/dbschema.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/lib/dbschema.php')
-rw-r--r--tests/lib/dbschema.php14
1 files changed, 11 insertions, 3 deletions
diff --git a/tests/lib/dbschema.php b/tests/lib/dbschema.php
index e20a04ef7fd..59f203993ef 100644
--- a/tests/lib/dbschema.php
+++ b/tests/lib/dbschema.php
@@ -26,8 +26,8 @@ class Test_DBSchema extends PHPUnit_Framework_TestCase {
file_put_contents( self::$schema_file2, $content );
$this->test_prefix = $r;
- $this->table1 = $this->test_prefix.'contacts_addressbooks';
- $this->table2 = $this->test_prefix.'contacts_cards';
+ $this->table1 = $this->test_prefix.'cntcts_addrsbks';
+ $this->table2 = $this->test_prefix.'cntcts_cards';
}
public function tearDown() {
@@ -36,6 +36,9 @@ class Test_DBSchema extends PHPUnit_Framework_TestCase {
}
// everything in one test, they depend on each other
+ /**
+ * @medium
+ */
public function testSchema() {
$this->doTestSchemaCreating();
$this->doTestSchemaChanging();
@@ -91,13 +94,18 @@ class Test_DBSchema extends PHPUnit_Framework_TestCase {
break;
case 'pgsql':
$sql = "SELECT tablename AS table_name, schemaname AS schema_name "
- . "FROM pg_tables WHERE schemaname NOT LIKE 'pg_%' "
+ . "FROM pg_tables WHERE schemaname NOT LIKE 'pg_%' "
. "AND schemaname != 'information_schema' "
. "AND tablename = '".$table."'";
$query = OC_DB::prepare($sql);
$result = $query->execute(array());
$exists = $result && $result->fetchOne();
break;
+ case 'oci':
+ $sql = 'SELECT table_name FROM user_tables WHERE table_name = ?';
+ $result = \OC_DB::executeAudited($sql, array($table));
+ $exists = (bool)$result->fetchOne(); //oracle uses MDB2 and returns null
+ break;
case 'mssql':
$sql = "SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = '{$table}'";
$query = OC_DB::prepare($sql);