/**
  * Tests for PMA_getHtmlForTrackingReport() method.
  *
  * @return void
  * @test
  */
 public function testPMAGetHtmlForTrackingReportr()
 {
     $_REQUEST['version'] = 10;
     $_REQUEST['date_from'] = "date_from";
     $_REQUEST['date_to'] = "date_to";
     $_REQUEST['users'] = "users";
     $_REQUEST['logtype'] = 'logtype';
     $url_query = "select * from PMA";
     $data = array('tracking' => 'tracking', 'ddlog' => array('ddlog'), 'dmlog' => array('dmlog'));
     $url_params = array();
     $selection_schema = array();
     $selection_data = array();
     $selection_both = array();
     $filter_ts_to = array();
     $filter_ts_from = array();
     $filter_users = array();
     $html = PMA_getHtmlForTrackingReport($url_query, $data, $url_params, $selection_schema, $selection_data, $selection_both, $filter_ts_to, $filter_ts_from, $filter_users);
     $this->assertContains(__('Tracking report'), $html);
     $this->assertContains($url_query, $html);
     $this->assertContains(__('Tracking statements'), $html);
     $this->assertContains($data['tracking'], $html);
     $version = '<form method="post" action="tbl_tracking.php' . PMA_URL_getCommon($url_params + array('report' => 'true', 'version' => $_REQUEST['version']));
     $this->assertContains($version, $html);
     $this->assertContains($version, $html);
     $this->assertContains(__('Structure only'), $html);
     $this->assertContains(__('Data only'), $html);
     $this->assertContains(__('Structure and data'), $html);
     $this->assertContains(htmlspecialchars($_REQUEST['date_from']), $html);
     $this->assertContains(htmlspecialchars($_REQUEST['date_to']), $html);
     $this->assertContains(htmlspecialchars($_REQUEST['users']), $html);
 }
Beispiel #2
0
    $html .= PMA_getHtmlForSchemaSnapshot($url_query);
}
// end of snapshot report

/*
 *  Tracking report
 */
if (isset($_REQUEST['report'])
    && (isset($_REQUEST['delete_ddlog']) || isset($_REQUEST['delete_dmlog']))
) {
    $html .= PMA_deleteTrackingReportRows($data);
}

if (isset($_REQUEST['report']) || isset($_REQUEST['report_export'])) {
    $html .= PMA_getHtmlForTrackingReport(
        $url_query, $data, $url_params, $selection_schema, $selection_data,
        $selection_both, $filter_ts_to, $filter_ts_from, $filter_users
    );
} // end of report


/*
 * List selectable tables
 */
$selectable_tables_sql_result = PMA_getSQLResultForSelectableTables();
if ($GLOBALS['dbi']->numRows($selectable_tables_sql_result) > 0) {
    $html .= PMA_getHtmlForSelectableTables(
        $selectable_tables_sql_result, $url_query
    );
}
$html .= '<br />';