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:
Diffstat (limited to 'tests/PHPUnit/Core/TablePartitioningTest.php')
-rw-r--r--tests/PHPUnit/Core/TablePartitioningTest.php92
1 files changed, 0 insertions, 92 deletions
diff --git a/tests/PHPUnit/Core/TablePartitioningTest.php b/tests/PHPUnit/Core/TablePartitioningTest.php
deleted file mode 100644
index 9626b7aceb..0000000000
--- a/tests/PHPUnit/Core/TablePartitioningTest.php
+++ /dev/null
@@ -1,92 +0,0 @@
-<?php
-/**
- * Piwik - Open source web analytics
- *
- * @link http://piwik.org
- * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
- */
-class TablePartitioningTest extends DatabaseTestCase
-{
- /**
- * test no timestamp => exception
- * @group Core
- * @group TablePartitioning
- */
- public function testNoTimestamp()
- {
- try {
- $p = new Piwik_TablePartitioning_Monthly('testtable');
- $p->getTableName();
- } catch (Exception $e) {
- return;
- }
- $this->fail('Expected exception not raised');
- }
-
- /**
- * test table absent => create
- * @group Core
- * @group TablePartitioning
- */
- public function testNoTable()
- {
- $tableName = 'archive_numeric';
- $p = new Piwik_TablePartitioning_Monthly($tableName);
- $timestamp = strtotime("10 September 2000");
- $suffixShouldBe = "_2000_09";
- $prefixTables = Piwik_Config::getInstance()->database['tables_prefix'];
- $tablename = $prefixTables . $tableName . $suffixShouldBe;
-
- $p->setTimestamp($timestamp);
-
- $allTablesInstalled = Piwik::getTablesInstalled($forceReload = true);
-
- $this->assertContains($tablename, $allTablesInstalled);
- $this->assertEquals($tablename, $p->getTableName());
- $this->assertEquals($tablename, (string)$p->__toString());
- }
-
- /**
- * test monthly
- * @group Core
- * @group TablePartitioning
- */
- public function testMonthlyPartition()
- {
- $tableName = 'archive_numeric';
- $p = new Piwik_TablePartitioning_Monthly($tableName);
- $timestamp = strtotime("10 September 2000");
- $suffixShouldBe = "_2000_09";
- $prefixTables = Piwik_Config::getInstance()->database['tables_prefix'];
- $tablename = $prefixTables . $tableName . $suffixShouldBe;
-
- $p->setTimestamp($timestamp);
-
- $allTablesInstalled = Piwik::getTablesInstalled($forceReload = true);
- $this->assertContains($tablename, $allTablesInstalled);
- $this->assertEquals($tablename, $p->getTableName());
- $this->assertEquals($tablename, (string)$p->__toString());
- }
-
- /**
- * test daily
- * @group Core
- * @group TablePartitioning
- */
- public function testDailyPartition()
- {
- $tableName = 'archive_numeric';
- $p = new Piwik_TablePartitioning_Daily($tableName);
- $timestamp = strtotime("10 September 2000");
- $suffixShouldBe = "_2000_09_10";
- $prefixTables = Piwik_Config::getInstance()->database['tables_prefix'];
- $tablename = $prefixTables . $tableName . $suffixShouldBe;
-
- $p->setTimestamp($timestamp);
-
- $allTablesInstalled = Piwik::getTablesInstalled();
- $this->assertContains($tablename, $allTablesInstalled);
- $this->assertEquals($tablename, $p->getTableName());
- $this->assertEquals($tablename, (string)$p->__toString());
- }
-}