diff options
author | diosmosis <diosmosis@users.noreply.github.com> | 2019-04-01 02:53:19 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-04-01 02:53:19 +0300 |
commit | f2d44ef65a075f2b42f066092c4abef8e94dcc90 (patch) | |
tree | dffd9c2baa70a1ed4db233b705944d64d8bfa83b | |
parent | 79b526dc47f8c776577276f93b8ffb93b5973e76 (diff) |
Fixing build (#14296)
* fix condition
* NullHandler must be end of writer array to allow other handlers to handle the message (since it seems to stop bubbling).
* Do not do php eol check during tests.
* Just in case.
* try to fix the build
* Add screenshot.
-rw-r--r-- | core/Plugin/ControllerAdmin.php | 4 | ||||
-rw-r--r-- | plugins/Monolog/config/config.php | 13 | ||||
-rw-r--r-- | plugins/Overlay/tests/UI/expected-screenshots/Overlay_framed_loaded.png | 3 | ||||
-rw-r--r-- | tests/PHPUnit/Fixtures/UITestFixture.php | 3 |
4 files changed, 16 insertions, 7 deletions
diff --git a/core/Plugin/ControllerAdmin.php b/core/Plugin/ControllerAdmin.php index 60a366b83e..e9040427cf 100644 --- a/core/Plugin/ControllerAdmin.php +++ b/core/Plugin/ControllerAdmin.php @@ -240,6 +240,10 @@ abstract class ControllerAdmin extends Controller private static function notifyWhenPhpVersionIsEOL() { + if (defined('PIWIK_TEST_MODE')) { // to avoid changing every admin UI test + return; + } + $notifyPhpIsEOL = Piwik::hasUserSuperUserAccess() && ! self::isPhpVersionAtLeast71(); if (!$notifyPhpIsEOL) { return; diff --git a/plugins/Monolog/config/config.php b/plugins/Monolog/config/config.php index 4d5e3d15a3..ff60f7c5bd 100644 --- a/plugins/Monolog/config/config.php +++ b/plugins/Monolog/config/config.php @@ -38,12 +38,7 @@ return array( $writerNames = array_map('trim', $writerNames); - $writers = [ - // we always add the null handler to make sure there is at least one handler specified. otherwise Monolog will - // add a stream handler to stderr w/ a DEBUG log level, which will cause archiving requests to fail. - $c->get(\Monolog\Handler\NullHandler::class), - ]; - + $writers = []; foreach ($writerNames as $writerName) { if ($writerName === 'screen' && \Piwik\Common::isPhpCliMode()) { continue; // screen writer is only valid for web requests @@ -77,6 +72,12 @@ return array( $writers[] = $c->get(LogCaptureHandler::class); } + // we always add the null handler to make sure there is at least one handler specified. otherwise Monolog will + // add a stream handler to stderr w/ a DEBUG log level, which will cause archiving requests to fail. + if (empty($writers)) { + $writers[] = $c->get(\Monolog\Handler\NullHandler::class); + } + return array_values($writers); }), diff --git a/plugins/Overlay/tests/UI/expected-screenshots/Overlay_framed_loaded.png b/plugins/Overlay/tests/UI/expected-screenshots/Overlay_framed_loaded.png new file mode 100644 index 0000000000..bf46100ba2 --- /dev/null +++ b/plugins/Overlay/tests/UI/expected-screenshots/Overlay_framed_loaded.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cc0eb9b5a7d599c97d289369977dec5832324a3892efc717072311f98aa88851 +size 109425 diff --git a/tests/PHPUnit/Fixtures/UITestFixture.php b/tests/PHPUnit/Fixtures/UITestFixture.php index 03d7a4696f..89c1e7306d 100644 --- a/tests/PHPUnit/Fixtures/UITestFixture.php +++ b/tests/PHPUnit/Fixtures/UITestFixture.php @@ -150,6 +150,7 @@ class UITestFixture extends SqlDump } $this->testEnvironment->forcedNowTimestamp = $forcedNowTimestamp; + $this->testEnvironment->tokenAuth = self::getTokenAuth(); $this->testEnvironment->save(); $this->angularXssLabel = $this->xssTesting->forAngular('datatablerow'); @@ -587,7 +588,7 @@ class CustomApiProxy extends Proxy public function isExistingApiAction($pluginName, $apiAction) { - if ($pluginName == 'ExampleAPI' && ($apiAction != 'xssReportforTwig' || $apiAction != 'xssReportforAngular')) { + if ($pluginName == 'ExampleAPI' && ($apiAction == 'xssReportforTwig' || $apiAction == 'xssReportforAngular')) { return true; } return parent::isExistingApiAction($pluginName, $apiAction); |