blob: 449114936b5a161d572c115b9eb5c234dff3061d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
|
<?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;
/**
* Adds one site and tracks one visit w/ pageview URLs that are not normalized.
* These URLs use different protocols and a mix of lowercase & uppercase letters.
*/
class OneVisitWithAbnormalPageviewUrls extends Fixture
{
public $dateTime = '2010-03-06 11:22:33';
public $idSite = 1;
public function setUp(): void
{
$this->setUpWebsitesAndGoals();
$this->trackVisits();
}
public function tearDown(): void
{
// empty
}
private function setUpWebsitesAndGoals()
{
if (!self::siteCreated($idSite = 1)) {
self::createWebsite($this->dateTime);
}
}
private function trackVisits()
{
$dateTime = $this->dateTime;
$idSite = $this->idSite;
$t = self::getTracker($idSite, $dateTime, $defaultInit = true);
$t->setUrlReferrer('http://www.google.com/search?q=piwik');
$t->setUrl('http://example.org/foo/bar.html');
self::checkResponse($t->doTrackPageView('http://incredible.title/'));
$t->setUrl('https://example.org/foo/bar.html');
$t->setForceVisitDateTime(Date::factory($dateTime)->addHour(0.2)->getDatetime());
self::checkResponse($t->doTrackPageView('https://incredible.title/'));
$t->setUrl('https://wWw.example.org/foo/bar2.html');
$t->setForceVisitDateTime(Date::factory($dateTime)->addHour(0.3)->getDatetime());
self::checkResponse($t->doTrackPageView('http://www.incredible.title/'));
$t->setUrl('http://WwW.example.org/foo/bar2.html');
$t->setForceVisitDateTime(Date::factory($dateTime)->addHour(0.4)->getDatetime());
self::checkResponse($t->doTrackPageView('https://www.incredible.title/'));
$t->setUrl('http://www.example.org/foo/bar3.html');
$t->setForceVisitDateTime(Date::factory($dateTime)->addHour(0.5)->getDatetime());
self::checkResponse($t->doTrackPageView('incredible.title/'));
$t->setUrl('http://www.my.url/ꟽ碌㒧䊶亄ﶆⅅขκもኸόσशμεޖृ');
$t->setForceVisitDateTime(Date::factory($dateTime)->addHour(0.7)->getDatetime());
self::checkResponse($t->doTrackPageView('Valid URL, although strange looking'));
$t->setUrl('https://make.wordpress.org/?emoji=😎l¶m=test');
$t->setForceVisitDateTime(Date::factory($dateTime)->addHour(0.8)->getDatetime());
self::checkResponse($t->doTrackPageView('Emoji here: %F0%9F%98%8E'));
// this pageview should be last
$t->setUrl('https://example.org/foo/bar4.html');
$t->setForceVisitDateTime(Date::factory($dateTime)->addHour(0.6)->getDatetime());
self::checkResponse($t->doTrackPageView('incredible.title/'));
}
}
|