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:
authorStefan Giehl <stefan@piwik.org>2018-03-11 22:25:31 +0300
committerGitHub <noreply@github.com>2018-03-11 22:25:31 +0300
commit0a95fd3382431a6f4abab695f76bc7c05e3db105 (patch)
tree3c9e8ce0ed825ec964cf738ef8f9022307d6165d /plugins/API/API.php
parent2a8f39b1536c5ae119f1aca3bbd3a9936432fa54 (diff)
Fix AutoSuggest tests for segments with date types (#12610)
* Fake Lookback range and date time for autosuggest tests to persist results * update test files
Diffstat (limited to 'plugins/API/API.php')
-rw-r--r--plugins/API/API.php10
1 files changed, 8 insertions, 2 deletions
diff --git a/plugins/API/API.php b/plugins/API/API.php
index 0e52290c5f..c4553d81b3 100644
--- a/plugins/API/API.php
+++ b/plugins/API/API.php
@@ -67,6 +67,12 @@ class API extends \Piwik\Plugin\API
*/
private $processedReport;
+ /**
+ * For Testing purpose only
+ * @var int
+ */
+ public static $_autoSuggestLookBack = 60;
+
public function __construct(SettingsProvider $settingsProvider, ProcessedReport $processedReport)
{
$this->settingsProvider = $settingsProvider;
@@ -602,7 +608,7 @@ class API extends \Piwik\Plugin\API
private function getSuggestedValuesForSegmentName($idSite, $segment, $maxSuggestionsToReturn)
{
- $startDate = Date::now()->subDay(60)->toString();
+ $startDate = Date::now()->subDay(self::$_autoSuggestLookBack)->toString();
$requestLastVisits = "method=Live.getLastVisitsDetails
&idSite=$idSite
&period=range
@@ -738,7 +744,7 @@ class Plugin extends \Piwik\Plugin
}
/**
- * @see Piwik\Plugin::registerEvents
+ * @see \Piwik\Plugin::registerEvents
*/
public function registerEvents()
{