Skip to content
Extraits de code Groupes Projets
Valider b194c902 rédigé par mattab's avatar mattab
Parcourir les fichiers

Refs #472 Adding events in other tests to make sure events don't regress

parent abcb0660
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
Affichage de
avec 51 ajouts et 33 suppressions
......@@ -356,6 +356,10 @@ class ArchivingHelper
/* @var DataTable $currentTable */
$currentTable =& $actionsTablesByType[$actionType];
if(is_null($currentTable)) {
throw new \Exception("Action table for type '$actionType' was not found during Actions archiving.");
}
// check for ranking query cut-off
if ($actionName == DataTable::LABEL_SUMMARY_ROW) {
$summaryRow = $currentTable->getRowFromId(DataTable::ID_SUMMARY_ROW);
......
......@@ -52,6 +52,11 @@ class Test_Piwik_Fixture_OneVisitSeveralPageViews extends Test_Piwik_BaseFixture
$t->setGenerationTime(153);
self::checkResponse($t->doTrackPageView('incredible parent title! <>,; / subtitle <>,;'));
$t->setUrl('http://example.org/dir/file.php?foo=bar&foo2=bar2');
$t->setForceVisitDateTime(Date::factory($dateTime)->addHour(0.31)->getDatetime());
$t->setGenerationTime(153);
self::checkResponse($t->doTrackEvent('Category', 'Action', 'Name', 11111));
$t->setUrl('http://example.org/dir2/file.php?foo=bar&foo2=bar');
$t->setForceVisitDateTime(Date::factory($dateTime)->addHour(0.4)->getDatetime());
$t->setGenerationTime(1233);
......
......@@ -48,8 +48,11 @@ class Test_Piwik_Fixture_SomeVisitsManyPageviewsWithTransitions extends Test_Piw
$this->trackPageView($tracker, 0.3, 'the/third_page.html?foo=bar');
$this->trackPageView($tracker, 0.4, 'page/one.html');
$this->trackPageView($tracker, 0.5, 'the/third_page.html?foo=bar');
$this->trackPageView($tracker, 0.5, 'the/third_page.html?foo=bar');
$this->trackPageView($tracker, 0.6, 'page/one.html');
$this->trackPageView($tracker, 0.6, 'page/one.html');
$this->trackPageView($tracker, 0.7, 'the/third_page.html?foo=baz#anchor1');
$this->trackPageView($tracker, 0.7, 'the/third_page.html?foo=baz#anchor1');
$this->trackPageView($tracker, 0.8, 'page/one.html');
$this->trackPageView($tracker, 0.9, 'page/one.html');
$this->trackPageView($tracker, 1.0, 'the/third_page.html?foo=baz#anchor2');
......@@ -85,15 +88,13 @@ class Test_Piwik_Fixture_SomeVisitsManyPageviewsWithTransitions extends Test_Piw
// before & after
$tracker->setIp('156.5.3.6');
$tracker->setNewVisitorId();
$this->trackPageView($tracker, 0, 'page/search.html#q=mykwd', $this->dateTime, $pageViewType = 'site-search',
$searchKeyword = 'mykwd', $searchCategory = 'mysearchcat');
$this->trackPageView($tracker, 0, 'page/search.html#q=mykwd', $this->dateTime, $pageViewType = 'site-search', $searchKeyword = 'mykwd', $searchCategory = 'mysearchcat');
$this->trackPageView($tracker, 0.1, 'page/one.html');
$this->trackPageView($tracker, 0.2, 'page/search.html#q=anotherkwd', $this->dateTime,
$pageViewType = 'site-search', $searchKeyword = 'anotherkwd',
$searchCategory = 'mysearchcat');
$this->trackPageView($tracker, 0.2, 'page/search.html#q=anotherkwd', $this->dateTime, $pageViewType = 'site-search', $searchKeyword = 'anotherkwd', $searchCategory = 'mysearchcat');
$this->trackPageView($tracker, 0.25, 'page/one.html');
$this->trackPageView($tracker, 0.3, 'to/outlink/page.html', $this->dateTime, $pageViewType = 'outlink');
$this->trackPageView($tracker, 0.35, 'page/one.html');
$this->trackPageView($tracker, 0.11, 'page/search.html#q=thirdkwd', $this->dateTime, $pageViewType = 'event', 'Song name here', 'Music');
$this->trackPageView($tracker, 0.4, '', $this->dateTime, $pageViewType = 'download');
$this->trackPageView($tracker, 0.45, 'page/one.html');
$this->trackPageView($tracker, 0.5, '', $this->dateTime, $pageViewType = 'download');
......@@ -104,9 +105,9 @@ class Test_Piwik_Fixture_SomeVisitsManyPageviewsWithTransitions extends Test_Piw
$laterDate = Date::factory($this->dateTime)->addDay(8)->getDatetime();
$tracker->setIp('156.5.3.7');
$tracker->setNewVisitorId();
$this->trackPageView($tracker, 0, 'page/search.html#q=thirdkwd', $laterDate, $pageViewType = 'site-search',
$searchKeyword = 'thirdkwd', $searchCategory = 'mysearchcat');
$this->trackPageView($tracker, 0, 'page/search.html#q=thirdkwd', $laterDate, $pageViewType = 'site-search', $searchKeyword = 'thirdkwd', $searchCategory = 'mysearchcat');
$this->trackPageView($tracker, 0.1, 'page/one.html', $laterDate);
$this->trackPageView($tracker, 0.11, 'page/search.html#q=thirdkwd', $laterDate, $pageViewType = 'event', 'Song name here', 'Music');
$this->trackPageView($tracker, 0.15, 'to/another/outlink.html', $laterDate, $pageViewType = 'outlink');
$this->trackPageView($tracker, 0.2, 'page/one.html', $laterDate);
$this->trackPageView($tracker, 0.25, '', $laterDate, $pageViewType = 'download');
......@@ -143,6 +144,8 @@ class Test_Piwik_Fixture_SomeVisitsManyPageviewsWithTransitions extends Test_Piw
self::assertTrue($visit->doTrackAction($downloadUrl, 'download'));
} else if ($pageViewType == 'site-search') {
self::assertTrue($visit->doTrackSiteSearch($searchKeyword, $searchCategory, $this->prefixCounter));
} else if ($pageViewType == 'event') {
self::assertTrue($visit->doTrackEvent($searchCategory, "event name", $searchKeyword, $this->prefixCounter));
}
}
}
......@@ -70,6 +70,9 @@ class Test_Piwik_Fixture_ThreeSitesWithManyVisitsWithSiteSearch extends Test_Piw
$visitor->setUrl('http://example.org/index.htm?random=PAGEVIEW, NOT SEARCH&mykwd=&IS_FOLLOWING_SEARCH ONCE');
self::checkResponse($visitor->doTrackPageView('This is a pageview, not a Search - IS_FOLLOWING_SEARCH ONCE'));
$visitor->setForceVisitDateTime(Date::factory($this->dateTime)->addHour(0.24)->getDatetime());
self::checkResponse($visitor->doTrackEvent("Event CAT", "Event ACTION", "Event NAME", $count = 3.33));
$visitor->setForceVisitDateTime(Date::factory($this->dateTime)->addHour(0.25)->getDatetime());
$visitor->setUrl('http://example.org/index.htm?standard=query&but=also#hash&q=' . urlencode('Search 1'));
self::checkResponse($visitor->doTrackPageView('Site Search results - URL Fragment'));
......@@ -113,6 +116,9 @@ class Test_Piwik_Fixture_ThreeSitesWithManyVisitsWithSiteSearch extends Test_Piw
$visitor->setForceVisitDateTime(Date::factory($this->dateTime)->addHour(24.42)->getDatetime());
self::checkResponse($visitor->doTrackSiteSearch("Keyword - Tracking API", "Category", $count = 5));
$visitor->setForceVisitDateTime(Date::factory($this->dateTime)->addHour(24.425)->getDatetime());
self::checkResponse($visitor->doTrackEvent("Event CAT", "Event ACTION", "Event NAME", $count));
$visitor->setForceVisitDateTime(Date::factory($this->dateTime)->addHour(24.43)->getDatetime());
self::checkResponse($visitor->doTrackSiteSearch("No Result Keyword!", "Bad No Result Category :(", $count = 0));
......
......@@ -4,11 +4,11 @@
<label>dir</label>
<nb_visits>2</nb_visits>
<nb_hits>2</nb_hits>
<sum_time_spent>720</sum_time_spent>
<sum_time_spent>684</sum_time_spent>
<nb_hits_with_time_generation>2</nb_hits_with_time_generation>
<min_time_generation>0.123</min_time_generation>
<max_time_generation>0.153</max_time_generation>
<avg_time_on_page>360</avg_time_on_page>
<avg_time_on_page>342</avg_time_on_page>
<bounce_rate>0%</bounce_rate>
<exit_rate>0%</exit_rate>
<avg_time_generation>0.138</avg_time_generation>
......
......@@ -5,11 +5,11 @@
<label>dir</label>
<nb_visits>2</nb_visits>
<nb_hits>2</nb_hits>
<sum_time_spent>720</sum_time_spent>
<sum_time_spent>684</sum_time_spent>
<nb_hits_with_time_generation>2</nb_hits_with_time_generation>
<min_time_generation>0.123</min_time_generation>
<max_time_generation>0.153</max_time_generation>
<avg_time_on_page>360</avg_time_on_page>
<avg_time_on_page>342</avg_time_on_page>
<bounce_rate>0%</bounce_rate>
<exit_rate>0%</exit_rate>
<avg_time_generation>0.138</avg_time_generation>
......
......@@ -4,8 +4,8 @@
<label>&lt;&gt;&amp;\&quot;the pdo extension is required for this adapter but the extension is not loaded</label>
<nb_uniq_visitors>1</nb_uniq_visitors>
<nb_visits>1</nb_visits>
<nb_actions>6</nb_actions>
<max_actions>6</max_actions>
<nb_actions>7</nb_actions>
<max_actions>7</max_actions>
<sum_visit_length>1441</sum_visit_length>
<bounce_count>0</bounce_count>
<nb_visits_converted>0</nb_visits_converted>
......
......@@ -11,7 +11,7 @@
<max_time_generation>0.523</max_time_generation>
<entry_nb_uniq_visitors>1</entry_nb_uniq_visitors>
<entry_nb_visits>1</entry_nb_visits>
<entry_nb_actions>6</entry_nb_actions>
<entry_nb_actions>7</entry_nb_actions>
<entry_sum_visit_length>1441</entry_sum_visit_length>
<entry_bounce_count>0</entry_bounce_count>
<avg_time_on_page>720</avg_time_on_page>
......
......@@ -5,11 +5,11 @@
<nb_visits>1</nb_visits>
<nb_uniq_visitors>1</nb_uniq_visitors>
<nb_hits>1</nb_hits>
<sum_time_spent>360</sum_time_spent>
<sum_time_spent>324</sum_time_spent>
<nb_hits_with_time_generation>1</nb_hits_with_time_generation>
<min_time_generation>0.153</min_time_generation>
<max_time_generation>0.153</max_time_generation>
<avg_time_on_page>360</avg_time_on_page>
<avg_time_on_page>324</avg_time_on_page>
<bounce_rate>0%</bounce_rate>
<exit_rate>0%</exit_rate>
<avg_time_generation>0.153</avg_time_generation>
......
......@@ -11,7 +11,7 @@
<max_time_generation>1.233</max_time_generation>
<entry_nb_uniq_visitors>1</entry_nb_uniq_visitors>
<entry_nb_visits>1</entry_nb_visits>
<entry_nb_actions>6</entry_nb_actions>
<entry_nb_actions>7</entry_nb_actions>
<entry_sum_visit_length>1441</entry_sum_visit_length>
<entry_bounce_count>0</entry_bounce_count>
<avg_time_on_page>1080</avg_time_on_page>
......
......@@ -63,7 +63,7 @@
<label> This is a pageview, not a Search - IS_FOLLOWING_SEARCH ONCE</label>
<nb_visits>1</nb_visits>
<nb_hits>2</nb_hits>
<avg_time_on_page>00:04:12</avg_time_on_page>
<avg_time_on_page>00:03:36</avg_time_on_page>
<bounce_rate>0%</bounce_rate>
<exit_rate>0%</exit_rate>
<avg_time_generation>0s</avg_time_generation>
......
......@@ -63,7 +63,7 @@
<label> This is a pageview, not a Search - IS_FOLLOWING_SEARCH ONCE</label>
<nb_visits>1</nb_visits>
<nb_hits>2</nb_hits>
<avg_time_on_page>00:04:12</avg_time_on_page>
<avg_time_on_page>00:03:36</avg_time_on_page>
<bounce_rate>0%</bounce_rate>
<exit_rate>0%</exit_rate>
<avg_time_generation>0s</avg_time_generation>
......
......@@ -63,7 +63,7 @@
<label>/index.htm?random=PAGEVIEW, NOT SEARCH&amp;mykwd=&amp;IS_FOLLOWING_SEARCH ONCE</label>
<nb_visits>1</nb_visits>
<nb_hits>2</nb_hits>
<avg_time_on_page>00:04:12</avg_time_on_page>
<avg_time_on_page>00:03:36</avg_time_on_page>
<bounce_rate>0%</bounce_rate>
<exit_rate>0%</exit_rate>
<avg_time_generation>0s</avg_time_generation>
......
......@@ -63,7 +63,7 @@
<label>/index.htm?random=PAGEVIEW, NOT SEARCH&amp;mykwd=&amp;IS_FOLLOWING_SEARCH ONCE</label>
<nb_visits>1</nb_visits>
<nb_hits>2</nb_hits>
<avg_time_on_page>00:04:12</avg_time_on_page>
<avg_time_on_page>00:03:36</avg_time_on_page>
<bounce_rate>0%</bounce_rate>
<exit_rate>0%</exit_rate>
<avg_time_generation>0s</avg_time_generation>
......
......@@ -18,9 +18,9 @@
<nb_visits>1</nb_visits>
<nb_uniq_visitors>1</nb_uniq_visitors>
<nb_hits>2</nb_hits>
<sum_time_spent>252</sum_time_spent>
<sum_time_spent>216</sum_time_spent>
<nb_hits_following_search>1</nb_hits_following_search>
<avg_time_on_page>252</avg_time_on_page>
<avg_time_on_page>216</avg_time_on_page>
<bounce_rate>0%</bounce_rate>
<exit_rate>0%</exit_rate>
</row>
......
......@@ -17,10 +17,10 @@
<label> This is a pageview, not a Search - IS_FOLLOWING_SEARCH ONCE</label>
<nb_visits>1</nb_visits>
<nb_hits>2</nb_hits>
<sum_time_spent>252</sum_time_spent>
<sum_time_spent>216</sum_time_spent>
<nb_hits_following_search>1</nb_hits_following_search>
<sum_daily_nb_uniq_visitors>1</sum_daily_nb_uniq_visitors>
<avg_time_on_page>252</avg_time_on_page>
<avg_time_on_page>216</avg_time_on_page>
<bounce_rate>0%</bounce_rate>
<exit_rate>0%</exit_rate>
</row>
......
......@@ -30,9 +30,9 @@
<nb_visits>1</nb_visits>
<nb_uniq_visitors>1</nb_uniq_visitors>
<nb_hits>2</nb_hits>
<sum_time_spent>252</sum_time_spent>
<sum_time_spent>216</sum_time_spent>
<nb_hits_following_search>1</nb_hits_following_search>
<avg_time_on_page>252</avg_time_on_page>
<avg_time_on_page>216</avg_time_on_page>
<bounce_rate>0%</bounce_rate>
<exit_rate>0%</exit_rate>
</row>
......
......@@ -29,10 +29,10 @@
<label> This is a pageview, not a Search - IS_FOLLOWING_SEARCH ONCE</label>
<nb_visits>1</nb_visits>
<nb_hits>2</nb_hits>
<sum_time_spent>252</sum_time_spent>
<sum_time_spent>216</sum_time_spent>
<nb_hits_following_search>1</nb_hits_following_search>
<sum_daily_nb_uniq_visitors>1</sum_daily_nb_uniq_visitors>
<avg_time_on_page>252</avg_time_on_page>
<avg_time_on_page>216</avg_time_on_page>
<bounce_rate>0%</bounce_rate>
<exit_rate>0%</exit_rate>
</row>
......
......@@ -19,9 +19,9 @@
<nb_visits>1</nb_visits>
<nb_uniq_visitors>1</nb_uniq_visitors>
<nb_hits>2</nb_hits>
<sum_time_spent>252</sum_time_spent>
<sum_time_spent>216</sum_time_spent>
<nb_hits_following_search>1</nb_hits_following_search>
<avg_time_on_page>252</avg_time_on_page>
<avg_time_on_page>216</avg_time_on_page>
<bounce_rate>0%</bounce_rate>
<exit_rate>0%</exit_rate>
<url>http://example.org/index.htm?random=PAGEVIEW, NOT SEARCH&amp;mykwd=&amp;IS_FOLLOWING_SEARCH ONCE</url>
......
......@@ -18,10 +18,10 @@
<label>/index.htm?random=PAGEVIEW, NOT SEARCH&amp;mykwd=&amp;IS_FOLLOWING_SEARCH ONCE</label>
<nb_visits>1</nb_visits>
<nb_hits>2</nb_hits>
<sum_time_spent>252</sum_time_spent>
<sum_time_spent>216</sum_time_spent>
<nb_hits_following_search>1</nb_hits_following_search>
<sum_daily_nb_uniq_visitors>1</sum_daily_nb_uniq_visitors>
<avg_time_on_page>252</avg_time_on_page>
<avg_time_on_page>216</avg_time_on_page>
<bounce_rate>0%</bounce_rate>
<exit_rate>0%</exit_rate>
<url>http://example.org/index.htm?random=PAGEVIEW, NOT SEARCH&amp;mykwd=&amp;IS_FOLLOWING_SEARCH ONCE</url>
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter