diff --git a/core/Plugin/Manager.php b/core/Plugin/Manager.php
index f59435b077d99d0b26732a3172ffc9657a12b827..bb956582f95722003d3b814d343c2b5c7af197f1 100644
--- a/core/Plugin/Manager.php
+++ b/core/Plugin/Manager.php
@@ -715,6 +715,9 @@ class Manager extends Singleton
      */
     public function getActivatedPlugins()
     {
+        if(defined('PIWIK_TEST_MODE')) {
+            return array_intersect($this->pluginsToLoad, $this->getPluginsToLoadDuringTests());
+        }
         return $this->pluginsToLoad;
     }
 
diff --git a/tests/PHPUnit/bootstrap.php b/tests/PHPUnit/bootstrap.php
index 7e05c4364859708d0160b94dd0106a17adca28e1..4a9d33be80d805b4df2024ad7828a31310534bba 100644
--- a/tests/PHPUnit/bootstrap.php
+++ b/tests/PHPUnit/bootstrap.php
@@ -7,6 +7,7 @@
 use Piwik\Http;
 
 define('PIWIK_TEST_MODE', true);
+define('PIWIK_PRINT_ERROR_BACKTRACE', false);
 
 if (!defined("PIWIK_PATH_TEST_TO_ROOT")) {
     define('PIWIK_PATH_TEST_TO_ROOT', realpath(dirname(__FILE__) . '/../..'));