diff options
6 files changed, 11 insertions, 12 deletions
diff --git a/plugins/API/API.php b/plugins/API/API.php index 30fbfbcf93..f84c95f443 100644 --- a/plugins/API/API.php +++ b/plugins/API/API.php @@ -194,7 +194,7 @@ class API extends \Piwik\Plugin\API $sites = (is_array($idSites) ? implode('.', $idSites) : (int) $idSites); $cache = Cache::getTransientCache(); - $cacheKey = 'API.getSegmentsMetadata' . $sites . '_' . (int) $_hideImplementationData . '_' . (int) $isNotAnonymous; + $cacheKey = 'API.getSegmentsMetadata' . $sites . '_' . (int) $_hideImplementationData . '_' . (int) $isNotAnonymous . '_' . (int) $_showAllSegments; $cacheKey = CacheId::pluginAware($cacheKey); if ($cache->contains($cacheKey)) { @@ -597,7 +597,7 @@ class API extends \Piwik\Plugin\API if (!empty($segment['unionOfSegments'])) { $values = array(); foreach ($segment['unionOfSegments'] as $unionSegmentName) { - $unionSegment = $this->findSegment($unionSegmentName, $idSite); + $unionSegment = $this->findSegment($unionSegmentName, $idSite, $_showAllSegments = true); try { $result = $this->getSuggestedValuesForSegmentName($idSite, $unionSegment, $maxSuggestionsToReturn); @@ -655,9 +655,9 @@ class API extends \Piwik\Plugin\API return $pages; } - private function findSegment($segmentName, $idSite) + private function findSegment($segmentName, $idSite, $_showAllSegments = false) { - $segmentsMetadata = $this->getSegmentsMetadata($idSite, $_hideImplementationData = false); + $segmentsMetadata = $this->getSegmentsMetadata($idSite, $_hideImplementationData = false, $_showAllSegments); $segmentFound = false; foreach ($segmentsMetadata as $segmentMetadata) { diff --git a/plugins/API/tests/System/AutoSuggestAPITest.php b/plugins/API/tests/System/AutoSuggestAPITest.php index 5e8bfac0f8..006f780424 100644 --- a/plugins/API/tests/System/AutoSuggestAPITest.php +++ b/plugins/API/tests/System/AutoSuggestAPITest.php @@ -196,7 +196,7 @@ class AutoSuggestAPITest extends SystemTestCase public function testCheckOtherTestsWereComplete() { // Check that only a few haven't been tested specifically (these are all custom variables slots since we only test slot 1, 2, 5 (see the fixture) and example dimension slots and bandwidth) - $maximumSegmentsToSkip = 17; + $maximumSegmentsToSkip = 21; $this->assertLessThan($maximumSegmentsToSkip, count(self::$skipped), 'SKIPPED ' . count(self::$skipped) . ' segments --> some segments had no "auto-suggested values" but we should try and test the autosuggest for all new segments. Segments skipped were: ' . implode(', ', self::$skipped)); diff --git a/plugins/API/tests/System/expected/test_AutoSuggestAPITest_productCategory__API.getSuggestedValuesForSegment.xml b/plugins/API/tests/System/expected/test_AutoSuggestAPITest_productCategory__API.getSuggestedValuesForSegment.xml index 138c5a1f30..c234bed59e 100644 --- a/plugins/API/tests/System/expected/test_AutoSuggestAPITest_productCategory__API.getSuggestedValuesForSegment.xml +++ b/plugins/API/tests/System/expected/test_AutoSuggestAPITest_productCategory__API.getSuggestedValuesForSegment.xml @@ -1,6 +1,2 @@ <?xml version="1.0" encoding="utf-8" ?> -<result> - <error message="Requested segment productCategory1 not found. - - --> To temporarily debug this error further, set const PIWIK_PRINT_ERROR_BACKTRACE=true; in index.php" /> -</result>
\ No newline at end of file +<result />
\ No newline at end of file diff --git a/plugins/CustomDimensions b/plugins/CustomDimensions -Subproject 6f0ee47e885cdc8b4c77b903a8566d08b21a93e +Subproject 70d45d15d4a9b208b8723ee4dc7eca7b8581282 diff --git a/plugins/Marketplace/tests/System/Api/ClientTest.php b/plugins/Marketplace/tests/System/Api/ClientTest.php index 588d4b1455..694be41eb3 100644 --- a/plugins/Marketplace/tests/System/Api/ClientTest.php +++ b/plugins/Marketplace/tests/System/Api/ClientTest.php @@ -99,7 +99,10 @@ class ClientTest extends SystemTestCase $this->assertNotEmpty($plugin['versions']); $lastVersion = $plugin['versions'][count($plugin['versions']) - 1]; - $this->assertEquals(array('name', 'release', 'requires', 'numDownloads', 'license', 'repositoryChangelogUrl', 'readmeHtml', 'download'), array_keys($lastVersion)); + $this->assertEquals( + array('name', 'release', 'requires', 'wordPressCompatible', 'onPremiseCompatible', 'numDownloads', 'license', 'repositoryChangelogUrl', 'readmeHtml', 'download'), + array_keys($lastVersion) + ); $this->assertNotEmpty($lastVersion['download']); } diff --git a/tests/PHPUnit/Integration/Tracker/RequestTest.php b/tests/PHPUnit/Integration/Tracker/RequestTest.php index b8cef753a6..7465cc7dc8 100644 --- a/tests/PHPUnit/Integration/Tracker/RequestTest.php +++ b/tests/PHPUnit/Integration/Tracker/RequestTest.php @@ -86,7 +86,7 @@ class RequestTest extends IntegrationTestCase public function test_cdt_ShouldReturnTheCustomTimestamp_ShouldUseStrToTime_IfItIsNotATime() { - $request = $this->buildRequest(array('cdt' => '5 years ago')); + $request = $this->buildRequest(array('cdt' => '6 years ago')); $request->setCurrentTimestamp($this->time); $request->setIsAuthenticated(); $this->assertNotSame($this->time, $request->getCurrentTimestamp()); |