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-06-01 08:31:03 +0300
committerdiosmosis <benaka@piwik.pro>2015-06-05 23:04:58 +0300
commit53a29ed2338094321bb077574e369e62231d62da (patch)
tree4a38da280d49963c8c30fb7daf83dead9af37269
parent447ff12b141f1bba9cab78396cb12ff2b98b595c (diff)
Rename TestingEnvironment to TestingEnvironmentVariables.
-rw-r--r--config/environment/test.php18
-rw-r--r--misc/cron/updatetoken.php2
-rw-r--r--tests/PHPUnit/Framework/Fixture.php6
-rw-r--r--tests/PHPUnit/Framework/Mock/TestConfig.php6
-rw-r--r--tests/PHPUnit/Framework/TestCase/IntegrationTestCase.php2
-rw-r--r--tests/PHPUnit/Framework/TestingEnvironment/MakeGlobalSettingsWithFile.php4
-rw-r--r--tests/PHPUnit/Framework/TestingEnvironmentVariables.php (renamed from tests/PHPUnit/Framework/TestingEnvironment.php)4
-rw-r--r--tests/PHPUnit/System/EnvironmentValidationTest.php8
-rwxr-xr-xtests/PHPUnit/System/ImportLogsTest.php8
-rw-r--r--tests/PHPUnit/System/TrackerTest.php8
-rw-r--r--tests/PHPUnit/proxy/archive.php2
-rw-r--r--tests/PHPUnit/proxy/console2
-rw-r--r--tests/PHPUnit/proxy/index.php2
-rwxr-xr-xtests/PHPUnit/proxy/piwik.php2
14 files changed, 37 insertions, 37 deletions
diff --git a/config/environment/test.php b/config/environment/test.php
index 6d8bb04a2e..5fadb7a9ec 100644
--- a/config/environment/test.php
+++ b/config/environment/test.php
@@ -6,7 +6,7 @@ use Piwik\DbHelper;
use Piwik\Option;
use Piwik\Tests\Framework\Mock\TestConfig;
use Piwik\Tests\Framework\Piwik_MockAccess;
-use Piwik\Tests\Framework\TestingEnvironment;
+use Piwik\Tests\Framework\TestingEnvironmentVariables;
return array(
@@ -20,7 +20,7 @@ return array(
// Disable loading core translations
'Piwik\Translation\Translator' => DI\decorate(function ($previous, ContainerInterface $c) {
- $testingEnvironment = $c->get('Piwik\Tests\Framework\TestingEnvironment');
+ $testingEnvironment = $c->get('Piwik\Tests\Framework\TestingEnvironmentVariables');
if (!$testingEnvironment->loadRealTranslations) {
return new \Piwik\Translation\Translator($c->get('Piwik\Translation\Loader\LoaderInterface'), $directories = array());
} else {
@@ -29,7 +29,7 @@ return array(
}),
'Piwik\Config' => DI\decorate(function ($previous, ContainerInterface $c) {
- $testingEnvironment = $c->get('Piwik\Tests\Framework\TestingEnvironment');
+ $testingEnvironment = $c->get('Piwik\Tests\Framework\TestingEnvironmentVariables');
if (!$testingEnvironment->dontUseTestConfig) {
$settingsProvider = $c->get('Piwik\Application\Kernel\GlobalSettingsProvider');
return new TestConfig($settingsProvider, $testingEnvironment, $allowSave = false, $doSetTestEnvironment = true);
@@ -39,7 +39,7 @@ return array(
}),
'Piwik\Access' => DI\decorate(function ($previous, ContainerInterface $c) {
- $testingEnvironment = $c->get('Piwik\Tests\Framework\TestingEnvironment');
+ $testingEnvironment = $c->get('Piwik\Tests\Framework\TestingEnvironmentVariables');
if ($testingEnvironment->testUseMockAuth) {
return new Piwik_MockAccess($previous);
} else {
@@ -50,7 +50,7 @@ return array(
'observers.global' => DI\add(array(
array('Environment.bootstrapped', function () {
- $testingEnvironment = new TestingEnvironment();
+ $testingEnvironment = new TestingEnvironmentVariables();
$testingEnvironment->executeSetupTestEnvHook();
if (empty($_GET['ignoreClearAllViewDataTableParameters'])) { // TODO: should use testingEnvironment variable, not query param
@@ -61,7 +61,7 @@ return array(
}
}
- $testingEnvironment = new TestingEnvironment();
+ $testingEnvironment = new TestingEnvironmentVariables();
if ($testingEnvironment->optionsOverride) {
try {
foreach ($testingEnvironment->optionsOverride as $name => $value) {
@@ -76,7 +76,7 @@ return array(
\Piwik\Visualization\Sparkline::$enableSparklineImages = false;
\Piwik\Plugins\ExampleUI\API::$disableRandomness = true;
- $testingEnvironment = new TestingEnvironment();
+ $testingEnvironment = new TestingEnvironmentVariables();
if ($testingEnvironment->deleteArchiveTables
&& !$testingEnvironment->_archivingTablesDeleted
) {
@@ -86,14 +86,14 @@ return array(
}),
array('AssetManager.getStylesheetFiles', function (&$stylesheets) {
- $testingEnvironment = new TestingEnvironment();
+ $testingEnvironment = new TestingEnvironmentVariables();
if ($testingEnvironment->useOverrideCss) {
$stylesheets[] = 'tests/resources/screenshot-override/override.css';
}
}),
array('AssetManager.getJavaScriptFiles', function (&$jsFiles) {
- $testingEnvironment = new TestingEnvironment();
+ $testingEnvironment = new TestingEnvironmentVariables();
if ($testingEnvironment->useOverrideJs) {
$jsFiles[] = 'tests/resources/screenshot-override/override.js';
}
diff --git a/misc/cron/updatetoken.php b/misc/cron/updatetoken.php
index 5664b89294..007d41a600 100644
--- a/misc/cron/updatetoken.php
+++ b/misc/cron/updatetoken.php
@@ -35,7 +35,7 @@ $testmode = in_array('--testmode', $_SERVER['argv']);
if ($testmode) {
define('PIWIK_TEST_MODE', true);
- Tests\Framework\TestingEnvironment::addHooks();
+ Tests\Framework\TestingEnvironmentVariables::addHooks();
}
function getPiwikDomain()
diff --git a/tests/PHPUnit/Framework/Fixture.php b/tests/PHPUnit/Framework/Fixture.php
index 0c251dcfea..5f070f2d32 100644
--- a/tests/PHPUnit/Framework/Fixture.php
+++ b/tests/PHPUnit/Framework/Fixture.php
@@ -48,7 +48,7 @@ use Piwik\Tracker\Cache;
use Piwik\Translate;
use Piwik\Url;
use PHPUnit_Framework_Assert;
-use Piwik\Tests\Framework\TestingEnvironment;
+use Piwik\Tests\Framework\TestingEnvironmentVariables;
use PiwikTracker;
use Piwik_LocalTracker;
use Piwik\Updater;
@@ -287,7 +287,7 @@ class Fixture extends \PHPUnit_Framework_Assert
public function getTestEnvironment()
{
if ($this->testEnvironment === null) {
- $this->testEnvironment = new TestingEnvironment();
+ $this->testEnvironment = new TestingEnvironmentVariables();
$this->testEnvironment->delete();
if (getenv('PIWIK_USE_XHPROF') == 1) {
@@ -348,7 +348,7 @@ class Fixture extends \PHPUnit_Framework_Assert
public static function loadAllPlugins($testEnvironment = null, $testCaseClass = false, $extraPluginsToLoad = array())
{
if (empty($testEnvironment)) {
- $testEnvironment = new TestingEnvironment();
+ $testEnvironment = new TestingEnvironmentVariables();
}
DbHelper::createTables();
diff --git a/tests/PHPUnit/Framework/Mock/TestConfig.php b/tests/PHPUnit/Framework/Mock/TestConfig.php
index 7509100c55..7e1480cd8d 100644
--- a/tests/PHPUnit/Framework/Mock/TestConfig.php
+++ b/tests/PHPUnit/Framework/Mock/TestConfig.php
@@ -10,14 +10,14 @@ namespace Piwik\Tests\Framework\Mock;
use Piwik\Application\Kernel\GlobalSettingsProvider;
use Piwik\Config;
-use Piwik\Tests\Framework\TestingEnvironment;
+use Piwik\Tests\Framework\TestingEnvironmentVariables;
class TestConfig extends Config
{
private $allowSave = false;
private $doSetTestEnvironment = false;
- public function __construct(GlobalSettingsProvider $provider, TestingEnvironment $testingEnvironment, $allowSave = false, $doSetTestEnvironment = true)
+ public function __construct(GlobalSettingsProvider $provider, TestingEnvironmentVariables $testingEnvironment, $allowSave = false, $doSetTestEnvironment = true)
{
parent::__construct($provider);
@@ -73,7 +73,7 @@ class TestConfig extends Config
$chain->set('PluginsInstalled', array('PluginsInstalled' => array()));
}
- private function setFromTestEnvironment(\Piwik\Tests\Framework\TestingEnvironment $testingEnvironment)
+ private function setFromTestEnvironment(\Piwik\Tests\Framework\TestingEnvironmentVariables $testingEnvironment)
{
$pluginsToLoad = $testingEnvironment->getCoreAndSupportedPlugins();
if (!empty($testingEnvironment->pluginsToLoad)) {
diff --git a/tests/PHPUnit/Framework/TestCase/IntegrationTestCase.php b/tests/PHPUnit/Framework/TestCase/IntegrationTestCase.php
index a230500315..f87568041a 100644
--- a/tests/PHPUnit/Framework/TestCase/IntegrationTestCase.php
+++ b/tests/PHPUnit/Framework/TestCase/IntegrationTestCase.php
@@ -78,7 +78,7 @@ abstract class IntegrationTestCase extends SystemTestCase
self::$fixture->extraDefinitions = array_merge(static::provideContainerConfigBeforeClass(), $this->provideContainerConfig());
self::$fixture->createEnvironmentInstance();
- Fixture::loadAllPlugins(new \Piwik\Tests\Framework\TestingEnvironment(), get_class($this), self::$fixture->extraPluginsToLoad);
+ Fixture::loadAllPlugins(new \Piwik\Tests\Framework\TestingEnvironmentVariables(), get_class($this), self::$fixture->extraPluginsToLoad);
Access::getInstance()->setSuperUserAccess(true);
diff --git a/tests/PHPUnit/Framework/TestingEnvironment/MakeGlobalSettingsWithFile.php b/tests/PHPUnit/Framework/TestingEnvironment/MakeGlobalSettingsWithFile.php
index 2c2ead227d..62a09356e5 100644
--- a/tests/PHPUnit/Framework/TestingEnvironment/MakeGlobalSettingsWithFile.php
+++ b/tests/PHPUnit/Framework/TestingEnvironment/MakeGlobalSettingsWithFile.php
@@ -9,7 +9,7 @@ namespace Piwik\Tests\Framework\TestingEnvironment;
use Piwik\Application\EnvironmentManipulator;
use Piwik\Application\Kernel\GlobalSettingsProvider;
-use Piwik\Tests\Framework\TestingEnvironment;
+use Piwik\Tests\Framework\TestingEnvironmentVariables;
class MakeGlobalSettingsWithFile implements EnvironmentManipulator
{
@@ -17,7 +17,7 @@ class MakeGlobalSettingsWithFile implements EnvironmentManipulator
private $configFileLocal;
private $configFileCommon;
- public function __construct(\Piwik\Tests\Framework\TestingEnvironment $testingEnvironment)
+ public function __construct(\Piwik\Tests\Framework\TestingEnvironmentVariables $testingEnvironment)
{
$this->configFileGlobal = $testingEnvironment->configFileGlobal;
$this->configFileLocal = $testingEnvironment->configFileLocal;
diff --git a/tests/PHPUnit/Framework/TestingEnvironment.php b/tests/PHPUnit/Framework/TestingEnvironmentVariables.php
index b60ed69843..158192fbaf 100644
--- a/tests/PHPUnit/Framework/TestingEnvironment.php
+++ b/tests/PHPUnit/Framework/TestingEnvironmentVariables.php
@@ -44,7 +44,7 @@ class Piwik_MockAccess
/**
* Sets the test environment.
*/
-class TestingEnvironment
+class TestingEnvironmentVariables
{
private $behaviorOverrideProperties = array();
@@ -114,7 +114,7 @@ class TestingEnvironment
public static function addHooks($globalObservers = array())
{
- $testingEnvironment = new TestingEnvironment();
+ $testingEnvironment = new TestingEnvironmentVariables();
if ($testingEnvironment->queryParamOverride) {
foreach ($testingEnvironment->queryParamOverride as $key => $value) {
diff --git a/tests/PHPUnit/System/EnvironmentValidationTest.php b/tests/PHPUnit/System/EnvironmentValidationTest.php
index 6a256256e2..c283cbbd8f 100644
--- a/tests/PHPUnit/System/EnvironmentValidationTest.php
+++ b/tests/PHPUnit/System/EnvironmentValidationTest.php
@@ -30,7 +30,7 @@ class EnvironmentValidationTest extends SystemTestCase
{
parent::setUp();
- $testingEnvironment = new \Piwik\Tests\Framework\TestingEnvironment();
+ $testingEnvironment = new \Piwik\Tests\Framework\TestingEnvironmentVariables();
$testingEnvironment->configFileGlobal = null;
$testingEnvironment->configFileLocal = null;
$testingEnvironment->configFileCommon = null;
@@ -139,7 +139,7 @@ class EnvironmentValidationTest extends SystemTestCase
private function simulateAbsentConfigFile($fileName)
{
- $testingEnvironment = new \Piwik\Tests\Framework\TestingEnvironment();
+ $testingEnvironment = new \Piwik\Tests\Framework\TestingEnvironmentVariables();
if ($fileName == 'global.ini.php') {
$testingEnvironment->configFileGlobal = PIWIK_INCLUDE_PATH . '/tmp/nonexistant/global.ini.php';
@@ -154,7 +154,7 @@ class EnvironmentValidationTest extends SystemTestCase
private function simulateBadConfigFile($fileName)
{
- $testingEnvironment = new \Piwik\Tests\Framework\TestingEnvironment();
+ $testingEnvironment = new \Piwik\Tests\Framework\TestingEnvironmentVariables();
if ($fileName == 'global.ini.php') {
$testingEnvironment->configFileGlobal = PIWIK_INCLUDE_PATH . '/piwik.php';
@@ -169,7 +169,7 @@ class EnvironmentValidationTest extends SystemTestCase
private function simulateHost($host)
{
- $testingEnvironment = new \Piwik\Tests\Framework\TestingEnvironment();
+ $testingEnvironment = new \Piwik\Tests\Framework\TestingEnvironmentVariables();
$testingEnvironment->hostOverride = $host;
$testingEnvironment->save();
}
diff --git a/tests/PHPUnit/System/ImportLogsTest.php b/tests/PHPUnit/System/ImportLogsTest.php
index 47ee4ce795..353ea6bc69 100755
--- a/tests/PHPUnit/System/ImportLogsTest.php
+++ b/tests/PHPUnit/System/ImportLogsTest.php
@@ -12,7 +12,7 @@ use Piwik\Plugins\SitesManager\API;
use Piwik\Tests\Framework\Fixture;
use Piwik\Tests\Framework\TestCase\SystemTestCase;
use Piwik\Tests\Fixtures\ManySitesImportedLogs;
-use Piwik\Tests\Framework\TestingEnvironment;
+use Piwik\Tests\Framework\TestingEnvironmentVariables;
/**
* Tests the log importer.
@@ -138,7 +138,7 @@ class ImportLogsTest extends SystemTestCase
private function simulateTrackerFailure()
{
- $testingEnvironment = new TestingEnvironment();
+ $testingEnvironment = new TestingEnvironmentVariables();
$testingEnvironment->_triggerTrackerFailure = true;
$testingEnvironment->save();
}
@@ -150,7 +150,7 @@ class ImportLogsTest extends SystemTestCase
private function resetTestingEnvironmentChanges()
{
- $testingEnvironment = new TestingEnvironment();
+ $testingEnvironment = new TestingEnvironmentVariables();
$testingEnvironment->_triggerTrackerFailure = null;
$testingEnvironment->save();
}
@@ -159,7 +159,7 @@ class ImportLogsTest extends SystemTestCase
{
$result = array();
- $testingEnvironment = new TestingEnvironment();
+ $testingEnvironment = new TestingEnvironmentVariables();
if ($testingEnvironment->_triggerTrackerFailure) {
$result['observers.global'] = \DI\add(array(
array('Tracker.newHandler', function () {
diff --git a/tests/PHPUnit/System/TrackerTest.php b/tests/PHPUnit/System/TrackerTest.php
index 6a75ea7584..3db1b05861 100644
--- a/tests/PHPUnit/System/TrackerTest.php
+++ b/tests/PHPUnit/System/TrackerTest.php
@@ -36,7 +36,7 @@ class TrackerTest extends IntegrationTestCase
Fixture::createWebsite('2014-02-04');
- $testingEnvironment = new \Piwik\Tests\Framework\TestingEnvironment();
+ $testingEnvironment = new \Piwik\Tests\Framework\TestingEnvironmentVariables();
$testingEnvironment->testCaseClass = null;
$testingEnvironment->addFailingScheduledTask = false;
$testingEnvironment->addScheduledTask = false;
@@ -291,7 +291,7 @@ class TrackerTest extends IntegrationTestCase
private function setScheduledTasksToRunInTracker()
{
- $testingEnvironment = new \Piwik\Tests\Framework\TestingEnvironment();
+ $testingEnvironment = new \Piwik\Tests\Framework\TestingEnvironmentVariables();
$testingEnvironment->testCaseClass = 'Piwik\Tests\System\TrackerTest';
$testingEnvironment->addScheduledTask = true;
$testingEnvironment->configOverride = array('Tracker' => array('scheduled_tasks_min_interval' => 1, 'debug_on_demand' => 1));
@@ -300,7 +300,7 @@ class TrackerTest extends IntegrationTestCase
private function addFailingScheduledTaskToTracker($doFatalError)
{
- $testingEnvironment = new \Piwik\Tests\Framework\TestingEnvironment();
+ $testingEnvironment = new \Piwik\Tests\Framework\TestingEnvironmentVariables();
$testingEnvironment->addFailingScheduledTask = true;
$testingEnvironment->scheduledTaskFailureShouldBeFatal = $doFatalError;
$testingEnvironment->save();
@@ -312,7 +312,7 @@ class TrackerTest extends IntegrationTestCase
define('DEBUG_FORCE_SCHEDULED_TASKS', 1);
}
- $testingEnvironment = new \Piwik\Tests\Framework\TestingEnvironment();
+ $testingEnvironment = new \Piwik\Tests\Framework\TestingEnvironmentVariables();
$tasksToAdd = array();
diff --git a/tests/PHPUnit/proxy/archive.php b/tests/PHPUnit/proxy/archive.php
index 33c7d715fc..2a6bb927d3 100644
--- a/tests/PHPUnit/proxy/archive.php
+++ b/tests/PHPUnit/proxy/archive.php
@@ -3,7 +3,7 @@ define('PIWIK_ARCHIVE_NO_TRUNCATE', true);
require realpath(dirname(__FILE__)) . "/includes.php";
-\Piwik\Tests\Framework\TestingEnvironment::addHooks();
+\Piwik\Tests\Framework\TestingEnvironmentVariables::addHooks();
// include archive.php, and let 'er rip
require_once PIWIK_INCLUDE_PATH . "/misc/cron/archive.php";
diff --git a/tests/PHPUnit/proxy/console b/tests/PHPUnit/proxy/console
index a6cd68e1ae..c28399b61e 100644
--- a/tests/PHPUnit/proxy/console
+++ b/tests/PHPUnit/proxy/console
@@ -2,6 +2,6 @@
<?php
require realpath(dirname(__FILE__)) . "/includes.php";
-\Piwik\Tests\Framework\TestingEnvironment::addHooks();
+\Piwik\Tests\Framework\TestingEnvironmentVariables::addHooks();
require_once PIWIK_INCLUDE_PATH . "/console";
diff --git a/tests/PHPUnit/proxy/index.php b/tests/PHPUnit/proxy/index.php
index 2c1183235d..391757e7a7 100644
--- a/tests/PHPUnit/proxy/index.php
+++ b/tests/PHPUnit/proxy/index.php
@@ -6,6 +6,6 @@
require realpath(dirname(__FILE__)) . "/includes.php";
-\Piwik\Tests\Framework\TestingEnvironment::addHooks();
+\Piwik\Tests\Framework\TestingEnvironmentVariables::addHooks();
include PIWIK_INCLUDE_PATH . '/index.php'; \ No newline at end of file
diff --git a/tests/PHPUnit/proxy/piwik.php b/tests/PHPUnit/proxy/piwik.php
index 37d1ba834d..633ee0f6c8 100755
--- a/tests/PHPUnit/proxy/piwik.php
+++ b/tests/PHPUnit/proxy/piwik.php
@@ -29,7 +29,7 @@ try {
})
);
- \Piwik\Tests\Framework\TestingEnvironment::addHooks($globalObservers);
+ \Piwik\Tests\Framework\TestingEnvironmentVariables::addHooks($globalObservers);
GeoIp::$geoIPDatabaseDir = 'tests/lib/geoip-files';