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:
-rw-r--r--core/DataAccess/ArchivePurger.php11
-rw-r--r--plugins/CoreAdminHome/Tasks.php2
-rw-r--r--tests/PHPUnit/Fixtures/SiteVisitsWithInvalidation.php86
-rw-r--r--tests/PHPUnit/Fixtures/VisitsTwoWebsitesWithAdditionalVisits.php128
-rw-r--r--tests/PHPUnit/Integration/ArchiveInvalidationTest.php104
-rw-r--r--tests/PHPUnit/Integration/expected/test_Archive_InvalidationWebsite1_NewDataShouldAppear__Actions.getPageUrls_month.xml17
-rw-r--r--tests/PHPUnit/Integration/expected/test_Archive_InvalidationWebsite2_NewDataShouldAppear__Actions.getPageUrls_month.xml72
-rw-r--r--tests/PHPUnit/Integration/expected/test_Archive_InvalidationWebsite2_NewDataShouldAppear__VisitsSummary.get_month.xml18
-rw-r--r--tests/PHPUnit/Integration/expected/test_Archive_InvalidationWebsite2_NewDataShouldNotAppear__Actions.getPageUrls_month.xml61
-rw-r--r--tests/PHPUnit/Integration/expected/test_Archive_InvalidationWebsite2_NewDataShouldNotAppear__VisitsSummary.get_month.xml18
10 files changed, 362 insertions, 155 deletions
diff --git a/core/DataAccess/ArchivePurger.php b/core/DataAccess/ArchivePurger.php
index b65e8ab919..80af0bbb13 100644
--- a/core/DataAccess/ArchivePurger.php
+++ b/core/DataAccess/ArchivePurger.php
@@ -29,8 +29,8 @@ class ArchivePurger
foreach ($archiveTables as $archiveTable) {
$query = '
SELECT t1.idarchive FROM `' . $archiveTable . '` t1
- INNER JOIN `piwik_archive_numeric_2014_09` t2
- ON t1.idarchive != t2.idarchive AND t1.name = t2.name AND t1.idsite=t2.idsite
+ INNER JOIN `' . $archiveTable . '` t2
+ ON t1.name = t2.name AND t1.idsite=t2.idsite
AND t1.date1=t2.date1 AND t1.date2=t2.date2 AND t1.period=t2.period
WHERE t1.value = 4 AND t2.value IN(' . ArchiveWriter::DONE_OK . ', ' . ArchiveWriter::DONE_OK_TEMPORARY . ') AND t1.name LIKE \'done%\'';
$result = Db::fetchAll($query);
@@ -43,9 +43,10 @@ class ArchivePurger
$result
);
- Db::query(
- 'DELETE FROM `' . $archiveTable . '` WHERE idarchive IN (' . implode(', ', $archiveIds) . ')'
- );
+ $date = ArchiveTableCreator::getDateFromTableName($archiveTable);
+ $date = Date::factory(str_replace('_','-', $date) . '-01');
+
+ self::deleteArchiveIds($date, $archiveIds);
}
}
diff --git a/plugins/CoreAdminHome/Tasks.php b/plugins/CoreAdminHome/Tasks.php
index 3f82dba9e6..461ca5ca52 100644
--- a/plugins/CoreAdminHome/Tasks.php
+++ b/plugins/CoreAdminHome/Tasks.php
@@ -21,7 +21,7 @@ class Tasks extends \Piwik\Plugin\Tasks
$this->daily('purgeOutdatedArchives', null, self::HIGH_PRIORITY);
// general data purge on invalidated archive records, executed daily
- $this->daily('purgeInvalidatedArchives', null, self::HIGH_PRIORITY);
+ $this->daily('purgeInvalidatedArchives', null, self::LOW_PRIORITY);
// lowest priority since tables should be optimized after they are modified
$this->daily('optimizeArchiveTable', null, self::LOWEST_PRIORITY);
diff --git a/tests/PHPUnit/Fixtures/SiteVisitsWithInvalidation.php b/tests/PHPUnit/Fixtures/SiteVisitsWithInvalidation.php
deleted file mode 100644
index e72cf1b9be..0000000000
--- a/tests/PHPUnit/Fixtures/SiteVisitsWithInvalidation.php
+++ /dev/null
@@ -1,86 +0,0 @@
-<?php
-/**
- * Piwik - free/libre analytics platform
- *
- * @link http://piwik.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\Fixture;
-
-/**
- * Adds two sites and tracks several visits all in the past.
- */
-class SiteVisitsWithInvalidation extends Fixture
-{
- public $dateTimeFirstDateWebsite = '2010-03-06 01:22:33';
-
- public $idSite = 1;
-
- public function setUp()
- {
- $this->setUpWebsitesAndGoals();
- $this->trackVisits();
- }
-
- public function tearDown()
- {
- // empty
- }
-
- public function setUpWebsitesAndGoals()
- {
- if (!self::siteCreated($idSite = 1)) {
- self::createWebsite($this->dateTimeFirstDateWebsite);
- }
- }
-
- protected function trackVisits()
- {
- /**
- * Track Visits normal date for the 2 websites
- */
- // WEBSITE 1
- $t = self::getTracker($this->idSite, $this->dateTimeFirstDateWebsite, $defaultInit = true);
- $t->setUrl('http://example.org/category/Page1');
- self::checkResponse($t->doTrackPageView('Hello'));
- $t->setUrl('http://example.org/category/Page2');
- self::checkResponse($t->doTrackPageView('Hello'));
- $t->setUrl('http://example.org/category/Page3');
- self::checkResponse($t->doTrackPageView('Hello'));
- $t->setUrl('http://example.org/Home');
- self::checkResponse($t->doTrackPageView('Hello'));
- $t->setUrl('http://example.org/Contact');
- self::checkResponse($t->doTrackPageView('Hello'));
- $t->setUrl('http://example.org/Contact/ThankYou');
- self::checkResponse($t->doTrackPageView('Hello'));
-
- }
-
-
-
- public function trackMoreVisits()
- {
- /**
- * Track Visits normal date for the 2 websites
- */
- // WEBSITE 1
- $t = self::getTracker($this->idSite, $this->dateTimeFirstDateWebsite, $defaultInit = true);
- $t->setIp('156.15.13.12');
- $t->setUrl('http://example.org/category/Page1');
- self::checkResponse($t->doTrackPageView('Hello'));
- $t->setUrl('http://example.org/category/Page2');
- self::checkResponse($t->doTrackPageView('Hello'));
- $t->setUrl('http://example.org/category/Page3');
- self::checkResponse($t->doTrackPageView('Hello'));
- $t->setUrl('http://example.org/Home');
- self::checkResponse($t->doTrackPageView('Hello'));
- $t->setUrl('http://example.org/Contact');
- self::checkResponse($t->doTrackPageView('Hello'));
- $t->setUrl('http://example.org/Contact/ThankYou');
- self::checkResponse($t->doTrackPageView('Hello'));
-
- }
-} \ No newline at end of file
diff --git a/tests/PHPUnit/Fixtures/VisitsTwoWebsitesWithAdditionalVisits.php b/tests/PHPUnit/Fixtures/VisitsTwoWebsitesWithAdditionalVisits.php
new file mode 100644
index 0000000000..01963cb8ee
--- /dev/null
+++ b/tests/PHPUnit/Fixtures/VisitsTwoWebsitesWithAdditionalVisits.php
@@ -0,0 +1,128 @@
+<?php
+/**
+ * Piwik - free/libre analytics platform
+ *
+ * @link http://piwik.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\Fixture;
+
+/**
+ * Adds two sites and tracks several visits with possibility to add new visits to the same days
+ */
+class VisitsTwoWebsitesWithAdditionalVisits extends Fixture
+{
+ public $dateTimeFirstDateWebsite1 = '2010-03-06 01:22:33';
+ public $dateTimeFirstDateWebsite2 = '2010-01-06 02:22:33';
+
+ public $idSite1 = 1;
+ public $idSite2 = 2;
+
+ public function setUp()
+ {
+ $this->setUpWebsitesAndGoals();
+ $this->trackVisits();
+ }
+
+ public function tearDown()
+ {
+ // empty
+ }
+
+ public function setUpWebsitesAndGoals()
+ {
+ if (!self::siteCreated($idSite = 1)) {
+ self::createWebsite($this->dateTimeFirstDateWebsite1);
+ }
+
+ if (!self::siteCreated($idSite = 2)) {
+ self::createWebsite($this->dateTimeFirstDateWebsite2);
+ }
+ }
+
+ protected function trackVisits()
+ {
+ /**
+ * Track Visits normal date for the 2 websites
+ */
+ // WEBSITE 1
+ $t = self::getTracker($this->idSite1, $this->dateTimeFirstDateWebsite1, $defaultInit = true);
+ $t->setUrl('http://example.org/category/Page1');
+ self::checkResponse($t->doTrackPageView('Hello'));
+ $t->setUrl('http://example.org/category/Page2');
+ self::checkResponse($t->doTrackPageView('Hello'));
+ $t->setUrl('http://example.org/category/Page3');
+ self::checkResponse($t->doTrackPageView('Hello'));
+ $t->setUrl('http://example.org/Home');
+ self::checkResponse($t->doTrackPageView('Hello'));
+ $t->setUrl('http://example.org/Contact');
+ self::checkResponse($t->doTrackPageView('Hello'));
+ $t->setUrl('http://example.org/Contact/ThankYou');
+ self::checkResponse($t->doTrackPageView('Hello'));
+
+ // WEBSITE 2
+ $t = self::getTracker($this->idSite2, $this->dateTimeFirstDateWebsite2, $defaultInit = true);
+ $t->setIp('156.52.3.22');
+ $t->setUrl('http://example.org/category/Page1');
+ self::checkResponse($t->doTrackPageView('Hello'));
+ $t->setUrl('http://example.org/category/Page2');
+ self::checkResponse($t->doTrackPageView('Hello'));
+ $t->setUrl('http://example.org/category/Page3');
+ self::checkResponse($t->doTrackPageView('Hello'));
+ $t->setUrl('http://example.org/Home');
+ self::checkResponse($t->doTrackPageView('Hello'));
+ $t->setUrl('http://example.org/Contact');
+ self::checkResponse($t->doTrackPageView('Hello'));
+ $t->setUrl('http://example.org/Contact/ThankYou');
+ self::checkResponse($t->doTrackPageView('Hello'));
+
+ }
+
+
+
+ public function trackMoreVisits($idSite)
+ {
+ /**
+ * Track Visits normal date for the 2 websites
+ */
+
+ switch ($idSite) {
+ case $this->idSite1:
+ $t = self::getTracker($this->idSite1, $this->dateTimeFirstDateWebsite1, $defaultInit = true);
+ $t->setIp('156.15.13.12');
+ $t->setUrl('http://example.org/category/Page1');
+ self::checkResponse($t->doTrackPageView('Hello'));
+ $t->setUrl('http://example.org/category/Page2');
+ self::checkResponse($t->doTrackPageView('Hello'));
+ $t->setUrl('http://example.org/category/NewPage');
+ self::checkResponse($t->doTrackPageView('New Page'));
+ $t->setUrl('http://example.org/Home');
+ self::checkResponse($t->doTrackPageView('Hello'));
+ $t->setUrl('http://example.org/Contact');
+ self::checkResponse($t->doTrackPageView('Hello'));
+ $t->setUrl('http://example.org/Contact/ThankYou');
+ self::checkResponse($t->doTrackPageView('Hello'));
+ break;
+
+ case $this->idSite2:
+ $t = self::getTracker($this->idSite2, $this->dateTimeFirstDateWebsite2, $defaultInit = true);
+ $t->setIp('156.5.55.2');
+ $t->setUrl('http://example.org/category/Page1');
+ self::checkResponse($t->doTrackPageView('Hello'));
+ $t->setUrl('http://example.org/category/Page2');
+ self::checkResponse($t->doTrackPageView('Hello'));
+ $t->setUrl('http://example.org/category/NewPage');
+ self::checkResponse($t->doTrackPageView('New Page'));
+ $t->setUrl('http://example.org/Home');
+ self::checkResponse($t->doTrackPageView('Hello'));
+ $t->setUrl('http://example.org/Contact');
+ self::checkResponse($t->doTrackPageView('Hello'));
+ $t->setUrl('http://example.org/Contact/ThankYou');
+ self::checkResponse($t->doTrackPageView('Hello'));
+ break;
+ }
+ }
+} \ No newline at end of file
diff --git a/tests/PHPUnit/Integration/ArchiveInvalidationTest.php b/tests/PHPUnit/Integration/ArchiveInvalidationTest.php
index 57d00939aa..89abdb92f1 100644
--- a/tests/PHPUnit/Integration/ArchiveInvalidationTest.php
+++ b/tests/PHPUnit/Integration/ArchiveInvalidationTest.php
@@ -9,7 +9,7 @@ namespace Piwik\Tests\Integration;
use Piwik\API\Request;
use Piwik\Config;
-use Piwik\Tests\Fixtures\SiteVisitsWithInvalidation;
+use Piwik\Tests\Fixtures\VisitsTwoWebsitesWithAdditionalVisits;
use Piwik\Tests\IntegrationTestCase;
use Exception;
@@ -23,6 +23,8 @@ class ArchiveInvalidationTest extends IntegrationTestCase
{
public static $fixture = null; // initialized below class definition
+ protected $suffix = '_NewDataShouldNotAppear';
+
/**
* @dataProvider getApiForTesting
*/
@@ -36,64 +38,45 @@ class ArchiveInvalidationTest extends IntegrationTestCase
*/
public function getApiForTesting()
{
- $idSite = self::$fixture->idSite;
- $dateTimeDateInPastWebsite = self::$fixture->dateTimeFirstDateWebsite;
-
// We test a typical Numeric and a Recursive blob reports
$apiToCall = array('VisitsSummary.get', 'Actions.getPageUrls');
// We also test a segment
- //TODO
+// $segmentsToTest = array(
+// // array( SegmentString , TestSuffix , Array of API to test)
+// array("pageUrl=@category/", '_SegmentPageUrlContains', $apiToCall),
+// );
// Build tests for the 2 websites
return array(
- array($apiToCall, array('idSite' => $idSite,
- 'testSuffix' => 'Website' . $idSite . '_NewDataShouldNotAppear',
- 'date' => $dateTimeDateInPastWebsite,
+ array($apiToCall, array('idSite' => self::$fixture->idSite1,
+ 'testSuffix' => 'Website' . self::$fixture->idSite1 . $this->suffix,
+ 'date' => self::$fixture->dateTimeFirstDateWebsite1,
+ 'periods' => 'month',
+ 'setDateLastN' => 4, // 4months ahead
+ 'otherRequestParameters' => array('expanded' => 1))),
+ array($apiToCall, array('idSite' => self::$fixture->idSite2,
+ 'testSuffix' => 'Website' . self::$fixture->idSite2 . $this->suffix,
+ 'date' => self::$fixture->dateTimeFirstDateWebsite2,
'periods' => 'month',
+ 'segment' => 'pageUrl=@category/',
'setDateLastN' => 4, // 4months ahead
- 'otherRequestParameters' => array('expanded' => 1)))
+ 'otherRequestParameters' => array('expanded' => 1))),
);
}
/**
* @depends testApi
- * @dataProvider getSameApiForTesting
+ * @dataProvider getApiForTesting
*/
public function testSameApi($api, $params)
{
+ $this->setBrowserArchivingTriggering(0);
+ self::$fixture->trackMoreVisits($params['idSite']);
- self::$fixture->trackMoreVisits();
-
- Config::getInstance()->General['enable_browser_archiving_triggering'] = 0;
- $idSite = self::$fixture->idSite;
- $dateTimeDateInPastWebsite = new \DateTime(self::$fixture->dateTimeFirstDateWebsite);
-
- $r = new Request("module=API&method=CoreAdminHome.invalidateArchivedReports&idSites=" . $idSite . "&dates=" . $dateTimeDateInPastWebsite->format('Y-m-d'));
- $this->assertApiResponseHasNoError($r->process());
-
- // 2) Call API again, with an older date, which should now return data
+ $this->invalidateTestArchives();
$this->runApiTests($api, $params);
- Config::getInstance()->General['enable_browser_archiving_triggering'] = 1;
-
- }
-
- public function getSameApiForTesting()
- {
- $idSite = self::$fixture->idSite;
- $dateTimeFirstDateWebsite = self::$fixture->dateTimeFirstDateWebsite;
-
- $apiToCall = array('VisitsSummary.get', 'Actions.getPageUrls');
-
- return array(
- array($apiToCall, array('idSite' => $idSite,
- 'testSuffix' => 'Website' . $idSite . '_NewDataShouldNotAppear',
- 'date' => $dateTimeFirstDateWebsite,
- 'periods' => 'month',
- 'setDateLastN' => 4, // 4months ahead
- 'otherRequestParameters' => array('expanded' => 1))),
- );
}
/**
@@ -103,14 +86,9 @@ class ArchiveInvalidationTest extends IntegrationTestCase
*/
public function testAnotherApi($api, $params)
{
- Config::getInstance()->General['enable_browser_archiving_triggering'] = 1;
- $idSite = self::$fixture->idSite;
- $dateTimeDateInPastWebsite = new \DateTime(self::$fixture->dateTimeFirstDateWebsite);
-
- $r = new Request("module=API&method=CoreAdminHome.invalidateArchivedReports&idSites=" . $idSite . "&dates=" . $dateTimeDateInPastWebsite->format('Y-m-d'));
- $this->assertApiResponseHasNoError($r->process());
+ $this->setBrowserArchivingTriggering(1);
+ $this->invalidateTestArchives();
- // 2) Call API again, with an older date, which should now return data
$this->runApiTests($api, $params);
}
@@ -120,25 +98,31 @@ class ArchiveInvalidationTest extends IntegrationTestCase
*/
public function getAnotherApiForTesting()
{
- $idSite = self::$fixture->idSite;
- $dateTimeFirstDateWebsite = self::$fixture->dateTimeFirstDateWebsite;
-
- $apiToCall = array('VisitsSummary.get', 'Actions.getPageUrls');
-
- return array(
- array($apiToCall, array('idSite' => $idSite,
- 'testSuffix' => 'Website' . $idSite . '_NewDataShouldAppear',
- 'date' => $dateTimeFirstDateWebsite,
- 'periods' => 'month',
- 'setDateLastN' => 4, // 4months ahead
- 'otherRequestParameters' => array('expanded' => 1))),
- );
+ $this->suffix = '_NewDataShouldAppear';
+ return $this->getApiForTesting();
}
public static function getOutputPrefix()
{
return 'Archive_Invalidation';
}
+
+ protected function setBrowserArchivingTriggering($value)
+ {
+ Config::getInstance()->General['enable_browser_archiving_triggering'] = $value;
+ }
+
+ protected function invalidateTestArchives()
+ {
+ $dateToInvalidate1 = new \DateTime(self::$fixture->dateTimeFirstDateWebsite1);
+ $dateToInvalidate2 = new \DateTime(self::$fixture->dateTimeFirstDateWebsite2);
+
+ $r = new Request("module=API&method=CoreAdminHome.invalidateArchivedReports&idSites=" . self::$fixture->idSite1 . "&dates=" . $dateToInvalidate1->format('Y-m-d'));
+ $this->assertApiResponseHasNoError($r->process());
+
+ $r = new Request("module=API&method=CoreAdminHome.invalidateArchivedReports&idSites=" . self::$fixture->idSite2 . "&dates=" . $dateToInvalidate2->format('Y-m-d'));
+ $this->assertApiResponseHasNoError($r->process());
+ }
}
-ArchiveInvalidationTest::$fixture = new SiteVisitsWithInvalidation(); \ No newline at end of file
+ArchiveInvalidationTest::$fixture = new VisitsTwoWebsitesWithAdditionalVisits(); \ No newline at end of file
diff --git a/tests/PHPUnit/Integration/expected/test_Archive_InvalidationWebsite1_NewDataShouldAppear__Actions.getPageUrls_month.xml b/tests/PHPUnit/Integration/expected/test_Archive_InvalidationWebsite1_NewDataShouldAppear__Actions.getPageUrls_month.xml
index 815ebea6b1..05622a8027 100644
--- a/tests/PHPUnit/Integration/expected/test_Archive_InvalidationWebsite1_NewDataShouldAppear__Actions.getPageUrls_month.xml
+++ b/tests/PHPUnit/Integration/expected/test_Archive_InvalidationWebsite1_NewDataShouldAppear__Actions.getPageUrls_month.xml
@@ -41,11 +41,22 @@
<url>http://example.org/category/Page2</url>
</row>
<row>
+ <label>/NewPage</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/NewPage</url>
+ </row>
+ <row>
<label>/Page3</label>
- <nb_visits>2</nb_visits>
- <nb_hits>2</nb_hits>
+ <nb_visits>1</nb_visits>
+ <nb_hits>1</nb_hits>
<sum_time_spent>0</sum_time_spent>
- <sum_daily_nb_uniq_visitors>2</sum_daily_nb_uniq_visitors>
+ <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>
diff --git a/tests/PHPUnit/Integration/expected/test_Archive_InvalidationWebsite2_NewDataShouldAppear__Actions.getPageUrls_month.xml b/tests/PHPUnit/Integration/expected/test_Archive_InvalidationWebsite2_NewDataShouldAppear__Actions.getPageUrls_month.xml
new file mode 100644
index 0000000000..aacd0baa75
--- /dev/null
+++ b/tests/PHPUnit/Integration/expected/test_Archive_InvalidationWebsite2_NewDataShouldAppear__Actions.getPageUrls_month.xml
@@ -0,0 +1,72 @@
+<results>
+ <result date="2010-01">
+ <row>
+ <label>category</label>
+ <nb_visits>6</nb_visits>
+ <nb_hits>6</nb_hits>
+ <sum_time_spent>0</sum_time_spent>
+ <entry_nb_visits>2</entry_nb_visits>
+ <entry_nb_actions>12</entry_nb_actions>
+ <entry_sum_visit_length>2</entry_sum_visit_length>
+ <entry_bounce_count>0</entry_bounce_count>
+ <avg_time_on_page>0</avg_time_on_page>
+ <bounce_rate>0%</bounce_rate>
+ <exit_rate>0%</exit_rate>
+ <subtable>
+ <row>
+ <label>/Page1</label>
+ <nb_visits>2</nb_visits>
+ <nb_hits>2</nb_hits>
+ <sum_time_spent>0</sum_time_spent>
+ <entry_nb_visits>2</entry_nb_visits>
+ <entry_nb_actions>12</entry_nb_actions>
+ <entry_sum_visit_length>2</entry_sum_visit_length>
+ <entry_bounce_count>0</entry_bounce_count>
+ <sum_daily_nb_uniq_visitors>2</sum_daily_nb_uniq_visitors>
+ <sum_daily_entry_nb_uniq_visitors>2</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>2</nb_visits>
+ <nb_hits>2</nb_hits>
+ <sum_time_spent>0</sum_time_spent>
+ <sum_daily_nb_uniq_visitors>2</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>/NewPage</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/NewPage</url>
+ </row>
+ <row>
+ <label>/Page3</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/Page3</url>
+ </row>
+ </subtable>
+ </row>
+ </result>
+ <result date="2010-02"/>
+ <result date="2010-03"/>
+ <result date="2010-04"/>
+ <result date="2010-05"/>
+</results> \ No newline at end of file
diff --git a/tests/PHPUnit/Integration/expected/test_Archive_InvalidationWebsite2_NewDataShouldAppear__VisitsSummary.get_month.xml b/tests/PHPUnit/Integration/expected/test_Archive_InvalidationWebsite2_NewDataShouldAppear__VisitsSummary.get_month.xml
new file mode 100644
index 0000000000..d2b062b900
--- /dev/null
+++ b/tests/PHPUnit/Integration/expected/test_Archive_InvalidationWebsite2_NewDataShouldAppear__VisitsSummary.get_month.xml
@@ -0,0 +1,18 @@
+<results>
+ <result date="2010-01">
+ <nb_uniq_visitors>2</nb_uniq_visitors>
+ <nb_visits>2</nb_visits>
+ <nb_actions>12</nb_actions>
+ <nb_visits_converted>0</nb_visits_converted>
+ <bounce_count>0</bounce_count>
+ <sum_visit_length>2</sum_visit_length>
+ <max_actions>6</max_actions>
+ <bounce_rate>0%</bounce_rate>
+ <nb_actions_per_visit>6</nb_actions_per_visit>
+ <avg_time_on_site>1</avg_time_on_site>
+ </result>
+ <result date="2010-02"/>
+ <result date="2010-03"/>
+ <result date="2010-04"/>
+ <result date="2010-05"/>
+</results> \ No newline at end of file
diff --git a/tests/PHPUnit/Integration/expected/test_Archive_InvalidationWebsite2_NewDataShouldNotAppear__Actions.getPageUrls_month.xml b/tests/PHPUnit/Integration/expected/test_Archive_InvalidationWebsite2_NewDataShouldNotAppear__Actions.getPageUrls_month.xml
new file mode 100644
index 0000000000..9202ee5f33
--- /dev/null
+++ b/tests/PHPUnit/Integration/expected/test_Archive_InvalidationWebsite2_NewDataShouldNotAppear__Actions.getPageUrls_month.xml
@@ -0,0 +1,61 @@
+<results>
+ <result date="2010-01">
+ <row>
+ <label>category</label>
+ <nb_visits>3</nb_visits>
+ <nb_hits>3</nb_hits>
+ <sum_time_spent>0</sum_time_spent>
+ <entry_nb_visits>1</entry_nb_visits>
+ <entry_nb_actions>6</entry_nb_actions>
+ <entry_sum_visit_length>1</entry_sum_visit_length>
+ <entry_bounce_count>0</entry_bounce_count>
+ <avg_time_on_page>0</avg_time_on_page>
+ <bounce_rate>0%</bounce_rate>
+ <exit_rate>0%</exit_rate>
+ <subtable>
+ <row>
+ <label>/Page1</label>
+ <nb_visits>1</nb_visits>
+ <nb_hits>1</nb_hits>
+ <sum_time_spent>0</sum_time_spent>
+ <entry_nb_visits>1</entry_nb_visits>
+ <entry_nb_actions>6</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>/Page3</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/Page3</url>
+ </row>
+ </subtable>
+ </row>
+ </result>
+ <result date="2010-02"/>
+ <result date="2010-03"/>
+ <result date="2010-04"/>
+ <result date="2010-05"/>
+</results> \ No newline at end of file
diff --git a/tests/PHPUnit/Integration/expected/test_Archive_InvalidationWebsite2_NewDataShouldNotAppear__VisitsSummary.get_month.xml b/tests/PHPUnit/Integration/expected/test_Archive_InvalidationWebsite2_NewDataShouldNotAppear__VisitsSummary.get_month.xml
new file mode 100644
index 0000000000..bc33e7d30d
--- /dev/null
+++ b/tests/PHPUnit/Integration/expected/test_Archive_InvalidationWebsite2_NewDataShouldNotAppear__VisitsSummary.get_month.xml
@@ -0,0 +1,18 @@
+<results>
+ <result date="2010-01">
+ <nb_uniq_visitors>1</nb_uniq_visitors>
+ <nb_visits>1</nb_visits>
+ <nb_actions>6</nb_actions>
+ <nb_visits_converted>0</nb_visits_converted>
+ <bounce_count>0</bounce_count>
+ <sum_visit_length>1</sum_visit_length>
+ <max_actions>6</max_actions>
+ <bounce_rate>0%</bounce_rate>
+ <nb_actions_per_visit>6</nb_actions_per_visit>
+ <avg_time_on_site>1</avg_time_on_site>
+ </result>
+ <result date="2010-02"/>
+ <result date="2010-03"/>
+ <result date="2010-04"/>
+ <result date="2010-05"/>
+</results> \ No newline at end of file