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:
authordiosmosis <benaka@piwik.pro>2015-10-08 19:49:47 +0300
committerdiosmosis <benaka@piwik.pro>2015-10-12 21:05:37 +0300
commitfdd3928465a5641d287d3e74f628d4a4ea1f784f (patch)
treed1cff83f2b8710303cfdb3e6d651ce8dc917bd05 /tests/PHPUnit/System/ArchiveInvalidationTest.php
parent25de7742eceb032f1e3b9d60098215010d3825fa (diff)
Re-engineer ArchiveInvalidationTest now that invalidation cascades up.
Diffstat (limited to 'tests/PHPUnit/System/ArchiveInvalidationTest.php')
-rw-r--r--tests/PHPUnit/System/ArchiveInvalidationTest.php17
1 files changed, 8 insertions, 9 deletions
diff --git a/tests/PHPUnit/System/ArchiveInvalidationTest.php b/tests/PHPUnit/System/ArchiveInvalidationTest.php
index b64aa82479..7e41cd6eae 100644
--- a/tests/PHPUnit/System/ArchiveInvalidationTest.php
+++ b/tests/PHPUnit/System/ArchiveInvalidationTest.php
@@ -52,9 +52,9 @@ class ArchiveInvalidationTest extends SystemTestCase
return array(
array($apiToCall, array('idSite' => self::$fixture->idSite2,
- 'testSuffix' => 'Website' . self::$fixture->idSite2 . "_NewDataShouldNotAppear_BecauseWeekWasNotInvalidated",
+ 'testSuffix' => 'Website' . self::$fixture->idSite2 . "_NewDataShouldNotAppear_BecauseDayWasNotInvalidated",
'date' => self::$fixture->dateTimeFirstDateWebsite2,
- 'periods' => 'week',
+ 'periods' => 'day',
'segment' => 'pageUrl=@category/',
'setDateLastN' => 4, // 4months ahead
'otherRequestParameters' => array('expanded' => 1))
@@ -99,8 +99,8 @@ class ArchiveInvalidationTest extends SystemTestCase
public function testAnotherApi($api, $params)
{
if ($params['periods'] === 'month') {
- // we do now need to invalidate weeks as well since months are based on weeks
- $this->invalidateTestArchive(self::$fixture->idSite2, 'week', self::$fixture->dateTimeFirstDateWebsite2);
+ // we do now need to invalidate days as well since weeks are based on weeks
+ $this->invalidateTestArchive(self::$fixture->idSite2, 'week', self::$fixture->dateTimeFirstDateWebsite2, true);
}
$this->setBrowserArchivingTriggering(1);
@@ -135,16 +135,15 @@ class ArchiveInvalidationTest extends SystemTestCase
$r = new Request("module=API&method=CoreAdminHome.invalidateArchivedReports&idSites=" . self::$fixture->idSite1 . "&dates=" . $dateToInvalidate1->format('Y-m-d'));
$this->assertApiResponseHasNoError($r->process());
- // Days & Months reports only are invalidated and we test our weekly report will still show old data.
- $this->invalidateTestArchive(self::$fixture->idSite2, 'day', self::$fixture->dateTimeFirstDateWebsite2);
- $this->invalidateTestArchive(self::$fixture->idSite2, 'month', self::$fixture->dateTimeFirstDateWebsite2);
+ // week reports only are invalidated and we test our daily report will still show old data.
+ $this->invalidateTestArchive(self::$fixture->idSite2, 'week', self::$fixture->dateTimeFirstDateWebsite2);
}
- private function invalidateTestArchive($idSite, $period, $dateTime)
+ private function invalidateTestArchive($idSite, $period, $dateTime, $cascadeDown = false)
{
$dates = new \DateTime($dateTime);
$dates = $dates->format('Y-m-d');
- $r = new Request("module=API&method=CoreAdminHome.invalidateArchivedReports&period=$period&idSites=$idSite&dates=$dates");
+ $r = new Request("module=API&method=CoreAdminHome.invalidateArchivedReports&period=$period&idSites=$idSite&dates=$dates&cascadeDown=" . (int)$cascadeDown);
$this->assertApiResponseHasNoError($r->process());
}
}