From 882b3f1d60955f85af4b0b0cce65bca844fd9c75 Mon Sep 17 00:00:00 2001
From: diosmosis <benakamoorthi@fastmail.fm>
Date: Sun, 2 Mar 2014 11:28:03 +0000
Subject: [PATCH] Fixing integration tests.

---
 tests/PHPUnit/DatabaseTestCase.php             | 11 ++++++++---
 tests/PHPUnit/Fixture.php                      |  2 +-
 tests/PHPUnit/Integration/Core/TrackerTest.php |  5 +++++
 3 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/tests/PHPUnit/DatabaseTestCase.php b/tests/PHPUnit/DatabaseTestCase.php
index 9541ae7b55..ef3540f50b 100644
--- a/tests/PHPUnit/DatabaseTestCase.php
+++ b/tests/PHPUnit/DatabaseTestCase.php
@@ -36,9 +36,7 @@ class DatabaseTestCase extends PHPUnit_Framework_TestCase
         parent::setUp();
 
         $this->fixture = new Fixture();
-        $this->fixture->loadTranslations = false;
-        $this->fixture->createSuperUser = false;
-        $this->fixture->configureComponents = false;
+        $this->configureFixture();
         $this->fixture->performSetUp(__CLASS__);
     }
 
@@ -50,4 +48,11 @@ class DatabaseTestCase extends PHPUnit_Framework_TestCase
         parent::tearDown();
         $this->fixture->performTearDown();
     }
+
+    protected function configureFixture()
+    {
+        $this->fixture->loadTranslations = false;
+        $this->fixture->createSuperUser = false;
+        $this->fixture->configureComponents = false;
+    }
 }
diff --git a/tests/PHPUnit/Fixture.php b/tests/PHPUnit/Fixture.php
index 7b9fb329ac..129ea81f0c 100644
--- a/tests/PHPUnit/Fixture.php
+++ b/tests/PHPUnit/Fixture.php
@@ -294,7 +294,7 @@ class Fixture extends PHPUnit_Framework_Assert
 
         // Manually set the website creation date to a day earlier than the earliest day we record stats for
         Db::get()->update(Common::prefixTable("site"),
-            array('ts_created' => Date::factory($dateTime)->subDay(60)->getDatetime()),
+            array('ts_created' => Date::factory($dateTime)->subDay(30)->getDatetime()),
             "idsite = $idSite"
         );
 
diff --git a/tests/PHPUnit/Integration/Core/TrackerTest.php b/tests/PHPUnit/Integration/Core/TrackerTest.php
index abbfca35f8..f1f6040d4d 100644
--- a/tests/PHPUnit/Integration/Core/TrackerTest.php
+++ b/tests/PHPUnit/Integration/Core/TrackerTest.php
@@ -18,6 +18,11 @@ class Core_TrackerTest extends DatabaseTestCase
         Fixture::createWebsite('2014-02-04');
     }
 
+    protected function configureFixture()
+    {
+        $this->fixture->createSuperUser = true;
+    }
+
     /**
      * Test the Bulk tracking API as documented in: http://developer.piwik.org/api-reference/tracking-api#bulk-tracking
      *
-- 
GitLab