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 <diosmosis@users.noreply.github.com>2018-09-06 01:33:03 +0300
committerGitHub <noreply@github.com>2018-09-06 01:33:03 +0300
commitd679c5571ece625b9863c63ad9b99d09f28ce63f (patch)
tree92c8d40c945c21d9aaf13837eac24f91c7de4e97 /config
parent04c8456861787b50b22444617bef114eb00be7e1 (diff)
Add [tests] config option to enable logging in tests. (#13335)
* Add [tests] config option to enable logging in tests. * Allow tests:run/tests:run-ui commands to enable logging for individual runs + during tests only log to file. * Remove Fixture field * fix failing test * fixing build * Fix another failure. * Fix an other test.
Diffstat (limited to 'config')
-rw-r--r--config/environment/test.php21
-rw-r--r--config/global.ini.php1
2 files changed, 21 insertions, 1 deletions
diff --git a/config/environment/test.php b/config/environment/test.php
index 2ac39275b8..785eb15ce4 100644
--- a/config/environment/test.php
+++ b/config/environment/test.php
@@ -8,7 +8,26 @@ use Piwik\Tests\Framework\Mock\TestConfig;
return array(
// Disable logging
- 'Psr\Log\LoggerInterface' => DI\object('Psr\Log\NullLogger'),
+ 'Psr\Log\LoggerInterface' => \DI\decorate(function ($previous, ContainerInterface $c) {
+ $enableLogging = $c->get('ini.tests.enable_logging') == 1 || !empty(getenv('MATOMO_TESTS_ENABLE_LOGGING'));
+ if ($enableLogging) {
+ return $previous;
+ } else {
+ return $c->get(\Psr\Log\NullLogger::class);
+ }
+ }),
+
+ 'Tests.log.allowAllHandlers' => false,
+
+ 'log.handlers' => \DI\decorate(function ($previous, ContainerInterface $c) {
+ if ($c->get('Tests.log.allowAllHandlers')) {
+ return $previous;
+ }
+
+ return [
+ $c->get('Piwik\Plugins\Monolog\Handler\FileHandler'),
+ ];
+ }),
'Piwik\Cache\Backend' => function () {
return \Piwik\Cache::buildBackend('file');
diff --git a/config/global.ini.php b/config/global.ini.php
index fd7b26c826..17df341682 100644
--- a/config/global.ini.php
+++ b/config/global.ini.php
@@ -72,6 +72,7 @@ http_host = localhost
remote_addr = "127.0.0.1"
request_uri = "@REQUEST_URI@"
port =
+enable_logging = 0
; access key and secret as listed in AWS -> IAM -> Users
aws_accesskey = ""