Merge remote-tracking branch 'chanaka/master'

This commit is contained in:
Michal Čihař 2012-08-20 12:43:40 +02:00
commit 56937ad51a
3 changed files with 109 additions and 1 deletions

View File

@ -100,6 +100,7 @@ vim: expandtab ts=4 sw=4 sts=4 tw=78
<h3>Currently phpMyAdmin can:</h3>
<ul><li>browse and drop databases, tables, views, columns and indexes</li>
<li>display multiple results sets through stored procedures or queries</li>
<li>create, copy, drop, rename and alter databases, tables, columns and
indexes</li>
<li>maintenance server, databases and tables, with proposals on server

View File

@ -5,7 +5,9 @@
*
* @package PhpMyAdmin
*/
if (! defined('PHPMYADMIN')) {
exit;
}
/**
* Misc functions used all over the scripts.

View File

@ -1726,4 +1726,109 @@ class PMA_DisplayResults_test extends PHPUnit_Framework_TestCase
}
/**
* Data provider for testGetShowAllButtonForTableNavigation
*
* @return array parameters and output
*/
public function dataProviderForTestGetShowAllButtonForTableNavigation()
{
return array(
array(
'mysql',
'user',
'tbl_structure.php',
'SELECT * FROM `user`',
'
<td><form action="sql.php" method="post"><input type="hidden" name="db" value="mysql" /><input type="hidden" name="table" value="user" /><input type="hidden" name="lang" value="en" /><input type="hidden" name="token" value="token" /><input type="hidden" name="sql_query" value="SELECT * FROM `user`" /><input type="hidden" name="pos" value="0" /><input type="hidden" name="session_max_rows" value="all" /><input type="hidden" name="goto" value="tbl_structure.php" /><input type="submit" name="navig" value="Show all" /></form></td>'
)
);
}
/**
* Test _getShowAllButtonForTableNavigation
*
* @param string $db the database name
* @param string $table the table name
* @param string $goto the URL to go back in case of errors
* @param string $html_sql_query the sql encoded by html special characters
* @param string $output output of _getRowInfoForSpecialLinks
*
* @dataProvider dataProviderForTestGetShowAllButtonForTableNavigation
*/
public function testGetShowAllButtonForTableNavigation(
$db, $table, $goto, $html_sql_query, $output
) {
$this->object->__set('_db', $db);
$this->object->__set('_table', $table);
$this->object->__set('_goto', $goto);
$this->assertEquals(
$output,
$this->_callPrivateFunction(
'_getShowAllButtonForTableNavigation',
array($html_sql_query)
)
);
}
/**
* Data provider for testSetHighlightedColumnGlobalField
*
* @return array parameters and output
*/
public function dataProviderForTestSetHighlightedColumnGlobalField()
{
return array(
array(
array(),
array()
),
array(
array(
0 => array(
'where_clause_identifiers' => array(
0 => '`id`',
1 => '`id`',
2 => '`db_name`'
)
)
),
array(
'`id`' => 'true',
'`db_name`' => 'true'
)
)
);
}
/**
* Test _setHighlightedColumnGlobalField
*
* @param array $analyzed_sql the analyzed query
* @param array $output setting value of _setHighlightedColumnGlobalField
*
* @dataProvider dataProviderForTestSetHighlightedColumnGlobalField
*/
public function testSetHighlightedColumnGlobalField($analyzed_sql, $output)
{
$this->_callPrivateFunction(
'_setHighlightedColumnGlobalField',
array($analyzed_sql)
);
$this->assertEquals(
$output,
$this->object->__get('_highlight_columns')
);
}
}