コード例 #1
0
 /**
  * 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());
 }
コード例 #2
0
 function test_dailyPartition()
 {
     $tableName = 'archive_numeric';
     $p = new Piwik_TablePartitioning_Daily($tableName);
     $timestamp = strtotime("10 September 2000");
     $suffixShouldBe = "_2000_09_10";
     $config = Zend_Registry::get('config');
     $prefixTables = $config->database->tables_prefix;
     $tablename = $prefixTables . $tableName . $suffixShouldBe;
     $p->setTimestamp($timestamp);
     $allTablesInstalled = Piwik::getTablesInstalled();
     $this->assertTrue(in_array($tablename, $allTablesInstalled));
     $this->assertTrue($tablename, $p->getTableName());
     $this->assertEqual($tablename, (string) $p);
 }