diff options
author | diosmosis <benaka@piwik.pro> | 2015-05-26 22:34:48 +0300 |
---|---|---|
committer | diosmosis <benaka@piwik.pro> | 2015-06-02 01:05:28 +0300 |
commit | ba2f86b2c7c20fa1f8994b5496cbed217ac0cc3f (patch) | |
tree | 60b7fa39d0751fb1659ad921f31814bfeae3ec16 /tests | |
parent | bd7b1634f08a2452d8cd526a99b0d0248834658a (diff) |
Use test.php DI config options if PIWIK_TEST_MODE is defined.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/PHPUnit/Framework/Fixture.php | 2 | ||||
-rwxr-xr-x | tests/PHPUnit/Framework/TestCase/UnitTestCase.php | 4 | ||||
-rw-r--r-- | tests/PHPUnit/Framework/TestingEnvironment.php | 4 | ||||
-rw-r--r-- | tests/PHPUnit/bootstrap.php | 2 | ||||
-rw-r--r-- | tests/PHPUnit/proxy/includes.php | 3 |
5 files changed, 7 insertions, 8 deletions
diff --git a/tests/PHPUnit/Framework/Fixture.php b/tests/PHPUnit/Framework/Fixture.php index 930d5b222d..3136c14198 100644 --- a/tests/PHPUnit/Framework/Fixture.php +++ b/tests/PHPUnit/Framework/Fixture.php @@ -913,7 +913,7 @@ class Fixture extends \PHPUnit_Framework_Assert public function createEnvironmentInstance() { - $this->piwikEnvironment = new Environment('test', array_merge($this->provideContainerConfig(), $this->extraDefinitions)); + $this->piwikEnvironment = new Environment($environment = null, array_merge($this->provideContainerConfig(), $this->extraDefinitions)); $this->piwikEnvironment->init(); } } diff --git a/tests/PHPUnit/Framework/TestCase/UnitTestCase.php b/tests/PHPUnit/Framework/TestCase/UnitTestCase.php index f1044a447f..70c054faea 100755 --- a/tests/PHPUnit/Framework/TestCase/UnitTestCase.php +++ b/tests/PHPUnit/Framework/TestCase/UnitTestCase.php @@ -39,7 +39,7 @@ abstract class UnitTestCase extends \PHPUnit_Framework_TestCase // 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', array(), $postBootstrappedEvent = false); + $nextTestEnviornment = new Environment($environment = null, array(), $postBootstrappedEvent = false); $nextTestEnviornment->init(); parent::tearDown(); @@ -57,7 +57,7 @@ abstract class UnitTestCase extends \PHPUnit_Framework_TestCase protected function initEnvironment() { - $this->environment = new Environment('test', $this->provideContainerConfig(), $postBootstrappedEvent = false); + $this->environment = new Environment($environment = null, $this->provideContainerConfig(), $postBootstrappedEvent = false); $this->environment->init(); } } diff --git a/tests/PHPUnit/Framework/TestingEnvironment.php b/tests/PHPUnit/Framework/TestingEnvironment.php index 94b85e012c..dec7d75299 100644 --- a/tests/PHPUnit/Framework/TestingEnvironment.php +++ b/tests/PHPUnit/Framework/TestingEnvironment.php @@ -18,10 +18,6 @@ use Piwik\DbHelper; use Piwik\Piwik; use Piwik\Application\Environment; -if (!defined('PIWIK_TEST_MODE')) { - define('PIWIK_TEST_MODE', true); -} - class Piwik_MockAccess { private $access; diff --git a/tests/PHPUnit/bootstrap.php b/tests/PHPUnit/bootstrap.php index a6045ad407..01dda0ec0d 100644 --- a/tests/PHPUnit/bootstrap.php +++ b/tests/PHPUnit/bootstrap.php @@ -43,7 +43,7 @@ if (getenv('PIWIK_USE_XHPROF') == 1) { // setup container for tests function setupRootContainer() { - $rootTestEnvironment = new \Piwik\Application\Environment('test'); + $rootTestEnvironment = new \Piwik\Application\Environment(null); $rootTestEnvironment->init(); } diff --git a/tests/PHPUnit/proxy/includes.php b/tests/PHPUnit/proxy/includes.php index 69af8b7804..2b3407f5d5 100644 --- a/tests/PHPUnit/proxy/includes.php +++ b/tests/PHPUnit/proxy/includes.php @@ -6,6 +6,9 @@ if (!defined('PIWIK_INCLUDE_PATH')) { if (!defined('PIWIK_USER_PATH')) { define('PIWIK_USER_PATH', PIWIK_INCLUDE_PATH); } +if (!defined('PIWIK_TEST_MODE')) { + define('PIWIK_TEST_MODE', true); +} require_once PIWIK_INCLUDE_PATH . '/core/bootstrap.php'; |