/**
  * Test for PMA_getCommentsMap
  *
  * @return void
  */
 public function testGetCommentsMap()
 {
     $GLOBALS['cfg']['ShowPropertyComments'] = false;
     $dbi = $this->getMockBuilder('PMA_DatabaseInterface')->disableOriginalConstructor()->getMock();
     $dbi->expects($this->once())->method('getColumns')->with('db', 'table', null, true)->will($this->returnValue(array(array('Comment' => 'b', 'Field' => 'd'))));
     $GLOBALS['dbi'] = $dbi;
     $this->assertEquals(array(), PMA_getCommentsMap('db', 'table'));
     $GLOBALS['cfg']['ShowPropertyComments'] = true;
     $this->assertEquals(array('d' => 'b'), PMA_getCommentsMap('db', 'table'));
 }
Exemplo n.º 2
0
/**
 * Defines the url to return to in case of error in a sql statement
 * (at this point, $GLOBALS['goto'] will be set but could be empty)
 */
if (empty($GLOBALS['goto'])) {
    if (mb_strlen($table)) {
        // avoid a problem (see bug #2202709)
        $GLOBALS['goto'] = 'tbl_sql.php';
    } else {
        $GLOBALS['goto'] = 'db_sql.php';
    }
}
$_url_params = PMA_getUrlParameters($db, $table);
$err_url = $GLOBALS['goto'] . URL::getCommon($_url_params);
unset($_url_params);
$comments_map = PMA_getCommentsMap($db, $table);
/**
 * START REGULAR OUTPUT
 */
/**
 * Load JavaScript files
 */
$response = Response::getInstance();
$header = $response->getHeader();
$scripts = $header->getScripts();
$scripts->addFile('sql.js');
$scripts->addFile('tbl_change.js');
$scripts->addFile('big_ints.js');
$scripts->addFile('jquery/jquery-ui-timepicker-addon.js');
$scripts->addFile('jquery/jquery.validate.js');
$scripts->addFile('jquery/additional-methods.js');