Remove $GLOBALS['plugin_param']
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
This commit is contained in:
parent
325760150e
commit
7dbda7545e
@ -12372,18 +12372,6 @@ parameters:
|
||||
count: 2
|
||||
path: src/Plugins/Export/ExportLatex.php
|
||||
|
||||
-
|
||||
message: '#^Cannot access offset ''export_type'' on mixed\.$#'
|
||||
identifier: offsetAccess.nonOffsetAccessible
|
||||
count: 1
|
||||
path: src/Plugins/Export/ExportLatex.php
|
||||
|
||||
-
|
||||
message: '#^Cannot access offset ''single_table'' on mixed\.$#'
|
||||
identifier: offsetAccess.nonOffsetAccessible
|
||||
count: 1
|
||||
path: src/Plugins/Export/ExportLatex.php
|
||||
|
||||
-
|
||||
message: '#^Cannot access offset ''tables'' on mixed\.$#'
|
||||
identifier: offsetAccess.nonOffsetAccessible
|
||||
@ -12426,12 +12414,6 @@ parameters:
|
||||
count: 1
|
||||
path: src/Plugins/Export/ExportLatex.php
|
||||
|
||||
-
|
||||
message: '#^Only booleans are allowed in a negated boolean, mixed given\.$#'
|
||||
identifier: booleanNot.exprNotBoolean
|
||||
count: 1
|
||||
path: src/Plugins/Export/ExportLatex.php
|
||||
|
||||
-
|
||||
message: '#^Parameter \#1 \$string of static method PhpMyAdmin\\Plugins\\Export\\ExportLatex\:\:texEscape\(\) expects string, mixed given\.$#'
|
||||
identifier: argument.type
|
||||
@ -12651,18 +12633,6 @@ parameters:
|
||||
count: 4
|
||||
path: src/Plugins/Export/ExportOdt.php
|
||||
|
||||
-
|
||||
message: '#^Cannot access offset ''export_type'' on mixed\.$#'
|
||||
identifier: offsetAccess.nonOffsetAccessible
|
||||
count: 1
|
||||
path: src/Plugins/Export/ExportOdt.php
|
||||
|
||||
-
|
||||
message: '#^Cannot access offset ''single_table'' on mixed\.$#'
|
||||
identifier: offsetAccess.nonOffsetAccessible
|
||||
count: 1
|
||||
path: src/Plugins/Export/ExportOdt.php
|
||||
|
||||
-
|
||||
message: '#^Cannot access offset ''tables'' on mixed\.$#'
|
||||
identifier: offsetAccess.nonOffsetAccessible
|
||||
@ -12693,12 +12663,6 @@ parameters:
|
||||
count: 1
|
||||
path: src/Plugins/Export/ExportOdt.php
|
||||
|
||||
-
|
||||
message: '#^Only booleans are allowed in a negated boolean, mixed given\.$#'
|
||||
identifier: booleanNot.exprNotBoolean
|
||||
count: 1
|
||||
path: src/Plugins/Export/ExportOdt.php
|
||||
|
||||
-
|
||||
message: '#^Only booleans are allowed in an if condition, array\|false given\.$#'
|
||||
identifier: if.condNotBoolean
|
||||
@ -12873,18 +12837,6 @@ parameters:
|
||||
count: 8
|
||||
path: src/Plugins/Export/ExportSql.php
|
||||
|
||||
-
|
||||
message: '#^Cannot access offset ''export_type'' on mixed\.$#'
|
||||
identifier: offsetAccess.nonOffsetAccessible
|
||||
count: 2
|
||||
path: src/Plugins/Export/ExportSql.php
|
||||
|
||||
-
|
||||
message: '#^Cannot access offset ''single_table'' on mixed\.$#'
|
||||
identifier: offsetAccess.nonOffsetAccessible
|
||||
count: 1
|
||||
path: src/Plugins/Export/ExportSql.php
|
||||
|
||||
-
|
||||
message: '#^Cannot access offset ''tables'' on mixed\.$#'
|
||||
identifier: offsetAccess.nonOffsetAccessible
|
||||
@ -12993,12 +12945,6 @@ parameters:
|
||||
count: 6
|
||||
path: src/Plugins/Export/ExportSql.php
|
||||
|
||||
-
|
||||
message: '#^Only booleans are allowed in a negated boolean, mixed given\.$#'
|
||||
identifier: booleanNot.exprNotBoolean
|
||||
count: 1
|
||||
path: src/Plugins/Export/ExportSql.php
|
||||
|
||||
-
|
||||
message: '#^Only booleans are allowed in an if condition, bool\|null given\.$#'
|
||||
identifier: if.condNotBoolean
|
||||
@ -22176,18 +22122,6 @@ parameters:
|
||||
count: 3
|
||||
path: tests/unit/Plugins/Export/ExportLatexTest.php
|
||||
|
||||
-
|
||||
message: '#^Cannot access offset ''export_type'' on mixed\.$#'
|
||||
identifier: offsetAccess.nonOffsetAccessible
|
||||
count: 2
|
||||
path: tests/unit/Plugins/Export/ExportLatexTest.php
|
||||
|
||||
-
|
||||
message: '#^Cannot access offset ''single_table'' on mixed\.$#'
|
||||
identifier: offsetAccess.nonOffsetAccessible
|
||||
count: 3
|
||||
path: tests/unit/Plugins/Export/ExportLatexTest.php
|
||||
|
||||
-
|
||||
message: '#^Property PhpMyAdmin\\Config\:\:\$selectedServer \(array\{host\: string, port\: string, socket\: string, ssl\: bool, ssl_key\: string\|null, ssl_cert\: string\|null, ssl_ca\: string\|null, ssl_ca_path\: string\|null, \.\.\.\}\) does not accept array\{host\: string, port\: 80, socket\: string, ssl\: bool, ssl_key\: string\|null, ssl_cert\: string\|null, ssl_ca\: string\|null, ssl_ca_path\: string\|null, \.\.\.\}\.$#'
|
||||
identifier: assign.propertyType
|
||||
@ -22203,18 +22137,6 @@ parameters:
|
||||
count: 1
|
||||
path: tests/unit/Plugins/Export/ExportOdtTest.php
|
||||
|
||||
-
|
||||
message: '#^Cannot access offset ''export_type'' on mixed\.$#'
|
||||
identifier: offsetAccess.nonOffsetAccessible
|
||||
count: 2
|
||||
path: tests/unit/Plugins/Export/ExportOdtTest.php
|
||||
|
||||
-
|
||||
message: '#^Cannot access offset ''single_table'' on mixed\.$#'
|
||||
identifier: offsetAccess.nonOffsetAccessible
|
||||
count: 3
|
||||
path: tests/unit/Plugins/Export/ExportOdtTest.php
|
||||
|
||||
-
|
||||
message: '#^Parameter \#2 \$haystack of static method PHPUnit\\Framework\\Assert\:\:assertStringContainsString\(\) expects string, mixed given\.$#'
|
||||
identifier: argument.type
|
||||
@ -22230,18 +22152,6 @@ parameters:
|
||||
count: 9
|
||||
path: tests/unit/Plugins/Export/ExportSqlTest.php
|
||||
|
||||
-
|
||||
message: '#^Cannot access offset ''export_type'' on mixed\.$#'
|
||||
identifier: offsetAccess.nonOffsetAccessible
|
||||
count: 2
|
||||
path: tests/unit/Plugins/Export/ExportSqlTest.php
|
||||
|
||||
-
|
||||
message: '#^Cannot access offset ''single_table'' on mixed\.$#'
|
||||
identifier: offsetAccess.nonOffsetAccessible
|
||||
count: 3
|
||||
path: tests/unit/Plugins/Export/ExportSqlTest.php
|
||||
|
||||
-
|
||||
message: '#^Parameter \#2 \$haystack of static method PHPUnit\\Framework\\Assert\:\:assertStringContainsString\(\) expects string, mixed given\.$#'
|
||||
identifier: argument.type
|
||||
@ -22263,12 +22173,6 @@ parameters:
|
||||
count: 1
|
||||
path: tests/unit/Plugins/Export/ExportTexytextTest.php
|
||||
|
||||
-
|
||||
message: '#^Cannot access offset ''single_table'' on mixed\.$#'
|
||||
identifier: offsetAccess.nonOffsetAccessible
|
||||
count: 1
|
||||
path: tests/unit/Plugins/Export/ExportTexytextTest.php
|
||||
|
||||
-
|
||||
message: '''
|
||||
#^Call to deprecated method getInstance\(\) of class PhpMyAdmin\\Config\:
|
||||
@ -22278,12 +22182,6 @@ parameters:
|
||||
count: 2
|
||||
path: tests/unit/Plugins/Export/ExportXmlTest.php
|
||||
|
||||
-
|
||||
message: '#^Cannot access offset ''single_table'' on mixed\.$#'
|
||||
identifier: offsetAccess.nonOffsetAccessible
|
||||
count: 1
|
||||
path: tests/unit/Plugins/Export/ExportXmlTest.php
|
||||
|
||||
-
|
||||
message: '#^Property PhpMyAdmin\\Config\:\:\$selectedServer \(array\{host\: string, port\: string, socket\: string, ssl\: bool, ssl_key\: string\|null, ssl_cert\: string\|null, ssl_ca\: string\|null, ssl_ca_path\: string\|null, \.\.\.\}\) does not accept array\{host\: string, port\: 80, socket\: string, ssl\: bool, ssl_key\: string\|null, ssl_cert\: string\|null, ssl_ca\: string\|null, ssl_ca_path\: string\|null, \.\.\.\}\.$#'
|
||||
identifier: assign.propertyType
|
||||
|
||||
@ -7330,10 +7330,6 @@
|
||||
<PossiblyNullArgument>
|
||||
<code><![CDATA[$record[$columns[$i]]]]></code>
|
||||
</PossiblyNullArgument>
|
||||
<PossiblyNullArrayAccess>
|
||||
<code><![CDATA[$GLOBALS['plugin_param']['export_type']]]></code>
|
||||
<code><![CDATA[$GLOBALS['plugin_param']['single_table']]]></code>
|
||||
</PossiblyNullArrayAccess>
|
||||
<PossiblyNullOperand>
|
||||
<code><![CDATA[$tableAlias]]></code>
|
||||
<code><![CDATA[$tableAlias]]></code>
|
||||
@ -7454,10 +7450,6 @@
|
||||
<code><![CDATA[$tableAlias]]></code>
|
||||
<code><![CDATA[$viewAlias]]></code>
|
||||
</PossiblyNullArgument>
|
||||
<PossiblyNullArrayAccess>
|
||||
<code><![CDATA[$GLOBALS['plugin_param']['export_type']]]></code>
|
||||
<code><![CDATA[$GLOBALS['plugin_param']['single_table']]]></code>
|
||||
</PossiblyNullArrayAccess>
|
||||
<PossiblyUnusedReturnValue>
|
||||
<code><![CDATA[string]]></code>
|
||||
</PossiblyUnusedReturnValue>
|
||||
@ -7606,11 +7598,6 @@
|
||||
<code><![CDATA[$tableAlias]]></code>
|
||||
<code><![CDATA[$tableAlias]]></code>
|
||||
</PossiblyNullArgument>
|
||||
<PossiblyNullArrayAccess>
|
||||
<code><![CDATA[$GLOBALS['plugin_param']['export_type']]]></code>
|
||||
<code><![CDATA[$GLOBALS['plugin_param']['export_type']]]></code>
|
||||
<code><![CDATA[$GLOBALS['plugin_param']['single_table']]]></code>
|
||||
</PossiblyNullArrayAccess>
|
||||
<PossiblyNullArrayOffset>
|
||||
<code><![CDATA[$aliases[$oldDatabase]['tables']]]></code>
|
||||
</PossiblyNullArrayOffset>
|
||||
|
||||
@ -58,7 +58,8 @@ class Plugins
|
||||
*/
|
||||
public static function getPlugin(string $type, string $format, array|string|null $param = null): object|null
|
||||
{
|
||||
$GLOBALS['plugin_param'] = $param;
|
||||
ExportPlugin::$exportType = $param['export_type'] ?? '';
|
||||
ExportPlugin::$singleTable = $param['single_table'] ?? false;
|
||||
$pluginType = mb_strtoupper($type[0]) . mb_strtolower(mb_substr($type, 1));
|
||||
$pluginFormat = mb_strtoupper($format[0]) . mb_strtolower(mb_substr($format, 1));
|
||||
$class = sprintf('PhpMyAdmin\\Plugins\\%s\\%s%s', $pluginType, $pluginType, $pluginFormat);
|
||||
@ -89,7 +90,8 @@ class Plugins
|
||||
*/
|
||||
public static function getExport(string $type, bool $singleTable): array
|
||||
{
|
||||
$GLOBALS['plugin_param'] = ['export_type' => $type, 'single_table' => $singleTable];
|
||||
ExportPlugin::$exportType = $type;
|
||||
ExportPlugin::$singleTable = $singleTable;
|
||||
|
||||
return self::getPlugins('Export');
|
||||
}
|
||||
|
||||
@ -55,10 +55,8 @@ class ExportLatex extends ExportPlugin
|
||||
|
||||
protected function setProperties(): ExportPluginProperties
|
||||
{
|
||||
$GLOBALS['plugin_param'] ??= null;
|
||||
|
||||
$hideStructure = false;
|
||||
if ($GLOBALS['plugin_param']['export_type'] === 'table' && ! $GLOBALS['plugin_param']['single_table']) {
|
||||
if (ExportPlugin::$exportType === 'table' && ! ExportPlugin::$singleTable) {
|
||||
$hideStructure = true;
|
||||
}
|
||||
|
||||
|
||||
@ -45,10 +45,8 @@ class ExportOdt extends ExportPlugin
|
||||
|
||||
protected function setProperties(): ExportPluginProperties
|
||||
{
|
||||
$GLOBALS['plugin_param'] ??= null;
|
||||
|
||||
$hideStructure = false;
|
||||
if ($GLOBALS['plugin_param']['export_type'] === 'table' && ! $GLOBALS['plugin_param']['single_table']) {
|
||||
if (ExportPlugin::$exportType === 'table' && ! ExportPlugin::$singleTable) {
|
||||
$hideStructure = true;
|
||||
}
|
||||
|
||||
|
||||
@ -94,11 +94,9 @@ class ExportSql extends ExportPlugin
|
||||
|
||||
protected function setProperties(): ExportPluginProperties
|
||||
{
|
||||
$GLOBALS['plugin_param'] ??= null;
|
||||
|
||||
$hideSql = false;
|
||||
$hideStructure = false;
|
||||
if ($GLOBALS['plugin_param']['export_type'] === 'table' && ! $GLOBALS['plugin_param']['single_table']) {
|
||||
if (ExportPlugin::$exportType === 'table' && ! ExportPlugin::$singleTable) {
|
||||
$hideStructure = true;
|
||||
$hideSql = true;
|
||||
}
|
||||
@ -243,7 +241,7 @@ class ExportSql extends ExportPlugin
|
||||
$subgroup->setSubgroupHeader($leaf);
|
||||
|
||||
// server export options
|
||||
if ($GLOBALS['plugin_param']['export_type'] === 'server') {
|
||||
if (ExportPlugin::$exportType === 'server') {
|
||||
$leaf = new BoolPropertyItem(
|
||||
'drop_database',
|
||||
sprintf(__('Add %s statement'), '<code>DROP DATABASE IF EXISTS</code>'),
|
||||
@ -251,7 +249,7 @@ class ExportSql extends ExportPlugin
|
||||
$subgroup->addProperty($leaf);
|
||||
}
|
||||
|
||||
if ($GLOBALS['plugin_param']['export_type'] === 'database') {
|
||||
if (ExportPlugin::$exportType === 'database') {
|
||||
$createClause = '<code>CREATE DATABASE / USE</code>';
|
||||
$leaf = new BoolPropertyItem(
|
||||
'create_database',
|
||||
@ -260,7 +258,7 @@ class ExportSql extends ExportPlugin
|
||||
$subgroup->addProperty($leaf);
|
||||
}
|
||||
|
||||
if ($GLOBALS['plugin_param']['export_type'] === 'table') {
|
||||
if (ExportPlugin::$exportType === 'table') {
|
||||
$dropClause = $dbi->getTable(Current::$database, Current::$table)->isView()
|
||||
? '<code>DROP VIEW</code>'
|
||||
: '<code>DROP TABLE</code>';
|
||||
|
||||
@ -28,6 +28,9 @@ abstract class ExportPlugin implements Plugin
|
||||
*/
|
||||
protected ExportPluginProperties $properties;
|
||||
|
||||
public static string $exportType = '';
|
||||
public static bool $singleTable = false;
|
||||
|
||||
final public function __construct(
|
||||
public Relation $relation,
|
||||
protected Export $export,
|
||||
|
||||
@ -96,7 +96,6 @@ class ExportTest extends AbstractTestCase
|
||||
|
||||
public function testExportDatabase(): void
|
||||
{
|
||||
$GLOBALS['plugin_param'] = ['export_type' => 'database', 'single_table' => false];
|
||||
$GLOBALS['sql_create_view'] = 'something';
|
||||
$GLOBALS['output_kanji_conversion'] = false;
|
||||
$GLOBALS['buffer_needed'] = false;
|
||||
@ -163,7 +162,6 @@ SQL;
|
||||
|
||||
public function testExportServer(): void
|
||||
{
|
||||
$GLOBALS['plugin_param'] = ['export_type' => 'server', 'single_table' => false];
|
||||
$GLOBALS['output_kanji_conversion'] = false;
|
||||
$GLOBALS['buffer_needed'] = false;
|
||||
$GLOBALS['asfile'] = false;
|
||||
|
||||
@ -12,6 +12,7 @@ use PhpMyAdmin\Current;
|
||||
use PhpMyAdmin\DatabaseInterface;
|
||||
use PhpMyAdmin\Export\Export;
|
||||
use PhpMyAdmin\Plugins\Export\ExportLatex;
|
||||
use PhpMyAdmin\Plugins\ExportPlugin;
|
||||
use PhpMyAdmin\Properties\Options\Groups\OptionsPropertyMainGroup;
|
||||
use PhpMyAdmin\Properties\Options\Groups\OptionsPropertyRootGroup;
|
||||
use PhpMyAdmin\Properties\Options\Items\BoolPropertyItem;
|
||||
@ -50,9 +51,8 @@ class ExportLatexTest extends AbstractTestCase
|
||||
$GLOBALS['buffer_needed'] = false;
|
||||
$GLOBALS['asfile'] = true;
|
||||
$GLOBALS['save_on_server'] = false;
|
||||
$GLOBALS['plugin_param'] = [];
|
||||
$GLOBALS['plugin_param']['export_type'] = 'table';
|
||||
$GLOBALS['plugin_param']['single_table'] = false;
|
||||
ExportPlugin::$exportType = 'table';
|
||||
ExportPlugin::$singleTable = false;
|
||||
Current::$database = 'db';
|
||||
Current::$table = 'table';
|
||||
$this->object = new ExportLatex(
|
||||
@ -75,8 +75,8 @@ class ExportLatexTest extends AbstractTestCase
|
||||
|
||||
public function testSetProperties(): void
|
||||
{
|
||||
$GLOBALS['plugin_param']['export_type'] = '';
|
||||
$GLOBALS['plugin_param']['single_table'] = false;
|
||||
ExportPlugin::$exportType = '';
|
||||
ExportPlugin::$singleTable = false;
|
||||
|
||||
$relationParameters = RelationParameters::fromArray([
|
||||
'db' => 'db',
|
||||
@ -419,8 +419,8 @@ class ExportLatexTest extends AbstractTestCase
|
||||
);
|
||||
|
||||
// case 2
|
||||
$GLOBALS['plugin_param']['export_type'] = 'table';
|
||||
$GLOBALS['plugin_param']['single_table'] = false;
|
||||
ExportPlugin::$exportType = 'table';
|
||||
ExportPlugin::$singleTable = false;
|
||||
|
||||
$method->invoke($this->object, null);
|
||||
|
||||
|
||||
@ -14,6 +14,7 @@ use PhpMyAdmin\Export\Export;
|
||||
use PhpMyAdmin\Identifiers\TableName;
|
||||
use PhpMyAdmin\Identifiers\TriggerName;
|
||||
use PhpMyAdmin\Plugins\Export\ExportOdt;
|
||||
use PhpMyAdmin\Plugins\ExportPlugin;
|
||||
use PhpMyAdmin\Properties\Options\Groups\OptionsPropertyMainGroup;
|
||||
use PhpMyAdmin\Properties\Options\Groups\OptionsPropertyRootGroup;
|
||||
use PhpMyAdmin\Properties\Options\Items\BoolPropertyItem;
|
||||
@ -69,9 +70,8 @@ class ExportOdtTest extends AbstractTestCase
|
||||
$GLOBALS['buffer_needed'] = false;
|
||||
$GLOBALS['asfile'] = true;
|
||||
$GLOBALS['save_on_server'] = false;
|
||||
$GLOBALS['plugin_param'] = [];
|
||||
$GLOBALS['plugin_param']['export_type'] = 'table';
|
||||
$GLOBALS['plugin_param']['single_table'] = false;
|
||||
ExportPlugin::$exportType = 'table';
|
||||
ExportPlugin::$singleTable = false;
|
||||
Config::getInstance()->selectedServer['DisableIS'] = true;
|
||||
$this->object = new ExportOdt(
|
||||
new Relation($this->dbi),
|
||||
@ -93,8 +93,8 @@ class ExportOdtTest extends AbstractTestCase
|
||||
|
||||
public function testSetProperties(): void
|
||||
{
|
||||
$GLOBALS['plugin_param']['export_type'] = '';
|
||||
$GLOBALS['plugin_param']['single_table'] = false;
|
||||
ExportPlugin::$exportType = '';
|
||||
ExportPlugin::$singleTable = false;
|
||||
|
||||
$relationParameters = RelationParameters::fromArray([
|
||||
'db' => 'db',
|
||||
@ -294,8 +294,8 @@ class ExportOdtTest extends AbstractTestCase
|
||||
);
|
||||
|
||||
// case 2
|
||||
$GLOBALS['plugin_param']['export_type'] = 'table';
|
||||
$GLOBALS['plugin_param']['single_table'] = false;
|
||||
ExportPlugin::$exportType = 'table';
|
||||
ExportPlugin::$singleTable = false;
|
||||
|
||||
$method->invoke($this->object, null);
|
||||
|
||||
|
||||
@ -13,6 +13,7 @@ use PhpMyAdmin\DatabaseInterface;
|
||||
use PhpMyAdmin\Dbal\ConnectionType;
|
||||
use PhpMyAdmin\Export\Export;
|
||||
use PhpMyAdmin\Plugins\Export\ExportSql;
|
||||
use PhpMyAdmin\Plugins\ExportPlugin;
|
||||
use PhpMyAdmin\Properties\Options\Groups\OptionsPropertyMainGroup;
|
||||
use PhpMyAdmin\Properties\Options\Groups\OptionsPropertyRootGroup;
|
||||
use PhpMyAdmin\Properties\Options\Groups\OptionsPropertySubgroup;
|
||||
@ -67,9 +68,8 @@ class ExportSqlTest extends AbstractTestCase
|
||||
$GLOBALS['buffer_needed'] = false;
|
||||
$GLOBALS['asfile'] = false;
|
||||
$GLOBALS['save_on_server'] = false;
|
||||
$GLOBALS['plugin_param'] = [];
|
||||
$GLOBALS['plugin_param']['export_type'] = 'table';
|
||||
$GLOBALS['plugin_param']['single_table'] = false;
|
||||
ExportPlugin::$exportType = 'table';
|
||||
ExportPlugin::$singleTable = false;
|
||||
|
||||
$this->object = new ExportSql(
|
||||
new Relation($dbi),
|
||||
@ -93,8 +93,8 @@ class ExportSqlTest extends AbstractTestCase
|
||||
public function testSetPropertiesWithHideSql(): void
|
||||
{
|
||||
// test with hide structure and hide sql as true
|
||||
$GLOBALS['plugin_param']['export_type'] = 'table';
|
||||
$GLOBALS['plugin_param']['single_table'] = false;
|
||||
ExportPlugin::$exportType = 'table';
|
||||
ExportPlugin::$singleTable = false;
|
||||
|
||||
$method = new ReflectionMethod(ExportSql::class, 'setProperties');
|
||||
$properties = $method->invoke($this->object, null);
|
||||
@ -116,8 +116,8 @@ class ExportSqlTest extends AbstractTestCase
|
||||
->willReturn(['v1', 'v2']);
|
||||
|
||||
DatabaseInterface::$instance = $dbi;
|
||||
$GLOBALS['plugin_param']['export_type'] = 'server';
|
||||
$GLOBALS['plugin_param']['single_table'] = false;
|
||||
ExportPlugin::$exportType = 'server';
|
||||
ExportPlugin::$singleTable = false;
|
||||
|
||||
$relationParameters = RelationParameters::fromArray([
|
||||
'db' => 'db',
|
||||
|
||||
@ -16,6 +16,7 @@ use PhpMyAdmin\Export\Export;
|
||||
use PhpMyAdmin\Identifiers\TableName;
|
||||
use PhpMyAdmin\Identifiers\TriggerName;
|
||||
use PhpMyAdmin\Plugins\Export\ExportTexytext;
|
||||
use PhpMyAdmin\Plugins\ExportPlugin;
|
||||
use PhpMyAdmin\Properties\Options\Groups\OptionsPropertyMainGroup;
|
||||
use PhpMyAdmin\Properties\Options\Groups\OptionsPropertyRootGroup;
|
||||
use PhpMyAdmin\Properties\Options\Items\BoolPropertyItem;
|
||||
@ -60,9 +61,8 @@ class ExportTexytextTest extends AbstractTestCase
|
||||
$GLOBALS['buffer_needed'] = false;
|
||||
$GLOBALS['asfile'] = false;
|
||||
$GLOBALS['save_on_server'] = false;
|
||||
$GLOBALS['plugin_param'] = [];
|
||||
$GLOBALS['plugin_param']['export_type'] = 'table';
|
||||
$GLOBALS['plugin_param']['single_table'] = false;
|
||||
ExportPlugin::$exportType = 'table';
|
||||
ExportPlugin::$singleTable = false;
|
||||
Current::$database = '';
|
||||
Current::$table = '';
|
||||
$GLOBALS['lang'] = 'en';
|
||||
|
||||
@ -10,6 +10,7 @@ use PhpMyAdmin\Current;
|
||||
use PhpMyAdmin\DatabaseInterface;
|
||||
use PhpMyAdmin\Export\Export;
|
||||
use PhpMyAdmin\Plugins\Export\ExportXml;
|
||||
use PhpMyAdmin\Plugins\ExportPlugin;
|
||||
use PhpMyAdmin\Properties\Options\Groups\OptionsPropertyMainGroup;
|
||||
use PhpMyAdmin\Properties\Options\Groups\OptionsPropertyRootGroup;
|
||||
use PhpMyAdmin\Properties\Options\Items\BoolPropertyItem;
|
||||
@ -45,9 +46,8 @@ class ExportXmlTest extends AbstractTestCase
|
||||
$GLOBALS['buffer_needed'] = false;
|
||||
$GLOBALS['asfile'] = false;
|
||||
$GLOBALS['save_on_server'] = false;
|
||||
$GLOBALS['plugin_param'] = [];
|
||||
$GLOBALS['plugin_param']['export_type'] = 'table';
|
||||
$GLOBALS['plugin_param']['single_table'] = false;
|
||||
ExportPlugin::$exportType = 'table';
|
||||
ExportPlugin::$singleTable = false;
|
||||
Current::$database = 'db';
|
||||
Config::getInstance()->selectedServer['DisableIS'] = true;
|
||||
$this->object = new ExportXml(
|
||||
|
||||
@ -10,6 +10,7 @@ use PhpMyAdmin\DatabaseInterface;
|
||||
use PhpMyAdmin\Export\Export;
|
||||
use PhpMyAdmin\Import\ImportSettings;
|
||||
use PhpMyAdmin\Plugins;
|
||||
use PhpMyAdmin\Plugins\ExportPlugin;
|
||||
use PhpMyAdmin\Transformations;
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
use PHPUnit\Framework\Attributes\DataProvider;
|
||||
@ -27,7 +28,8 @@ class PluginsTest extends AbstractTestCase
|
||||
public function testGetExport(): void
|
||||
{
|
||||
$plugins = Plugins::getExport('database', false);
|
||||
self::assertSame(['export_type' => 'database', 'single_table' => false], $GLOBALS['plugin_param']);
|
||||
self::assertSame('database', ExportPlugin::$exportType);
|
||||
self::assertFalse(ExportPlugin::$singleTable);
|
||||
self::assertCount(14, $plugins);
|
||||
self::assertContainsOnlyInstancesOf(Plugins\ExportPlugin::class, $plugins);
|
||||
}
|
||||
@ -98,7 +100,6 @@ class PluginsTest extends AbstractTestCase
|
||||
|
||||
public function testGetChoice(): void
|
||||
{
|
||||
$GLOBALS['plugin_param'] = ['export_type' => 'database', 'single_table' => false];
|
||||
$dbi = DatabaseInterface::getInstance();
|
||||
$exportList = [
|
||||
new Plugins\Export\ExportJson(
|
||||
|
||||
Loading…
Reference in New Issue
Block a user