Browse Source

Added option about transactions table truncation in migration scripts - refs BT#4882

Yannick Warnier 12 years ago
parent
commit
cc47a54e9f
1 changed files with 7 additions and 4 deletions
  1. 7 4
      tests/migrate/migration.class.php

+ 7 - 4
tests/migrate/migration.class.php

@@ -206,16 +206,19 @@ class Migration {
     /**
      * Test a series of hand-crafted transactions
      * @param array of parameters that would usually get passed to the web service
+     * @param bool Whether to truncate the transaction table before the test or not
      * @return void
      */
-    function test_transactions($web_service_params) {
+    function test_transactions($web_service_params, $truncate = false) {
         error_log('search_transactions');
         //Just for tests
         
         //Cleaning transaction table
-        $table = Database::get_main_table(TABLE_MIGRATION_TRANSACTION);
-        $sql = "TRUNCATE $table";
-        Database::query($sql);
+        if ($truncate) {
+            $table = Database::get_main_table(TABLE_MIGRATION_TRANSACTION);
+            $sql = "TRUNCATE $table";
+            Database::query($sql);
+        }
         
         $transaction_harcoded = array(
             array(