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-04-06 07:49:37 +0300
committerdiosmosis <benaka@piwik.pro>2015-04-06 07:49:37 +0300
commitd01ac2028a7877171c7f5a868b2ff2d7ccff14ac (patch)
tree0a4e678ca7e342a7230a7a96f8e2b9a99d48ed37 /tests/PHPUnit/Framework/TestCase
parent59da292a3505a740fd0189e7f1d0f9231edeeb12 (diff)
Make IniSettingsProvider a singleton in order to make sure IniFileChain is shared (again, regressed in a previous commit), and fixed many tests. Changed CacheTest from integration to unit.
Diffstat (limited to 'tests/PHPUnit/Framework/TestCase')
-rw-r--r--tests/PHPUnit/Framework/TestCase/IntegrationTestCase.php3
-rwxr-xr-xtests/PHPUnit/Framework/TestCase/UnitTestCase.php11
2 files changed, 7 insertions, 7 deletions
diff --git a/tests/PHPUnit/Framework/TestCase/IntegrationTestCase.php b/tests/PHPUnit/Framework/TestCase/IntegrationTestCase.php
index b132465431..7a1e3b4375 100644
--- a/tests/PHPUnit/Framework/TestCase/IntegrationTestCase.php
+++ b/tests/PHPUnit/Framework/TestCase/IntegrationTestCase.php
@@ -13,7 +13,6 @@ use Piwik\Db;
use Piwik\Tests\Framework\Fixture;
use Piwik\Cache as PiwikCache;
use Piwik\Tests\Framework\Mock\TestConfig;
-use Piwik\Translate;
/**
* Tests extending IntegrationTestCase are much slower to run: the setUp will
@@ -75,8 +74,6 @@ abstract class IntegrationTestCase extends SystemTestCase
{
parent::setUp();
- Config::setSingletonInstance(new TestConfig());
-
if (!empty(self::$tableData)) {
self::restoreDbTables(self::$tableData);
}
diff --git a/tests/PHPUnit/Framework/TestCase/UnitTestCase.php b/tests/PHPUnit/Framework/TestCase/UnitTestCase.php
index 69347c99c7..3d9f8e660d 100755
--- a/tests/PHPUnit/Framework/TestCase/UnitTestCase.php
+++ b/tests/PHPUnit/Framework/TestCase/UnitTestCase.php
@@ -9,6 +9,7 @@
namespace Piwik\Tests\Framework\TestCase;
use Piwik\Application\Environment;
+use Piwik\Application\Kernel\GlobalSettingsProvider\IniSettingsProvider;
use Piwik\Container\StaticContainer;
use Piwik\EventDispatcher;
use Piwik\Tests\Framework\Mock\File;
@@ -23,13 +24,15 @@ abstract class UnitTestCase extends \PHPUnit_Framework_TestCase
/**
* @var Environment
*/
- private $environment;
+ protected $environment;
public function setUp()
{
parent::setUp();
- $this->environment = new Environment('test', $this->provideContainerConfig());
+ IniSettingsProvider::unsetSingletonInstance();
+
+ $this->environment = new Environment('test', $this->provideContainerConfig(), $postBootstrappedEvent = false);
$this->environment->init();
File::reset();
@@ -40,11 +43,11 @@ abstract class UnitTestCase extends \PHPUnit_Framework_TestCase
{
File::reset();
- StaticContainer::clearContainer();
+ IniSettingsProvider::unsetSingletonInstance();
// make sure the global container exists for the next test case that is executed (since logging can be done
// before a test sets up an environment)
- $nextTestEnviornment = new Environment('test');
+ $nextTestEnviornment = new Environment('test', array(), $postBootstrappedEvent = false);
$nextTestEnviornment->init();
parent::tearDown();