diff options
author | Zoltan Flamis <flamisz@gmail.com> | 2021-04-06 04:34:56 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-06 04:34:56 +0300 |
commit | 2c30dc8d231af58cdf2516a413da2d86bf7d62c6 (patch) | |
tree | 787340c73c6f91d8cdba670a1cf2744027c6213f /tests/PHPUnit/Fixtures | |
parent | 1dbd619d202d3963a45e332280bef2d5997ba3e4 (diff) |
Show notification when there is raw data but no data (#17380)
* ajax calls to check raw data and nb_visits
* show notification if there is raw data only
* using piwikApi
* disable when segment selected and add do not fetch actions
* update segment check
* move the logic into reporting-page
* show on dashboard too
* limiting API requests
* using notification instead of alert
* check if period changed
* check only if today is in daterange
* use lang file for visitor log text
* add contains today method
* add UI test for the notification
* update ui test
* use range in ui test
Diffstat (limited to 'tests/PHPUnit/Fixtures')
-rw-r--r-- | tests/PHPUnit/Fixtures/OneVisit.php | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/tests/PHPUnit/Fixtures/OneVisit.php b/tests/PHPUnit/Fixtures/OneVisit.php new file mode 100644 index 0000000000..3761937e34 --- /dev/null +++ b/tests/PHPUnit/Fixtures/OneVisit.php @@ -0,0 +1,47 @@ +<?php +/** + * Matomo - free/libre analytics platform + * + * @link https://matomo.org + * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later + */ +namespace Piwik\Tests\Fixtures; + +use Piwik\Date; +use Piwik\Tests\Framework\Fixture; + +/** + * Fixture that adds one site and tracks one pageview for today. + */ +class OneVisit extends Fixture +{ + public $idSite = 1; + + public function setUp(): void + { + Fixture::createSuperUser(); + $this->setUpWebsites(); + $this->trackVisits(); + } + + public function tearDown(): void + { + // empty + } + + private function setUpWebsites() + { + if (!self::siteCreated($idSite = 1)) { + self::createWebsite('2021-01-01'); + } + } + + private function trackVisits() + { + $dateTime = Date::today()->toString(); + $t = self::getTracker($this->idSite, $dateTime, $defaultInit = true); + + $t->setUrl('http://example.org/index.htm'); + self::checkResponse($t->doTrackPageView('0')); + } +} |