Fix some failing tests
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
This commit is contained in:
parent
b6c28f162d
commit
a96be01b6d
@ -30,7 +30,7 @@ $GLOBALS['server'] = 0;
|
||||
define('PMA_PATH_TO_BASEDIR', '');
|
||||
define('PMA_USR_BROWSER_AGENT', 'CHROME');
|
||||
define('PMA_USR_BROWSER_VER', 1);
|
||||
define('PMA_USR_OS', 'os');
|
||||
define('PMA_USR_OS', 'Other');
|
||||
define('PMA_IS_WINDOWS', false);
|
||||
// phpcs:enable
|
||||
|
||||
|
||||
@ -11,8 +11,6 @@ use PhpMyAdmin\Template;
|
||||
use PhpMyAdmin\Utils\HttpRequest;
|
||||
use PhpMyAdmin\Version;
|
||||
|
||||
use function define;
|
||||
use function defined;
|
||||
use function htmlspecialchars;
|
||||
use function json_encode;
|
||||
use function phpversion;
|
||||
@ -41,18 +39,7 @@ class ErrorReportTest extends AbstractTestCase
|
||||
$_SERVER['HTTP_USER_AGENT'] = 'HTTP_USER_AGENT';
|
||||
$_COOKIE['pma_lang'] = 'en';
|
||||
$GLOBALS['config']->set('is_https', false);
|
||||
|
||||
if (! defined('PMA_USR_BROWSER_AGENT')) {
|
||||
define('PMA_USR_BROWSER_AGENT', 'Other');
|
||||
}
|
||||
|
||||
if (! defined('PMA_USR_BROWSER_VER')) {
|
||||
define('PMA_USR_BROWSER_VER', 1);
|
||||
}
|
||||
|
||||
if (! defined('PMA_USR_OS')) {
|
||||
define('PMA_USR_OS', 'os');
|
||||
}
|
||||
$GLOBALS['config']->enableBc();
|
||||
|
||||
$template = new Template();
|
||||
$this->errorReport = new ErrorReport(
|
||||
|
||||
@ -142,10 +142,19 @@ class NormalizationTest extends AbstractTestCase
|
||||
$GLOBALS['cfg']['BrowseMIME'] = true;
|
||||
$GLOBALS['cfg']['MaxRows'] = 25;
|
||||
$GLOBALS['col_priv'] = false;
|
||||
$db = 'PMA_db';
|
||||
$table = 'PMA_table';
|
||||
$GLOBALS['cfg']['Server']['DisableIS'] = false;
|
||||
$GLOBALS['dbi'] = $this->dbi;
|
||||
$db = 'testdb';
|
||||
$table = 'mytable';
|
||||
$numFields = 1;
|
||||
$result = $this->normalization->getHtmlForCreateNewColumn($numFields, $db, $table);
|
||||
$template = new Template();
|
||||
$normalization = new Normalization(
|
||||
$this->dbi,
|
||||
new Relation($this->dbi, $template),
|
||||
new Transformations(),
|
||||
$template
|
||||
);
|
||||
$result = $normalization->getHtmlForCreateNewColumn($numFields, $db, $table);
|
||||
$this->assertStringContainsString(
|
||||
'<table id="table_columns"',
|
||||
$result
|
||||
|
||||
@ -1845,6 +1845,7 @@ class PrivilegesTest extends AbstractTestCase
|
||||
*/
|
||||
public function testGetHtmlForUserOverview(): void
|
||||
{
|
||||
$_REQUEST = ['ajax_page_request' => '1'];
|
||||
$actual = $this->serverPrivileges->getHtmlForUserOverview('ltr');
|
||||
$this->assertStringContainsString(
|
||||
'Note: MySQL privilege names are expressed in English.',
|
||||
|
||||
@ -8,6 +8,7 @@ use PhpMyAdmin\Core;
|
||||
use PhpMyAdmin\DatabaseInterface;
|
||||
use PhpMyAdmin\FieldMetadata;
|
||||
use PhpMyAdmin\MoTranslator\Loader;
|
||||
use PhpMyAdmin\Response;
|
||||
use PhpMyAdmin\SqlParser\Context;
|
||||
use PhpMyAdmin\SqlParser\Token;
|
||||
use PhpMyAdmin\Util;
|
||||
@ -343,6 +344,7 @@ class UtilTest extends AbstractTestCase
|
||||
public function testCheckParameterMissing(): void
|
||||
{
|
||||
parent::setGlobalConfig();
|
||||
$_REQUEST = [];
|
||||
$GLOBALS['text_dir'] = 'ltr';
|
||||
$GLOBALS['PMA_PHP_SELF'] = Core::getenv('PHP_SELF');
|
||||
$GLOBALS['db'] = 'db';
|
||||
@ -350,6 +352,7 @@ class UtilTest extends AbstractTestCase
|
||||
$GLOBALS['server'] = 1;
|
||||
$GLOBALS['cfg']['ServerDefault'] = 1;
|
||||
$GLOBALS['cfg']['AllowThirdPartyFraming'] = false;
|
||||
Response::getInstance()->setAjax(false);
|
||||
|
||||
$this->expectOutputRegex('/Missing parameter: field/');
|
||||
|
||||
|
||||
@ -5,7 +5,7 @@ declare(strict_types=1);
|
||||
define('ROOT_PATH', dirname(__DIR__) . DIRECTORY_SEPARATOR);
|
||||
define('PMA_USR_BROWSER_AGENT', 'Other');
|
||||
define('PMA_USR_BROWSER_VER', 1);
|
||||
define('PMA_USR_OS', 'os');
|
||||
define('PMA_USR_OS', 'Other');
|
||||
define('PMA_IS_WINDOWS', false);
|
||||
define('CACHE_DIR', ROOT_PATH . 'libraries' . DIRECTORY_SEPARATOR . 'cache' . DIRECTORY_SEPARATOR);
|
||||
define('VERSION_SUFFIX', '');
|
||||
|
||||
Loading…
Reference in New Issue
Block a user