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
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/API/tests/System/AutoSuggestAPITest.php')
-rw-r--r--plugins/API/tests/System/AutoSuggestAPITest.php26
1 files changed, 26 insertions, 0 deletions
diff --git a/plugins/API/tests/System/AutoSuggestAPITest.php b/plugins/API/tests/System/AutoSuggestAPITest.php
index 821c7847aa..652f2aa288 100644
--- a/plugins/API/tests/System/AutoSuggestAPITest.php
+++ b/plugins/API/tests/System/AutoSuggestAPITest.php
@@ -136,6 +136,32 @@ class AutoSuggestAPITest extends SystemTestCase
if (is_numeric($topSegmentValue) || is_float($topSegmentValue) || preg_match('/^\d*?,\d*$/', $topSegmentValue)) {
$topSegmentValue = Common::forceDotAsSeparatorForDecimalPoint($topSegmentValue);
}
+
+ // use some specific test values for segments where auto suggest returns list of values that might not occur
+ switch ($params['segmentToComplete']) {
+ case 'countryName':
+ $topSegmentValue = 'France';
+ break;
+ case 'browserName':
+ $topSegmentValue = 'Chrome';
+ break;
+ case 'operatingSystemName':
+ $topSegmentValue = 'Android';
+ break;
+ case 'visitEndServerDate':
+ $topSegmentValue = '2018-01-03';
+ break;
+ case 'visitEndServerDayOfMonth':
+ $topSegmentValue = '03';
+ break;
+ case 'visitEndServerYear':
+ $topSegmentValue = '2018';
+ break;
+ case 'visitLocalMinute':
+ $topSegmentValue = '34';
+ break;
+ }
+
// Now build the segment request
$segmentValue = rawurlencode(html_entity_decode($topSegmentValue, ENT_COMPAT | ENT_HTML401, 'UTF-8'));
$params['segment'] = $params['segmentToComplete'] . '==' . $segmentValue;