diff options
author | diosmosis <benaka@piwik.pro> | 2015-06-18 11:26:13 +0300 |
---|---|---|
committer | diosmosis <benaka@piwik.pro> | 2015-06-20 03:09:13 +0300 |
commit | 1b0671cbb15c81a5affb44843f67d95b83f53629 (patch) | |
tree | 306bcd1c928731dd1d02d7b32997b703f8b1b006 /tests/PHPUnit/Framework/Fixture.php | |
parent | a75bc3b621337e93d899c011f3f8a260e6cb13e4 (diff) |
Make sure to destroy the environment in integration tests.
Diffstat (limited to 'tests/PHPUnit/Framework/Fixture.php')
-rw-r--r-- | tests/PHPUnit/Framework/Fixture.php | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/PHPUnit/Framework/Fixture.php b/tests/PHPUnit/Framework/Fixture.php index 9d74047e44..ceef2feab0 100644 --- a/tests/PHPUnit/Framework/Fixture.php +++ b/tests/PHPUnit/Framework/Fixture.php @@ -327,6 +327,8 @@ class Fixture extends \PHPUnit_Framework_Assert $this->clearInMemoryCaches(); Log::unsetInstance(); + + $this->destroyEnvironment(); } public function clearInMemoryCaches() @@ -908,4 +910,14 @@ class Fixture extends \PHPUnit_Framework_Assert $this->piwikEnvironment = new Environment($environment = null, $this->extraDefinitions); $this->piwikEnvironment->init(); } + + public function destroyEnvironment() + { + if ($this->piwikEnvironment === null) { + return; + } + + $this->piwikEnvironment->destroy(); + $this->piwikEnvironment = null; + } } |