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:
authorBenaka <diosmosis@users.noreply.github.com>2018-04-04 02:29:55 +0300
committerGitHub <noreply@github.com>2018-04-04 02:29:55 +0300
commit12592860a0d5cf9b17b21fc0945e7c4662f6d3a5 (patch)
treec16771bf319708ec91ef1721c82c1999edf812b0 /tests/PHPUnit/Framework/Fixture.php
parent5732af86a4210b77bbc721742fc85a9a2b31fde7 (diff)
Set Fixture::$persistFixtureData if PERSIST_FIXTURE_DATA env var is used to speed system test running. (#12672)
Diffstat (limited to 'tests/PHPUnit/Framework/Fixture.php')
-rw-r--r--tests/PHPUnit/Framework/Fixture.php9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/PHPUnit/Framework/Fixture.php b/tests/PHPUnit/Framework/Fixture.php
index 5fa9baaffd..a64f8b6f01 100644
--- a/tests/PHPUnit/Framework/Fixture.php
+++ b/tests/PHPUnit/Framework/Fixture.php
@@ -84,6 +84,8 @@ class Fixture extends \PHPUnit_Framework_Assert
const ADMIN_USER_LOGIN = 'superUserLogin';
const ADMIN_USER_PASSWORD = 'superUserPass';
+ const PERSIST_FIXTURE_DATA_ENV = 'PERSIST_FIXTURE_DATA';
+
public $dbName = false;
/**
@@ -191,6 +193,8 @@ class Fixture extends \PHPUnit_Framework_Assert
// TODO: don't use static var, use test env var for this
TestingEnvironmentManipulator::$extraPluginsToLoad = $this->extraPluginsToLoad;
+ $this->initFromEnvVars();
+
$this->dbName = $this->getDbName();
if ($this->persistFixtureData) {
@@ -1038,4 +1042,9 @@ class Fixture extends \PHPUnit_Framework_Assert
$this->piwikEnvironment->destroy();
$this->piwikEnvironment = null;
}
+
+ private function initFromEnvVars()
+ {
+ $this->persistFixtureData = $this->persistFixtureData || (bool)getenv(self::PERSIST_FIXTURE_DATA_ENV);
+ }
}