Index: client/review/db/pgsql.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/project_issue_file_review/client/review/db/pgsql.inc,v
retrieving revision 1.15
diff -u -r1.15 pgsql.inc
--- client/review/db/pgsql.inc	4 Dec 2009 21:52:49 -0000	1.15
+++ client/review/db/pgsql.inc	23 Dec 2009 23:45:28 -0000
@@ -60,4 +60,15 @@
     }
     return FALSE;
   }
+
+  public function import($file, $prefix) {
+    $this->query(file_get_contents($file));
+
+    $information = $this->get_information();
+    $database = $information['name'];
+    $this->query("SELECT table_name FROM information_schema.tables WHERE (table_schema = '$database' OR table_catalog = '$database')");
+    foreach ($tables as $table) {
+      $this->query('RENAME TABLE ' . $table . ' TO ' . $prefix . $table);
+    }
+  }
 }
Index: client/review/db/sqlite.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/project_issue_file_review/client/review/db/sqlite.inc,v
retrieving revision 1.7
diff -u -r1.7 sqlite.inc
--- client/review/db/sqlite.inc	4 Dec 2009 21:52:49 -0000	1.7
+++ client/review/db/sqlite.inc	23 Dec 2009 23:45:28 -0000
@@ -74,4 +74,15 @@
     }
     return array();
   }
+
+  public function import($file, $prefix) {
+    $this->query(file_get_contents($file));
+
+    $information = $this->get_information();
+    $database = $information['name'];
+    $this->query("SELECT table_name FROM information_schema.tables WHERE (table_schema = '$database' OR table_catalog = '$database')");
+    foreach ($tables as $table) {
+      $this->query('RENAME TABLE ' . $table . ' TO ' . $prefix . $table);
+    }
+  }
 }
Index: client/review/db/mysql.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/project_issue_file_review/client/review/db/mysql.inc,v
retrieving revision 1.14
diff -u -r1.14 mysql.inc
--- client/review/db/mysql.inc	4 Dec 2009 21:52:49 -0000	1.14
+++ client/review/db/mysql.inc	23 Dec 2009 23:45:28 -0000
@@ -64,4 +64,13 @@
     }
     return FALSE;
   }
+
+  public function import($file, $prefix) {
+    $this->query(file_get_contents($file));
+
+    $tables = $this->query('SHOW TABLES');
+    foreach ($tables as $table) {
+      $this->query('RENAME TABLE ' . $table . ' TO ' . $prefix . $table);
+    }
+  }
 }
Index: client/review/db/db.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/project_issue_file_review/client/review/db/db.inc,v
retrieving revision 1.11
diff -u -r1.11 db.inc
--- client/review/db/db.inc	4 Dec 2009 21:52:49 -0000	1.11
+++ client/review/db/db.inc	23 Dec 2009 23:45:28 -0000
@@ -53,4 +53,6 @@
    * @return array List of rows or FALSE on failure.
    */
   public function query($sql);
+
+  public function import($file, $prefix);
 }
Index: review/simpletest/pifr_simpletest.server.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/project_issue_file_review/review/simpletest/pifr_simpletest.server.inc,v
retrieving revision 1.15
diff -u -r1.15 pifr_simpletest.server.inc
--- review/simpletest/pifr_simpletest.server.inc	23 Dec 2009 01:49:26 -0000	1.15
+++ review/simpletest/pifr_simpletest.server.inc	23 Dec 2009 23:45:28 -0000
@@ -21,6 +21,7 @@
     'tests' => array(),
     'modules' => array(),
     'directory' => '',
+    'clone_db' => '',
   );
 
   /**
Index: review/simpletest/pifr_simpletest.client.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/project_issue_file_review/review/simpletest/pifr_simpletest.client.inc,v
retrieving revision 1.23
diff -u -r1.23 pifr_simpletest.client.inc
--- review/simpletest/pifr_simpletest.client.inc	23 Dec 2009 01:46:59 -0000	1.23
+++ review/simpletest/pifr_simpletest.client.inc	23 Dec 2009 23:45:28 -0000
@@ -15,6 +15,28 @@
  */
 class pifr_client_review_pifr_simpletest extends pifr_client_review_pifr_drupal {
 
+  public function __construct(array $test) {
+    parent::__construct($test);
+
+    if (!empty($this->test['review']['argument']['clone_db'])) {
+      $this->test['files'][] = $this->test['review']['argument']['clone_db'];
+    }
+  }
+
+  protected function install() {
+    if ($this->test['review']['argument']['clone_db']) {
+      $basename = basename($this->test['review']['argument']['clone_db']);
+      foreach ($this->files as $file) {
+        if (basename($file) == $basename) {
+          $this->database->import($file, 'clone_db');
+          break;
+        }
+      }
+    }
+
+    parent::install();
+  }
+
   /**
    * Run SimpleTest tests.
    */
