Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordiosmosis <benaka@piwik.pro>2014-11-04 21:55:41 +0300
committerdiosmosis <benaka@piwik.pro>2014-11-04 21:56:08 +0300
commit548a33d380bf51cd9e36cd41701368f66de2e94c (patch)
tree53beaef1d532190b087e4ff9ab180f14654f9a2f /core/DbHelper.php
parent7bf5c796d7255291d499aae1b95a543305729bc7 (diff)
Allow UI tests to delete archiving tables.
Diffstat (limited to 'core/DbHelper.php')
-rw-r--r--core/DbHelper.php16
1 files changed, 15 insertions, 1 deletions
diff --git a/core/DbHelper.php b/core/DbHelper.php
index 8dbf7d0a9e..0c5ed79059 100644
--- a/core/DbHelper.php
+++ b/core/DbHelper.php
@@ -11,6 +11,7 @@ namespace Piwik;
use Exception;
use Piwik\Db\Adapter;
use Piwik\Db\Schema;
+use Piwik\DataAccess\ArchiveTableCreator;
/**
* Contains database related helper functions.
@@ -173,4 +174,17 @@ class DbHelper
return Schema::getInstance()->getTableCreateSql($tableName);
}
-}
+ /**
+ * Deletes archive tables. For use in tests.
+ */
+ public static function deleteArchiveTables()
+ {
+ foreach (ArchiveTableCreator::getTablesArchivesInstalled() as $table) {
+ Log::debug("Dropping table $table");
+
+ Db::query("DROP TABLE IF EXISTS `$table`");
+ }
+
+ ArchiveTableCreator::refreshTableList($forceReload = true);
+ }
+} \ No newline at end of file