diff options
author | diosmosis <benaka@piwik.pro> | 2015-06-01 02:00:30 +0300 |
---|---|---|
committer | diosmosis <benaka@piwik.pro> | 2015-06-03 20:01:33 +0300 |
commit | 86f472e3620a07981332c1c4f06329d68fb5a73d (patch) | |
tree | 3ad22b737530f754ecb2a17cf379cfd369336dcd /config/environment | |
parent | bf55995a0c343667bfbc2f86761d22a3b02b3a19 (diff) |
Move Access singleton to DI.
Diffstat (limited to 'config/environment')
-rw-r--r-- | config/environment/test.php | 17 |
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(); |