Merge remote-tracking branch 'origin/master'

This commit is contained in:
Weblate 2017-12-19 04:04:47 +01:00
commit bb3eb25175
12 changed files with 60 additions and 8 deletions

View File

@ -22,9 +22,12 @@ class BrowseForeignersTest extends TestCase
*
* @return void
*/
public function setup()
public function setUp()
{
$GLOBALS['cfg']['LimitChars'] = 50;
$GLOBALS['cfg']['MaxRows'] = 25;
$GLOBALS['cfg']['RepeatCells'] = 100;
$GLOBALS['cfg']['ShowAll'] = false;
$GLOBALS['pmaThemeImage'] = '';
}

View File

@ -39,6 +39,19 @@ class CoreTest extends PmaTestCase
'user_password.php',
);
/**
* Setup for test cases
*
* @return void
*/
public function setUp()
{
$GLOBALS['server'] = 0;
$GLOBALS['db'] = '';
$GLOBALS['table'] = '';
$GLOBALS['PMA_PHP_SELF'] = 'http://example.net/';
}
/**
* Test for Core::arrayRead
*

View File

@ -26,8 +26,9 @@ class DatabaseInterfaceTest extends PmaTestCase
*
* @return void
*/
function setup()
protected function setUp()
{
$GLOBALS['server'] = 0;
$extension = new DbiDummy();
$this->_dbi = new DatabaseInterface($extension);
}

View File

@ -204,6 +204,7 @@ class EncodingTest extends TestCase
public function testListEncodings()
{
$GLOBALS['cfg']['AvailableCharsets'] = ['utf-8'];
$result = Encoding::listEncodings();
$this->assertContains('utf-8', $result);
}

View File

@ -47,6 +47,7 @@ class FooterTest extends PmaTestCase
$GLOBALS['text_dir'] = 'ltr';
$GLOBALS['PMA_Config'] = new Config();
$GLOBALS['PMA_Config']->enableBc();
$GLOBALS['cfg']['Server']['DisableIS'] = false;
$GLOBALS['cfg']['Server']['verbose'] = 'verbose host';
$GLOBALS['server'] = '1';
$_GET['reload_left_frame'] = '1';
@ -56,7 +57,6 @@ class FooterTest extends PmaTestCase
unset($GLOBALS['sql_query']);
$GLOBALS['error_handler'] = new ErrorHandler();
unset($_POST);
}
/**

View File

@ -2297,6 +2297,7 @@ class InsertEditTest extends TestCase
$edited_values = array(
array('c' => 'cname')
);
$GLOBALS['cfg']['DefaultTransformations']['PreApPend'] = ['', ''];
$GLOBALS['cfg']['ServerDefault'] = 1;
$_REQUEST['where_clause'] = 1;
$transformation = array(

View File

@ -120,6 +120,9 @@ class NormalizationTest extends TestCase
*/
public function testPMAGetHtmlForCreateNewColumn()
{
$GLOBALS['cfg']['BrowseMIME'] = true;
$GLOBALS['cfg']['MaxRows'] = 25;
$GLOBALS['col_priv'] = false;
$db = "PMA_db";
$table= "PMA_table";
$num_fields = 1;

View File

@ -40,6 +40,7 @@ class OperationsTest extends TestCase
$GLOBALS['col_priv'] = true;
$GLOBALS['proc_priv'] = true;
$GLOBALS['flush_priv'] = true;
$GLOBALS['is_reload_priv'] = false;
$GLOBALS['cfg']['Server']['DisableIS'] = false;
}

View File

@ -18,6 +18,30 @@ use stdClass;
*/
class SqlTest extends TestCase
{
/**
* Setup for test cases
*
* @return void
*/
protected function setUp()
{
$GLOBALS['server'] = 1;
$GLOBALS['db'] = 'db';
$GLOBALS['table'] = 'table';
$GLOBALS['cfg']['AllowThirdPartyFraming'] = false;
$GLOBALS['cfg']['SendErrorReports'] = 'ask';
$GLOBALS['cfg']['ServerDefault'] = 1;
$GLOBALS['cfg']['DefaultTabDatabase'] = 'structure';
$GLOBALS['cfg']['DefaultTabTable'] = 'browse';
$GLOBALS['cfg']['ShowDatabasesNavigationAsTree'] = true;
$GLOBALS['cfg']['NavigationTreeDefaultTabTable'] = 'structure';
$GLOBALS['cfg']['NavigationTreeDefaultTabTable2'] = '';
$GLOBALS['cfg']['LimitChars'] = 50;
$GLOBALS['cfg']['Confirm'] = true;
$GLOBALS['cfg']['LoginCookieValidity'] = 1440;
$GLOBALS['PMA_PHP_SELF'] = 'index.php';
}
/**
* Test Sql::getSqlWithLimitClause
*
@ -28,7 +52,6 @@ class SqlTest extends TestCase
// Test environment.
$GLOBALS['_SESSION']['tmpval']['pos'] = 1;
$GLOBALS['_SESSION']['tmpval']['max_rows'] = 2;
$GLOBALS['db'] = 'db';
$analyzed_sql_results = Sql::parseAndAnalyze(
'SELECT * FROM test LIMIT 0, 10'
@ -48,7 +71,6 @@ class SqlTest extends TestCase
{
// Test environment.
$GLOBALS['cfg']['RememberSorting'] = true;
$GLOBALS['db'] = 'db';
$this->assertTrue(
Sql::isRememberSortingOrder(
@ -90,7 +112,6 @@ class SqlTest extends TestCase
{
// Test environment.
$GLOBALS['_SESSION']['tmpval']['max_rows'] = 10;
$GLOBALS['db'] = 'db';
$this->assertTrue(
Sql::isAppendLimitClause(
@ -114,7 +135,6 @@ class SqlTest extends TestCase
{
// Test environment.
$GLOBALS['_SESSION']['tmpval']['max_rows'] = 10;
$GLOBALS['db'] = 'db';
$this->assertTrue(
Sql::isJustBrowsing(

View File

@ -21,6 +21,9 @@ class TwoFactorTest extends PmaTestCase
public function setUp()
{
$GLOBALS['server'] = 1;
$GLOBALS['db'] = 'db';
$GLOBALS['table'] = 'table';
$GLOBALS['PMA_PHP_SELF'] = 'index.php';
}
/**

View File

@ -353,6 +353,8 @@ class UserPreferencesTest extends PmaTestCase
public function testUserprefsRedirect()
{
$GLOBALS['lang'] = '';
$GLOBALS['db'] = 'db';
$GLOBALS['table'] = 'table';
$this->mockResponse('Location: /phpmyadmin/file.html?a=b&saved=1&server=0#h+ash');

View File

@ -495,10 +495,14 @@ class UtilTest extends PmaTestCase
function testCheckParameterMissing()
{
$GLOBALS['PMA_Config'] = new Config();
$GLOBALS['cfg'] = array('ServerDefault' => 1);
$GLOBALS['text_dir'] = 'ltr';
$GLOBALS['PMA_PHP_SELF'] = Core::getenv('PHP_SELF');
$GLOBALS['pmaThemePath'] = $GLOBALS['PMA_Theme']->getPath();
$GLOBALS['db'] = 'db';
$GLOBALS['table'] = 'table';
$GLOBALS['server'] = 1;
$GLOBALS['cfg']['ServerDefault'] = 1;
$GLOBALS['cfg']['AllowThirdPartyFraming'] = false;
$this->expectOutputRegex("/Missing parameter: field/");