createDatabaseVersion() public static méthode

Creates tracking version of a database (in other words: create a job to track future changes on the database).
public static createDatabaseVersion ( string $dbname, string $version, string $query, string $tracking_set = 'CREATE DATABASE,ALTER DATABASE,DROP DATABASE' ) : integer
$dbname string name of database
$version string version
$query string query
$tracking_set string set of tracking statements
Résultat integer result of version insertion
 /**
  * Test for Tracker::createDatabaseVersion()
  *
  * @return void
  * @test
  */
 public function testCreateDatabaseVersion()
 {
     if (!setupForTestsUsingDate()) {
         $this->markTestSkipped("Cannot override internal function date()");
     }
     $GLOBALS['cfg']['Server']['tracking_add_drop_table'] = true;
     $GLOBALS['cfg']['Server']['tracking_add_drop_view'] = true;
     $GLOBALS['cfg']['Server']['user'] = "******";
     $dbi = $this->getMockBuilder('PMA\\libraries\\DatabaseInterface')->disableOriginalConstructor()->getMock();
     $date = date('Y-m-d H:i:s');
     $expectedMainQuery = "/*NOTRACK*/" . "\nINSERT INTO `pmadb`.`tracking` (db_name, table_name, version, date_created, date_updated," . " schema_snapshot, schema_sql, data_sql, tracking ) values (\n        'pma_test',\n        '',\n        '1',\n        '" . $date . "',\n        '" . $date . "',\n        '',\n        '# log " . $date . " pma_test_user" . "\nSHOW DATABASES',\n        '" . "\n',\n        'CREATE DATABASE,ALTER DATABASE,DROP DATABASE' )";
     $GLOBALS['controllink'] = null;
     $dbi->expects($this->exactly(1))->method('query')->with($expectedMainQuery, null, 0, false)->will($this->returnValue("executed"));
     $GLOBALS['dbi'] = $dbi;
     $this->assertEquals('executed', Tracker::createDatabaseVersion('pma_test', '1', 'SHOW DATABASES'));
     tearDownForTestsUsingDate();
 }