From a02715472f746a40a36a8a3b45b31bf2b28be5bc Mon Sep 17 00:00:00 2001 From: Zoltan Flamis Date: Wed, 10 Mar 2021 09:38:34 +1300 Subject: Check if filter limit is -1 when querying log visits (#17302) * check if filter limit is -1 * fix check filter limit before return * add new testcases --- plugins/Live/tests/System/ApiTest.php | 29 +- ...LimitDashOne__Live.getLastVisitsDetails_day.xml | 568 +++++++++++++++++++++ ...lterLimitOne__Live.getLastVisitsDetails_day.xml | 128 +++++ 3 files changed, 724 insertions(+), 1 deletion(-) create mode 100644 plugins/Live/tests/System/expected/test_filterLimitDashOne__Live.getLastVisitsDetails_day.xml create mode 100644 plugins/Live/tests/System/expected/test_filterLimitOne__Live.getLastVisitsDetails_day.xml (limited to 'plugins/Live/tests/System') diff --git a/plugins/Live/tests/System/ApiTest.php b/plugins/Live/tests/System/ApiTest.php index 7588cad575..1df94ce55b 100644 --- a/plugins/Live/tests/System/ApiTest.php +++ b/plugins/Live/tests/System/ApiTest.php @@ -97,6 +97,33 @@ class ApiTest extends SystemTestCase 'testSuffix' => 'actionSegment', ], ]; + + $apiToTest[] = [ + ['Live.getLastVisitsDetails'], + [ + 'idSite' => '1', + 'date' => self::$fixture->dateTime, + 'periods' => ['day'], + 'otherRequestParameters' => [ + 'filter_limit' => -1, + ], + 'testSuffix' => 'filterLimitDashOne', + ], + ]; + + $apiToTest[] = [ + ['Live.getLastVisitsDetails'], + [ + 'idSite' => '1', + 'date' => self::$fixture->dateTime, + 'periods' => ['day'], + 'otherRequestParameters' => [ + 'filter_limit' => 1, + ], + 'testSuffix' => 'filterLimitOne', + ], + ]; + $apiToTest[] = [ ['Live.getLastVisitsDetails'], [ @@ -206,4 +233,4 @@ class ApiTest extends SystemTestCase } -ApiTest::$fixture = new ManyVisitsOfSameVisitor(); \ No newline at end of file +ApiTest::$fixture = new ManyVisitsOfSameVisitor(); diff --git a/plugins/Live/tests/System/expected/test_filterLimitDashOne__Live.getLastVisitsDetails_day.xml b/plugins/Live/tests/System/expected/test_filterLimitDashOne__Live.getLastVisitsDetails_day.xml new file mode 100644 index 0000000000..62268e3cec --- /dev/null +++ b/plugins/Live/tests/System/expected/test_filterLimitDashOne__Live.getLastVisitsDetails_day.xml @@ -0,0 +1,568 @@ + + + + 1 + 4 + 156.5.3.2 + + 5041e282fc23fef1 + + + action + http://example.org/my/dir/page0 + incredible title 0 + 9 + + + 14 + + 1 + incredible title 0 + http://example.org/my/dir/page0 + + plugins/Morpheus/images/action.svg + + 0 M + + + 0 + USD + $ + + + + + Piwik test + + + + + + + + returning + plugins/Live/images/returningVisitor.png + 0 + + 3 + none + + 0 + 720 + 0 + + 0 + 0s + 0 + 1 + 1 + direct + Direct Entry + + + + + + + + + + Unknown + Unknown + plugins/Morpheus/icons/dist/devices/unknown.png + Unknown + Unknown + Unknown + Unknown + plugins/Morpheus/icons/dist/os/UNK.png + UNK + UNK + + Unknown + Unknown + Unknown + plugins/Morpheus/icons/dist/browsers/UNK.png + UNK + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + Unknown + unk + Unknown + xx + plugins/Morpheus/icons/dist/flags/xx.png + + + + Unknown + + + 12:34:06 + 12 + 0 + 360 + 1024x768 + cookie, flash, java + + + plugins/Morpheus/icons/dist/plugins/cookie.png + cookie + + + plugins/Morpheus/icons/dist/plugins/flash.png + flash + + + plugins/Morpheus/icons/dist/plugins/java.png + java + + + + + + + 1 + 3 + 156.5.3.2 + + 5041e282fc23fef1 + + + action + http://example.org/my/dir/page-1 + incredible title -1 + 7 + + + 13 + + 1 + incredible title -1 + http://example.org/my/dir/page-1 + + plugins/Morpheus/images/action.svg + + 0 M + + + 0 + USD + $ + + + + + Piwik test + + + + + + + + returning + plugins/Live/images/returningVisitor.png + 0 + + 2 + none + + 0 + 360 + 0 + + 0 + 0s + 0 + 1 + 1 + direct + Direct Entry + + + + + + + + + + Unknown + Unknown + plugins/Morpheus/icons/dist/devices/unknown.png + Unknown + Unknown + Unknown + Unknown + plugins/Morpheus/icons/dist/os/UNK.png + UNK + UNK + + Unknown + Unknown + Unknown + plugins/Morpheus/icons/dist/browsers/UNK.png + UNK + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + Unknown + unk + Unknown + xx + plugins/Morpheus/icons/dist/flags/xx.png + + + + Unknown + + + 12:34:06 + 12 + 0 + 360 + 1024x768 + cookie, flash, java + + + plugins/Morpheus/icons/dist/plugins/cookie.png + cookie + + + plugins/Morpheus/icons/dist/plugins/flash.png + flash + + + plugins/Morpheus/icons/dist/plugins/java.png + java + + + + + + + 1 + 2 + 156.5.3.2 + + e16cf2bbaeea2c88 + + + action + http://example.org/my/dir/page-2 + incredible title -2 + 4 + + + 2 + + 0 + 0s + 1 + incredible title -2 + http://example.org/my/dir/page-2 + + plugins/Morpheus/images/action.svg + + 0 M + + + action + http://example.org/my/dir/page-2 + incredible title 1 + 4 + + + 3 + + 0 + 0s + 2 + incredible title 1 + http://example.org/my/dir/page-2 + + plugins/Morpheus/images/action.svg + + 0 M + + + action + http://example.org/my/dir/page-2 + incredible title 1 + 4 + + + 4 + + 0 + 0s + 3 + incredible title 1 + http://example.org/my/dir/page-2 + + plugins/Morpheus/images/action.svg + + 0 M + + + action + http://example.org/my/dir/page-2 + incredible title 1 + 4 + + + 5 + + 0 + 0s + 4 + incredible title 1 + http://example.org/my/dir/page-2 + + plugins/Morpheus/images/action.svg + + 0 M + + + action + http://example.org/my/dir/page-2 + incredible title 1 + 4 + + + 6 + + 0 + 0s + 5 + incredible title 1 + http://example.org/my/dir/page-2 + + plugins/Morpheus/images/action.svg + + 0 M + + + action + http://example.org/my/dir/page-2 + incredible title 1 + 4 + + + 7 + + 0 + 0s + 6 + incredible title 1 + http://example.org/my/dir/page-2 + + plugins/Morpheus/images/action.svg + + 0 M + + + action + http://example.org/my/dir/page-2 + incredible title 1 + 4 + + + 8 + + 0 + 0s + 7 + incredible title 1 + http://example.org/my/dir/page-2 + + plugins/Morpheus/images/action.svg + + 0 M + + + action + http://example.org/my/dir/page-2 + incredible title 1 + 4 + + + 9 + + 0 + 0s + 8 + incredible title 1 + http://example.org/my/dir/page-2 + + plugins/Morpheus/images/action.svg + + 0 M + + + action + http://example.org/my/dir/page-2 + incredible title 1 + 4 + + + 10 + + 0 + 0s + 9 + incredible title 1 + http://example.org/my/dir/page-2 + + plugins/Morpheus/images/action.svg + + 0 M + + + action + http://example.org/my/dir/page-2 + incredible title 1 + 4 + + + 11 + + 0 + 0s + 10 + incredible title 1 + http://example.org/my/dir/page-2 + + plugins/Morpheus/images/action.svg + + 0 M + + + action + http://example.org/my/dir/page-2 + incredible title 1 + 4 + + + 12 + + 11 + incredible title 1 + http://example.org/my/dir/page-2 + + plugins/Morpheus/images/action.svg + + 0 M + + + 0 + USD + $ + + + + + Piwik test + + + + + + + + new + + 0 + + 1 + none + + 0 + 0 + 0 + + 1 + 1s + 0 + 11 + 11 + direct + Direct Entry + + + + + + + + + fr + French + Desktop + plugins/Morpheus/icons/dist/devices/desktop.png + Unknown + Generic Desktop + Windows XP + Windows + plugins/Morpheus/icons/dist/os/WIN.png + WIN + XP + Gecko + Gecko (Firefox) + Firefox 3.6 + Firefox + plugins/Morpheus/icons/dist/browsers/FF.png + FF + 3.6 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + Europe + eur + France + fr + plugins/Morpheus/icons/dist/flags/fr.png + + + + France + + + 12:34:06 + 12 + 0 + 0 + 1024x768 + cookie, flash, java + + + plugins/Morpheus/icons/dist/plugins/cookie.png + cookie + + + plugins/Morpheus/icons/dist/plugins/flash.png + flash + + + plugins/Morpheus/icons/dist/plugins/java.png + java + + + + + + \ No newline at end of file diff --git a/plugins/Live/tests/System/expected/test_filterLimitOne__Live.getLastVisitsDetails_day.xml b/plugins/Live/tests/System/expected/test_filterLimitOne__Live.getLastVisitsDetails_day.xml new file mode 100644 index 0000000000..834f0da3b3 --- /dev/null +++ b/plugins/Live/tests/System/expected/test_filterLimitOne__Live.getLastVisitsDetails_day.xml @@ -0,0 +1,128 @@ + + + + 1 + 4 + 156.5.3.2 + + 5041e282fc23fef1 + + + action + http://example.org/my/dir/page0 + incredible title 0 + 9 + + + 14 + + 1 + incredible title 0 + http://example.org/my/dir/page0 + + plugins/Morpheus/images/action.svg + + 0 M + + + 0 + USD + $ + + + + + Piwik test + + + + + + + + returning + plugins/Live/images/returningVisitor.png + 0 + + 3 + none + + 0 + 720 + 0 + + 0 + 0s + 0 + 1 + 1 + direct + Direct Entry + + + + + + + + + + Unknown + Unknown + plugins/Morpheus/icons/dist/devices/unknown.png + Unknown + Unknown + Unknown + Unknown + plugins/Morpheus/icons/dist/os/UNK.png + UNK + UNK + + Unknown + Unknown + Unknown + plugins/Morpheus/icons/dist/browsers/UNK.png + UNK + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + Unknown + unk + Unknown + xx + plugins/Morpheus/icons/dist/flags/xx.png + + + + Unknown + + + 12:34:06 + 12 + 0 + 360 + 1024x768 + cookie, flash, java + + + plugins/Morpheus/icons/dist/plugins/cookie.png + cookie + + + plugins/Morpheus/icons/dist/plugins/flash.png + flash + + + plugins/Morpheus/icons/dist/plugins/java.png + java + + + + + + \ No newline at end of file -- cgit v1.2.3