diff options
author | diosmosis <benaka@piwik.pro> | 2015-05-22 05:25:04 +0300 |
---|---|---|
committer | diosmosis <benaka@piwik.pro> | 2015-05-23 02:23:46 +0300 |
commit | e96de398f6cf1c3a6c786c27fc5187c608872246 (patch) | |
tree | 56d2daf1da6dd975563d1ae1b8cafa6b2495dc8c /tests | |
parent | 561a1ef087bab7660b53ed75526824474d12e9c9 (diff) |
Make PrivacyManagerTest an IntegrationTestCase.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/PHPUnit/System/PrivacyManagerTest.php | 28 |
1 files changed, 11 insertions, 17 deletions
diff --git a/tests/PHPUnit/System/PrivacyManagerTest.php b/tests/PHPUnit/System/PrivacyManagerTest.php index 77ee72d9e3..8dcfb83acb 100644 --- a/tests/PHPUnit/System/PrivacyManagerTest.php +++ b/tests/PHPUnit/System/PrivacyManagerTest.php @@ -23,9 +23,9 @@ use Piwik\Plugins\PrivacyManager\PrivacyManager; use Piwik\Plugins\PrivacyManager\ReportsPurger; use Piwik\Plugins\VisitorInterest\API as APIVisitorInterest; use Piwik\Site; +use Piwik\Tests\Framework\TestCase\IntegrationTestCase; use Piwik\Tracker\Cache; use Piwik\Tracker\GoalManager; -use Piwik\Tests\Framework\TestCase\SystemTestCase; use Piwik\Tests\Framework\Fixture; use Piwik\Translate; @@ -33,7 +33,7 @@ use Piwik\Translate; * @group PrivacyManagerTest * @group Plugins */ -class PrivacyManagerTest extends SystemTestCase +class PrivacyManagerTest extends IntegrationTestCase { // constants used in checking whether numeric tables are populated correctly. // 'done' entries exist for every period, even if there's no metric data, so we need the @@ -55,9 +55,6 @@ class PrivacyManagerTest extends SystemTestCase private static $dateTime = '2012-02-28'; private static $daysAgoStart = 50; - // maps table names w/ array rows - private static $dbData = null; - /** * @var PrivacyManager */ @@ -66,14 +63,18 @@ class PrivacyManagerTest extends SystemTestCase private $unusedIdAction = null; - public static function setUpBeforeClass() + public static function beforeTableDataCached() { - parent::setUpBeforeClass(); + parent::beforeTableDataCached(); self::_addLogData(); self::_addReportData(); + } - self::$dbData = self::getDbTablesWithData(); + protected static function configureFixture($fixture) + { + $fixture->loadTranslations = true; + $fixture->createSuperUser = true; } public function setUp() @@ -87,8 +88,6 @@ class PrivacyManagerTest extends SystemTestCase Db::$lockPrivilegeGranted = null; - self::restoreDbTables(self::$dbData); - $dateTime = Date::factory(self::$dateTime); // purging depends upon today's date, so 'older_than' parts must be dependent upon today @@ -124,15 +123,10 @@ class PrivacyManagerTest extends SystemTestCase public function tearDown() { - parent::tearDown(); - Manager::getInstance()->deleteAll(); - Option::clearCache(); - Site::clearCache(); - Cache::deleteTrackerCache(); - ArchiveTableCreator::clear(); - $tempTableName = Common::prefixTable(LogDataPurger::TEMP_TABLE_NAME); Db::query("DROP TABLE IF EXISTS " . $tempTableName); + + parent::tearDown(); } /** |