From 3ff6d68f20f3b68532fd83c0ef6789432b786d15 Mon Sep 17 00:00:00 2001 From: diosmosis Date: Sat, 30 Mar 2019 16:33:01 -0700 Subject: [PATCH 1/6] fix condition --- tests/PHPUnit/Fixtures/UITestFixture.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/PHPUnit/Fixtures/UITestFixture.php b/tests/PHPUnit/Fixtures/UITestFixture.php index 03d7a4696f4..4edc25f1234 100644 --- a/tests/PHPUnit/Fixtures/UITestFixture.php +++ b/tests/PHPUnit/Fixtures/UITestFixture.php @@ -587,7 +587,7 @@ public function __construct() 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); From 879bb1aa3c93ace487c68c682c7208e0264a2c1f Mon Sep 17 00:00:00 2001 From: diosmosis Date: Sun, 31 Mar 2019 11:00:55 -0700 Subject: [PATCH 2/6] NullHandler must be end of writer array to allow other handlers to handle the message (since it seems to stop bubbling). --- plugins/Monolog/config/config.php | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/plugins/Monolog/config/config.php b/plugins/Monolog/config/config.php index 4d5e3d15a30..ad1aae93d41 100644 --- a/plugins/Monolog/config/config.php +++ b/plugins/Monolog/config/config.php @@ -38,12 +38,7 @@ $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,10 @@ $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. + $writers[] = $c->get(\Monolog\Handler\NullHandler::class); + return array_values($writers); }), From 0f2e1d246f8703636e4235566202c6ff90136af3 Mon Sep 17 00:00:00 2001 From: diosmosis Date: Sun, 31 Mar 2019 11:23:34 -0700 Subject: [PATCH 3/6] Do not do php eol check during tests. --- core/Plugin/ControllerAdmin.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/Plugin/ControllerAdmin.php b/core/Plugin/ControllerAdmin.php index 60a366b83ee..e9040427cff 100644 --- a/core/Plugin/ControllerAdmin.php +++ b/core/Plugin/ControllerAdmin.php @@ -240,6 +240,10 @@ private static function notifyWhenPhpVersionIsNotCompatibleWithNextMajorPiwik() 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; From e97c4221b4b819d0e2d830817741166f7f8f7337 Mon Sep 17 00:00:00 2001 From: diosmosis Date: Sun, 31 Mar 2019 11:48:43 -0700 Subject: [PATCH 4/6] Just in case. --- plugins/Monolog/config/config.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugins/Monolog/config/config.php b/plugins/Monolog/config/config.php index ad1aae93d41..ff60f7c5bd9 100644 --- a/plugins/Monolog/config/config.php +++ b/plugins/Monolog/config/config.php @@ -74,7 +74,9 @@ // 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. - $writers[] = $c->get(\Monolog\Handler\NullHandler::class); + if (empty($writers)) { + $writers[] = $c->get(\Monolog\Handler\NullHandler::class); + } return array_values($writers); }), From 6ef5fac0ffcb6be1a61d22ebf1727573929fdddb Mon Sep 17 00:00:00 2001 From: diosmosis Date: Sun, 31 Mar 2019 13:40:11 -0700 Subject: [PATCH 5/6] try to fix the build --- tests/PHPUnit/Fixtures/UITestFixture.php | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/PHPUnit/Fixtures/UITestFixture.php b/tests/PHPUnit/Fixtures/UITestFixture.php index 4edc25f1234..89c1e7306d7 100644 --- a/tests/PHPUnit/Fixtures/UITestFixture.php +++ b/tests/PHPUnit/Fixtures/UITestFixture.php @@ -150,6 +150,7 @@ public function performSetUp($setupEnvironmentOnly = false) } $this->testEnvironment->forcedNowTimestamp = $forcedNowTimestamp; + $this->testEnvironment->tokenAuth = self::getTokenAuth(); $this->testEnvironment->save(); $this->angularXssLabel = $this->xssTesting->forAngular('datatablerow'); From 02983d2dfed33d3e4f19f5bc5ca87f5c487dbf01 Mon Sep 17 00:00:00 2001 From: diosmosis Date: Sun, 31 Mar 2019 13:57:39 -0700 Subject: [PATCH 6/6] Add screenshot. --- .../tests/UI/expected-screenshots/Overlay_framed_loaded.png | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 plugins/Overlay/tests/UI/expected-screenshots/Overlay_framed_loaded.png 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 00000000000..bf46100ba28 --- /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