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
diff options
context:
space:
mode:
authorThomas Steur <thomas.steur@googlemail.com>2014-12-22 05:32:06 +0300
committerThomas Steur <thomas.steur@googlemail.com>2014-12-22 05:32:06 +0300
commit55fe05468d86dc51ad653b5de9bb4b9ad027ba78 (patch)
treed6ae3b30d6bf651ef298f31d82337ac5fdf8a0f2 /tests/PHPUnit/System
parente71f461adfd03b40504243104944fe6b70c79980 (diff)
fix tests as reports are invalidated now in some tests causing the site creation date to change causing archiving more dates
Diffstat (limited to 'tests/PHPUnit/System')
-rwxr-xr-xtests/PHPUnit/System/TwoVisitsWithCustomVariablesSegmentMatchVisitorTypeTest.php9
-rw-r--r--tests/PHPUnit/System/VisitsInPastInvalidateOldReportsTest.php8
-rw-r--r--tests/PHPUnit/System/expected/test_VisitsInPast_InvalidateOldReportsWebsite1_OldReportsShouldNotAppear__Actions.getPageUrls_month.xml59
-rw-r--r--tests/PHPUnit/System/expected/test_VisitsInPast_InvalidateOldReportsWebsite1_OldReportsShouldNotAppear__VisitsSummary.get_month.xml14
-rw-r--r--tests/PHPUnit/System/expected/test_VisitsInPast_InvalidateOldReportsWebsite2_OldReportsShouldNotAppear__Actions.getPageUrls_month.xml59
-rw-r--r--tests/PHPUnit/System/expected/test_VisitsInPast_InvalidateOldReportsWebsite2_OldReportsShouldNotAppear__VisitsSummary.get_month.xml14
6 files changed, 152 insertions, 11 deletions
diff --git a/tests/PHPUnit/System/TwoVisitsWithCustomVariablesSegmentMatchVisitorTypeTest.php b/tests/PHPUnit/System/TwoVisitsWithCustomVariablesSegmentMatchVisitorTypeTest.php
index f8d3ab4f15..06ee848eed 100755
--- a/tests/PHPUnit/System/TwoVisitsWithCustomVariablesSegmentMatchVisitorTypeTest.php
+++ b/tests/PHPUnit/System/TwoVisitsWithCustomVariablesSegmentMatchVisitorTypeTest.php
@@ -8,6 +8,8 @@
namespace Piwik\Tests\System;
use Piwik\Common;
+use Piwik\DataAccess\ArchiveInvalidator;
+use Piwik\DataAccess\InvalidatedReports;
use Piwik\Db;
use Piwik\Tests\Framework\TestCase\SystemTestCase;
use Piwik\Tests\Fixtures\TwoVisitsWithCustomVariables;
@@ -88,9 +90,9 @@ class TwoVisitsWithCustomVariablesSegmentMatchVisitorTypeTest extends SystemTest
'archive_blob_2009_12' => 28,
// 7 metrics,
// 2 Referrer metrics (Referrers_distinctSearchEngines/Referrers_distinctKeywords),
- // 3 done flag (referrers, CustomVar, VisitsSummary),
+ // 6 done flag (referrers, CustomVar, VisitsSummary), 3 for period = 1 and 3 for period = 2
// X * 2 segments
- 'archive_numeric_2009_12' => (6 + 2 + 3) * 2,
+ 'archive_numeric_2009_12' => (6 + 2 + 3 + 3) * 2,
);
foreach ($tests as $table => $expectedRows) {
$sql = "SELECT count(*) FROM " . Common::prefixTable($table);
@@ -98,7 +100,8 @@ class TwoVisitsWithCustomVariablesSegmentMatchVisitorTypeTest extends SystemTest
if($expectedRows != $countBlobs) {
$output = Db::get()->fetchAll("SELECT * FROM " . Common::prefixTable($table) . " ORDER BY name, idarchive ASC");
- var_export('This is debug output from ' . __CLASS__ . ' in case of an error: ' . $output);
+ var_export('This is debug output from ' . __CLASS__ . ' in case of an error: ');
+ var_export($output);
}
$this->assertEquals($expectedRows, $countBlobs, "$table: %s");
}
diff --git a/tests/PHPUnit/System/VisitsInPastInvalidateOldReportsTest.php b/tests/PHPUnit/System/VisitsInPastInvalidateOldReportsTest.php
index 859eda1646..b951995368 100644
--- a/tests/PHPUnit/System/VisitsInPastInvalidateOldReportsTest.php
+++ b/tests/PHPUnit/System/VisitsInPastInvalidateOldReportsTest.php
@@ -42,8 +42,8 @@ class VisitsInPastInvalidateOldReportsTest extends SystemTestCase
{
$idSite = self::$fixture->idSite;
$idSite2 = self::$fixture->idSite2;
- $dateTimeDateInPastWebsite1 = self::$fixture->dateTimeDateInPastWebsite1;
- $dateTimeDateInPastWebsite2 = self::$fixture->dateTimeDateInPastWebsite2;
+ $dateTimeDateInPastWebsite1 = self::$fixture->dateTimeInPastWebsite1;
+ $dateTimeDateInPastWebsite2 = self::$fixture->dateTimeInPastWebsite2;
// We test a typical Numeric and a Recursive blob reports
$apiToCall = array('VisitsSummary.get', 'Actions.getPageUrls');
@@ -124,8 +124,8 @@ class VisitsInPastInvalidateOldReportsTest extends SystemTestCase
{
$idSite = self::$fixture->idSite;
$idSite2 = self::$fixture->idSite2;
- $dateTimeDateInPastWebsite1 = self::$fixture->dateTimeDateInPastWebsite1;
- $dateTimeDateInPastWebsite2 = self::$fixture->dateTimeDateInPastWebsite2;
+ $dateTimeDateInPastWebsite1 = self::$fixture->dateTimeInPastWebsite1;
+ $dateTimeDateInPastWebsite2 = self::$fixture->dateTimeInPastWebsite2;
$apiToCall = array('VisitsSummary.get', 'Actions.getPageUrls');
diff --git a/tests/PHPUnit/System/expected/test_VisitsInPast_InvalidateOldReportsWebsite1_OldReportsShouldNotAppear__Actions.getPageUrls_month.xml b/tests/PHPUnit/System/expected/test_VisitsInPast_InvalidateOldReportsWebsite1_OldReportsShouldNotAppear__Actions.getPageUrls_month.xml
index 89eec3fbc3..2f10eb3f97 100644
--- a/tests/PHPUnit/System/expected/test_VisitsInPast_InvalidateOldReportsWebsite1_OldReportsShouldNotAppear__Actions.getPageUrls_month.xml
+++ b/tests/PHPUnit/System/expected/test_VisitsInPast_InvalidateOldReportsWebsite1_OldReportsShouldNotAppear__Actions.getPageUrls_month.xml
@@ -1,6 +1,63 @@
<?xml version="1.0" encoding="utf-8" ?>
<results>
- <result date="2010-01" />
+ <result date="2010-01">
+ <row>
+ <label>category</label>
+ <nb_visits>3</nb_visits>
+ <nb_hits>4</nb_hits>
+ <sum_time_spent>0</sum_time_spent>
+ <entry_nb_visits>1</entry_nb_visits>
+ <entry_nb_actions>4</entry_nb_actions>
+ <entry_sum_visit_length>1</entry_sum_visit_length>
+ <entry_bounce_count>0</entry_bounce_count>
+ <exit_nb_visits>1</exit_nb_visits>
+ <avg_time_on_page>0</avg_time_on_page>
+ <bounce_rate>0%</bounce_rate>
+ <exit_rate>33%</exit_rate>
+ <subtable>
+ <row>
+ <label>/Page1</label>
+ <nb_visits>1</nb_visits>
+ <nb_hits>2</nb_hits>
+ <sum_time_spent>0</sum_time_spent>
+ <entry_nb_visits>1</entry_nb_visits>
+ <entry_nb_actions>4</entry_nb_actions>
+ <entry_sum_visit_length>1</entry_sum_visit_length>
+ <entry_bounce_count>0</entry_bounce_count>
+ <sum_daily_nb_uniq_visitors>1</sum_daily_nb_uniq_visitors>
+ <sum_daily_entry_nb_uniq_visitors>1</sum_daily_entry_nb_uniq_visitors>
+ <avg_time_on_page>0</avg_time_on_page>
+ <bounce_rate>0%</bounce_rate>
+ <exit_rate>0%</exit_rate>
+ <url>http://example.org/category/Page1</url>
+ </row>
+ <row>
+ <label>/Page2</label>
+ <nb_visits>1</nb_visits>
+ <nb_hits>1</nb_hits>
+ <sum_time_spent>0</sum_time_spent>
+ <sum_daily_nb_uniq_visitors>1</sum_daily_nb_uniq_visitors>
+ <avg_time_on_page>0</avg_time_on_page>
+ <bounce_rate>0%</bounce_rate>
+ <exit_rate>0%</exit_rate>
+ <url>http://example.org/category/Page2</url>
+ </row>
+ <row>
+ <label>/Pagexx</label>
+ <nb_visits>1</nb_visits>
+ <nb_hits>1</nb_hits>
+ <sum_time_spent>0</sum_time_spent>
+ <exit_nb_visits>1</exit_nb_visits>
+ <sum_daily_nb_uniq_visitors>1</sum_daily_nb_uniq_visitors>
+ <sum_daily_exit_nb_uniq_visitors>1</sum_daily_exit_nb_uniq_visitors>
+ <avg_time_on_page>0</avg_time_on_page>
+ <bounce_rate>0%</bounce_rate>
+ <exit_rate>100%</exit_rate>
+ <url>http://example.org/category/Pagexx</url>
+ </row>
+ </subtable>
+ </row>
+ </result>
<result date="2010-02" />
<result date="2010-03">
<row>
diff --git a/tests/PHPUnit/System/expected/test_VisitsInPast_InvalidateOldReportsWebsite1_OldReportsShouldNotAppear__VisitsSummary.get_month.xml b/tests/PHPUnit/System/expected/test_VisitsInPast_InvalidateOldReportsWebsite1_OldReportsShouldNotAppear__VisitsSummary.get_month.xml
index d84e6c4f35..2f7ce19aa5 100644
--- a/tests/PHPUnit/System/expected/test_VisitsInPast_InvalidateOldReportsWebsite1_OldReportsShouldNotAppear__VisitsSummary.get_month.xml
+++ b/tests/PHPUnit/System/expected/test_VisitsInPast_InvalidateOldReportsWebsite1_OldReportsShouldNotAppear__VisitsSummary.get_month.xml
@@ -1,6 +1,18 @@
<?xml version="1.0" encoding="utf-8" ?>
<results>
- <result date="2010-01" />
+ <result date="2010-01">
+ <nb_uniq_visitors>1</nb_uniq_visitors>
+ <nb_users>0</nb_users>
+ <nb_visits>1</nb_visits>
+ <nb_actions>4</nb_actions>
+ <nb_visits_converted>0</nb_visits_converted>
+ <bounce_count>0</bounce_count>
+ <sum_visit_length>1</sum_visit_length>
+ <max_actions>4</max_actions>
+ <bounce_rate>0%</bounce_rate>
+ <nb_actions_per_visit>4</nb_actions_per_visit>
+ <avg_time_on_site>1</avg_time_on_site>
+ </result>
<result date="2010-02" />
<result date="2010-03">
<nb_uniq_visitors>1</nb_uniq_visitors>
diff --git a/tests/PHPUnit/System/expected/test_VisitsInPast_InvalidateOldReportsWebsite2_OldReportsShouldNotAppear__Actions.getPageUrls_month.xml b/tests/PHPUnit/System/expected/test_VisitsInPast_InvalidateOldReportsWebsite2_OldReportsShouldNotAppear__Actions.getPageUrls_month.xml
index aaef3a0ec5..401e8d2dc7 100644
--- a/tests/PHPUnit/System/expected/test_VisitsInPast_InvalidateOldReportsWebsite2_OldReportsShouldNotAppear__Actions.getPageUrls_month.xml
+++ b/tests/PHPUnit/System/expected/test_VisitsInPast_InvalidateOldReportsWebsite2_OldReportsShouldNotAppear__Actions.getPageUrls_month.xml
@@ -1,6 +1,63 @@
<?xml version="1.0" encoding="utf-8" ?>
<results>
- <result date="2009-10" />
+ <result date="2009-10">
+ <row>
+ <label>category</label>
+ <nb_visits>3</nb_visits>
+ <nb_hits>5</nb_hits>
+ <sum_time_spent>360</sum_time_spent>
+ <entry_nb_visits>1</entry_nb_visits>
+ <entry_nb_actions>5</entry_nb_actions>
+ <entry_sum_visit_length>361</entry_sum_visit_length>
+ <entry_bounce_count>0</entry_bounce_count>
+ <exit_nb_visits>1</exit_nb_visits>
+ <avg_time_on_page>120</avg_time_on_page>
+ <bounce_rate>0%</bounce_rate>
+ <exit_rate>33%</exit_rate>
+ <subtable>
+ <row>
+ <label>/Page1</label>
+ <nb_visits>1</nb_visits>
+ <nb_hits>2</nb_hits>
+ <sum_time_spent>0</sum_time_spent>
+ <entry_nb_visits>1</entry_nb_visits>
+ <entry_nb_actions>5</entry_nb_actions>
+ <entry_sum_visit_length>361</entry_sum_visit_length>
+ <entry_bounce_count>0</entry_bounce_count>
+ <sum_daily_nb_uniq_visitors>1</sum_daily_nb_uniq_visitors>
+ <sum_daily_entry_nb_uniq_visitors>1</sum_daily_entry_nb_uniq_visitors>
+ <avg_time_on_page>0</avg_time_on_page>
+ <bounce_rate>0%</bounce_rate>
+ <exit_rate>0%</exit_rate>
+ <url>http://example.org/category/Page1</url>
+ </row>
+ <row>
+ <label>/Page2</label>
+ <nb_visits>1</nb_visits>
+ <nb_hits>1</nb_hits>
+ <sum_time_spent>0</sum_time_spent>
+ <sum_daily_nb_uniq_visitors>1</sum_daily_nb_uniq_visitors>
+ <avg_time_on_page>0</avg_time_on_page>
+ <bounce_rate>0%</bounce_rate>
+ <exit_rate>0%</exit_rate>
+ <url>http://example.org/category/Page2</url>
+ </row>
+ <row>
+ <label>/Pageyy</label>
+ <nb_visits>1</nb_visits>
+ <nb_hits>2</nb_hits>
+ <sum_time_spent>360</sum_time_spent>
+ <exit_nb_visits>1</exit_nb_visits>
+ <sum_daily_nb_uniq_visitors>1</sum_daily_nb_uniq_visitors>
+ <sum_daily_exit_nb_uniq_visitors>1</sum_daily_exit_nb_uniq_visitors>
+ <avg_time_on_page>360</avg_time_on_page>
+ <bounce_rate>0%</bounce_rate>
+ <exit_rate>100%</exit_rate>
+ <url>http://example.org/category/Pageyy</url>
+ </row>
+ </subtable>
+ </row>
+ </result>
<result date="2009-11" />
<result date="2009-12" />
<result date="2010-01">
diff --git a/tests/PHPUnit/System/expected/test_VisitsInPast_InvalidateOldReportsWebsite2_OldReportsShouldNotAppear__VisitsSummary.get_month.xml b/tests/PHPUnit/System/expected/test_VisitsInPast_InvalidateOldReportsWebsite2_OldReportsShouldNotAppear__VisitsSummary.get_month.xml
index d046dca549..ed3e2b6ade 100644
--- a/tests/PHPUnit/System/expected/test_VisitsInPast_InvalidateOldReportsWebsite2_OldReportsShouldNotAppear__VisitsSummary.get_month.xml
+++ b/tests/PHPUnit/System/expected/test_VisitsInPast_InvalidateOldReportsWebsite2_OldReportsShouldNotAppear__VisitsSummary.get_month.xml
@@ -1,6 +1,18 @@
<?xml version="1.0" encoding="utf-8" ?>
<results>
- <result date="2009-10" />
+ <result date="2009-10">
+ <nb_uniq_visitors>1</nb_uniq_visitors>
+ <nb_users>0</nb_users>
+ <nb_visits>1</nb_visits>
+ <nb_actions>5</nb_actions>
+ <nb_visits_converted>0</nb_visits_converted>
+ <bounce_count>0</bounce_count>
+ <sum_visit_length>361</sum_visit_length>
+ <max_actions>5</max_actions>
+ <bounce_rate>0%</bounce_rate>
+ <nb_actions_per_visit>5</nb_actions_per_visit>
+ <avg_time_on_site>361</avg_time_on_site>
+ </result>
<result date="2009-11" />
<result date="2009-12" />
<result date="2010-01">