/**
  * Test for PMA_getFirstPage()
  *
  * @return void
  */
 public function testGetFirstPage()
 {
     $db = 'db';
     $pg = '1';
     $dbi = $this->getMockBuilder('PMA_DatabaseInterface')->disableOriginalConstructor()->getMock();
     $dbi->expects($this->at(0))->method('fetchResult')->with("SELECT MIN(`page_nr`) FROM `pmadb`.`pdf_pages`" . " WHERE `db_name` = '" . $db . "'", null, null, 2, PMA_DatabaseInterface::QUERY_STORE)->will($this->returnValue(array($pg)));
     $GLOBALS['dbi'] = $dbi;
     $result = PMA_getFirstPage($db);
     $this->assertEquals($pg, $result);
 }
        $response->addJSON('message', $message);
    }
    return;
}
$script_display_field = PMA_getTablesInfo();
$tab_column = PMA_getColumnsInfo();
$script_tables = PMA_getScriptTabs();
$tables_pk_or_unique_keys = PMA_getPKOrUniqueKeys();
$tables_all_keys = PMA_getAllKeys();
$display_page = -1;
$selected_page = null;
if (!isset($_REQUEST['query'])) {
    if (!empty($_REQUEST['page'])) {
        $display_page = $_REQUEST['page'];
    } else {
        $display_page = PMA_getFirstPage($_REQUEST['db']);
    }
}
if ($display_page != -1) {
    $selected_page = PMA_getPageName($display_page);
}
$tab_pos = PMA_getTablePositions($display_page);
$script_contr = PMA_getScriptContr();
$params = array('lang' => $GLOBALS['lang']);
if (isset($_GET['db'])) {
    $params['db'] = $_GET['db'];
}
$response = PMA_Response::getInstance();
$response->getFooter()->setMinimal();
$header = $response->getHeader();
$header->setBodyId('pmd_body');