diff options
author | diosmosis <benaka@piwik.pro> | 2015-05-22 02:07:34 +0300 |
---|---|---|
committer | diosmosis <benaka@piwik.pro> | 2015-05-22 02:24:29 +0300 |
commit | cc23564051f6a8424226b01bd9af6a79c5111375 (patch) | |
tree | abee4186951b3a9bcfdf58a00b01327777f0224a /tests/PHPUnit/Framework/Fixture.php | |
parent | 64f98e3041617ab062794cbf8b215f9f4b867de4 (diff) |
Make sure custom container config defined in Fixtures w/ provideContainerConfig override is applied when creating the Environment. Also allow SystemTestCases and IntegrationTestCases to override container config from the test class, without creating a custom Fixture.
Diffstat (limited to 'tests/PHPUnit/Framework/Fixture.php')
-rw-r--r-- | tests/PHPUnit/Framework/Fixture.php | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/tests/PHPUnit/Framework/Fixture.php b/tests/PHPUnit/Framework/Fixture.php index 19af47b3d5..91a47a82fa 100644 --- a/tests/PHPUnit/Framework/Fixture.php +++ b/tests/PHPUnit/Framework/Fixture.php @@ -101,6 +101,14 @@ class Fixture extends \PHPUnit_Framework_Assert public $testEnvironment = null; /** + * Extra DI configuration to use when creating the test environment. This will override configuration + * returned by the `provideContainerConfig()` method. + * + * @var array + */ + public $extraDefinitions = array(); + + /** * @var Environment */ public $piwikEnvironment; @@ -915,7 +923,7 @@ class Fixture extends \PHPUnit_Framework_Assert public function createEnvironmentInstance() { - $this->piwikEnvironment = new Environment('test'); + $this->piwikEnvironment = new Environment('test', array_merge($this->provideContainerConfig(), $this->extraDefinitions)); $this->piwikEnvironment->init(); } } |