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>2015-05-21 02:04:26 +0300
committerdiosmosis <benaka@piwik.pro>2015-05-21 18:32:41 +0300
commit6866c3aa5924e8a9d6760a17eff4323216bd7da4 (patch)
tree3e22a12e897b10f89b81c308a98132d036e9c6da /tests/PHPUnit/Framework/TestCase
parentadfe1bb8b0822dca1daecfce1062fdd36ade7bf6 (diff)
For integration tests, recreate test environment in setUp(). This is required since the environment can be modified during tests, and these modifications must be removed after (eg, event observers can be registered). Since Plugin\Manager is in DI, we must also reload plugins.
Integration/Plugin/ManagerTest.php was modified; order of plugins changed because Fixture::loadPlugins() will use TestingEnvironment to gather plugins, which sorts plugins by name.
Diffstat (limited to 'tests/PHPUnit/Framework/TestCase')
-rw-r--r--tests/PHPUnit/Framework/TestCase/IntegrationTestCase.php4
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/PHPUnit/Framework/TestCase/IntegrationTestCase.php b/tests/PHPUnit/Framework/TestCase/IntegrationTestCase.php
index 7a1e3b4375..25bf27490c 100644
--- a/tests/PHPUnit/Framework/TestCase/IntegrationTestCase.php
+++ b/tests/PHPUnit/Framework/TestCase/IntegrationTestCase.php
@@ -74,6 +74,10 @@ abstract class IntegrationTestCase extends SystemTestCase
{
parent::setUp();
+ self::$fixture->createEnvironmentInstance();
+
+ Fixture::loadAllPlugins(new \Piwik_TestingEnvironment(), get_class($this), self::$fixture->extraPluginsToLoad);
+
if (!empty(self::$tableData)) {
self::restoreDbTables(self::$tableData);
}