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
path: root/config
diff options
context:
space:
mode:
authordiosmosis <benaka@piwik.pro>2015-06-01 02:00:30 +0300
committerdiosmosis <benaka@piwik.pro>2015-06-03 20:01:33 +0300
commit86f472e3620a07981332c1c4f06329d68fb5a73d (patch)
tree3ad22b737530f754ecb2a17cf379cfd369336dcd /config
parentbf55995a0c343667bfbc2f86761d22a3b02b3a19 (diff)
Move Access singleton to DI.
Diffstat (limited to 'config')
-rw-r--r--config/environment/test.php17
1 files changed, 9 insertions, 8 deletions
diff --git a/config/environment/test.php b/config/environment/test.php
index 674d6c44a2..6d8bb04a2e 100644
--- a/config/environment/test.php
+++ b/config/environment/test.php
@@ -38,15 +38,16 @@ return array(
}
}),
- 'observers.global' => DI\add(array(
+ 'Piwik\Access' => DI\decorate(function ($previous, ContainerInterface $c) {
+ $testingEnvironment = $c->get('Piwik\Tests\Framework\TestingEnvironment');
+ if ($testingEnvironment->testUseMockAuth) {
+ return new Piwik_MockAccess($previous);
+ } else {
+ return $previous;
+ }
+ }),
- array('Access.createAccessSingleton', function ($access) {
- $testingEnvironment = new TestingEnvironment();
- if ($testingEnvironment->testUseMockAuth) {
- $access = new Piwik_MockAccess($access);
- \Piwik\Access::setSingletonInstance($access);
- }
- }),
+ 'observers.global' => DI\add(array(
array('Environment.bootstrapped', function () {
$testingEnvironment = new TestingEnvironment();