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
path: root/tests
diff options
context:
space:
mode:
authordiosmosis <diosmosis@users.noreply.github.com>2019-11-19 09:44:19 +0300
committerGitHub <noreply@github.com>2019-11-19 09:44:19 +0300
commit7ece9e1958ffa8416e4cb03719d9e04595cd0a6f (patch)
treedd637d46b12aadb02174788623adfb2046b06f7a /tests
parent65415140ebf9b9a0d0b7d34d922cee60c6e2f886 (diff)
Only add site to list of sites to reprocess if only date being processed is today. (#15154)
* Only add site to list of sites to reprocess if only date being processed is today. * Fix test. * Purge all older archives if newest is queryable. * fix test
Diffstat (limited to 'tests')
-rw-r--r--tests/PHPUnit/Fixtures/TwoSitesVisitsInPast.php16
-rw-r--r--tests/PHPUnit/Integration/DataAccess/ArchiveInvalidatorTest.php10
-rw-r--r--tests/PHPUnit/System/VisitsInPastInvalidateOldReportsTest.php2
3 files changed, 27 insertions, 1 deletions
diff --git a/tests/PHPUnit/Fixtures/TwoSitesVisitsInPast.php b/tests/PHPUnit/Fixtures/TwoSitesVisitsInPast.php
index 68977e3700..373b418992 100644
--- a/tests/PHPUnit/Fixtures/TwoSitesVisitsInPast.php
+++ b/tests/PHPUnit/Fixtures/TwoSitesVisitsInPast.php
@@ -42,6 +42,22 @@ class TwoSitesVisitsInPast extends Fixture
if (!self::siteCreated($idSite = 2)) {
self::createWebsite($this->dateTimeCreationWebsite2);
}
+
+ if (!self::siteCreated($idSite = 3)) {
+ self::createWebsite($this->dateTimeCreationWebsite2);
+ }
+
+ if (!self::siteCreated($idSite = 4)) {
+ self::createWebsite($this->dateTimeCreationWebsite2);
+ }
+
+ if (!self::siteCreated($idSite = 5)) {
+ self::createWebsite($this->dateTimeCreationWebsite2);
+ }
+
+ if (!self::siteCreated($idSite = 6)) {
+ self::createWebsite($this->dateTimeCreationWebsite2);
+ }
}
protected function trackVisits()
diff --git a/tests/PHPUnit/Integration/DataAccess/ArchiveInvalidatorTest.php b/tests/PHPUnit/Integration/DataAccess/ArchiveInvalidatorTest.php
index 7bc718b373..530bd6e112 100644
--- a/tests/PHPUnit/Integration/DataAccess/ArchiveInvalidatorTest.php
+++ b/tests/PHPUnit/Integration/DataAccess/ArchiveInvalidatorTest.php
@@ -19,6 +19,7 @@ use Piwik\Option;
use Piwik\Piwik;
use Piwik\Plugins\CoreAdminHome\Tasks\ArchivesToPurgeDistributedList;
use Piwik\Plugins\PrivacyManager\PrivacyManager;
+use Piwik\Tests\Framework\Fixture;
use Piwik\Tests\Framework\TestCase\IntegrationTestCase;
use Piwik\Archive\ArchiveInvalidator;
use Piwik\Segment;
@@ -57,6 +58,15 @@ class ArchiveInvalidatorTest extends IntegrationTestCase
self::$segment2 = new Segment(self::TEST_SEGMENT_2, array());
}
+ protected static function beforeTableDataCached()
+ {
+ parent::beforeTableDataCached();
+
+ for ($i = 0; $i != 10; ++$i) {
+ Fixture::createWebsite('2012-03-04');
+ }
+ }
+
public function setUp()
{
parent::setUp();
diff --git a/tests/PHPUnit/System/VisitsInPastInvalidateOldReportsTest.php b/tests/PHPUnit/System/VisitsInPastInvalidateOldReportsTest.php
index b951995368..d3128c1c43 100644
--- a/tests/PHPUnit/System/VisitsInPastInvalidateOldReportsTest.php
+++ b/tests/PHPUnit/System/VisitsInPastInvalidateOldReportsTest.php
@@ -79,7 +79,7 @@ class VisitsInPastInvalidateOldReportsTest extends SystemTestCase
// 1) Invalidate old reports for the 2 websites
// Test invalidate 1 date only
- $r = new Request("module=API&method=CoreAdminHome.invalidateArchivedReports&idSites=4,5,6,55,-1,s',1&dates=2010-01-03");
+ $r = new Request("module=API&method=CoreAdminHome.invalidateArchivedReports&idSites=4,5,6,-1,s',1&dates=2010-01-03");
$this->assertApiResponseHasNoError($r->process());
// Test invalidate comma separated dates