diff options
author | Peter Zhang <peter@innocraft.com> | 2022-01-07 15:20:44 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-07 15:20:44 +0300 |
commit | 88797d70be882db2a56cd876fed1063fc1cd929c (patch) | |
tree | c24fc5be9313780e04b6323079aaceae4293a10a /plugins/Goals | |
parent | 57cd4a4a8b078a414fb9304eb8bfadd3ff40bef5 (diff) |
dependent archive never run (#18403)
* Update ArchiveProcessor.php
set plugin not include UserCountry
* Update ArchiveProcessor.php
update processer
* Update ArchiveProcessor.php
remove hardcode plugin name
* add tests
add tests
* fix test
Co-authored-by: sgiehl <stefan@matomo.org>
Diffstat (limited to 'plugins/Goals')
-rw-r--r-- | plugins/Goals/tests/System/ProcessDependentArchiveTest.php | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/plugins/Goals/tests/System/ProcessDependentArchiveTest.php b/plugins/Goals/tests/System/ProcessDependentArchiveTest.php index f700e20b5a..4e131027b7 100644 --- a/plugins/Goals/tests/System/ProcessDependentArchiveTest.php +++ b/plugins/Goals/tests/System/ProcessDependentArchiveTest.php @@ -34,6 +34,12 @@ class ProcessDependentArchiveTest extends SystemTestCase parent::tearDown(); } + public function test_numArchivesCreated_day() + { + API::getInstance()->getMetrics(self::$fixture->idSite, 'day', '2009-01-04'); + $this->assertNumRangeArchives(5, 1); // days; + } + public function test_numArchivesCreated() { API::getInstance()->get(self::$fixture->idSite, 'range', $this->requestRange); @@ -46,9 +52,9 @@ class ProcessDependentArchiveTest extends SystemTestCase $this->assertNumRangeArchives(6); } - private function assertNumRangeArchives($expectedArchives) + private function assertNumRangeArchives($expectedArchives,$period = 5) { - $archives = Db::fetchAll('SELECT `name` from ' . Common::prefixTable($this->archiveTable) . ' WHERE period = 5 and `name` like "done%"'); + $archives = Db::fetchAll('SELECT `name` from ' . Common::prefixTable($this->archiveTable) . ' WHERE period = '.$period.' and `name` like "done%"'); $numArchives = count($archives); $message = sprintf('Expected archives: %s, got: %s. These were the archives %s', $expectedArchives, $numArchives, json_encode($archives)); $this->assertEquals($expectedArchives, $numArchives, $message); |