Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
fc6ccf2561
@ -28,6 +28,8 @@ class PageSettingsTest extends PmaTestCase
|
||||
$GLOBALS['PMA_Config'] = new Config();
|
||||
$GLOBALS['server'] = 1;
|
||||
$GLOBALS['db'] = 'db';
|
||||
$GLOBALS['table'] = '';
|
||||
$GLOBALS['PMA_PHP_SELF'] = 'index.php';
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -46,6 +46,7 @@ class DatabaseStructureControllerTest extends PmaTestCase
|
||||
$GLOBALS['cfg']['Server']['DisableIS'] = false;
|
||||
$GLOBALS['table'] = "table";
|
||||
$GLOBALS['db'] = 'db';
|
||||
$GLOBALS['PMA_PHP_SELF'] = 'index.php';
|
||||
|
||||
//$_SESSION
|
||||
|
||||
|
||||
@ -10,6 +10,7 @@ namespace PhpMyAdmin\Tests\Controllers\Server;
|
||||
use PhpMyAdmin\Controllers\Server\ServerBinlogController;
|
||||
use PhpMyAdmin\Di\Container;
|
||||
use PhpMyAdmin\Tests\PmaTestCase;
|
||||
use PhpMyAdmin\Tests\Stubs\Response as ResponseStub;
|
||||
use PhpMyAdmin\Theme;
|
||||
use PhpMyAdmin\Util;
|
||||
use ReflectionClass;
|
||||
@ -43,8 +44,10 @@ class ServerBinlogControllerTest extends PmaTestCase
|
||||
$GLOBALS['cfg']['TableNavigationLinksMode'] = 'icons';
|
||||
$GLOBALS['cfg']['LimitChars'] = 100;
|
||||
|
||||
$GLOBALS['db'] = 'db';
|
||||
$GLOBALS['table'] = "table";
|
||||
$GLOBALS['pmaThemeImage'] = 'image';
|
||||
$GLOBALS['PMA_PHP_SELF'] = 'index.php';
|
||||
|
||||
//$_SESSION
|
||||
|
||||
@ -62,6 +65,9 @@ class ServerBinlogControllerTest extends PmaTestCase
|
||||
->will($this->returnValue($binary_log_file_names));
|
||||
$container = Container::getDefaultContainer();
|
||||
$container->set('dbi', $dbi);
|
||||
$this->_response = new ResponseStub();
|
||||
$container->set('PhpMyAdmin\Response', $this->_response);
|
||||
$container->alias('response', 'PhpMyAdmin\Response');
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -11,25 +11,10 @@ use PhpMyAdmin\Controllers\Server\ServerCollationsController;
|
||||
use PhpMyAdmin\Core;
|
||||
use PhpMyAdmin\Di\Container;
|
||||
use PhpMyAdmin\Tests\PmaTestCase;
|
||||
use PhpMyAdmin\Tests\Stubs\Response as ResponseStub;
|
||||
use PhpMyAdmin\Theme;
|
||||
use ReflectionClass;
|
||||
|
||||
/*
|
||||
* Include to test.
|
||||
*/
|
||||
//$GLOBALS
|
||||
$GLOBALS['server'] = 1;
|
||||
$GLOBALS['cfg']['ServerDefault'] = 1;
|
||||
$GLOBALS['url_query'] = "url_query";
|
||||
$GLOBALS['PMA_PHP_SELF'] = Core::getenv('PHP_SELF');
|
||||
$GLOBALS['lang'] = "en";
|
||||
$GLOBALS['text_dir'] = "text_dir";
|
||||
$GLOBALS['cfg']['Server'] = array(
|
||||
'DisableIS' => false
|
||||
);
|
||||
|
||||
require_once 'libraries/server_common.inc.php';
|
||||
|
||||
/**
|
||||
* Tests for ServerCollationsController class
|
||||
*
|
||||
@ -45,11 +30,14 @@ class ServerCollationsControllerTest extends PmaTestCase
|
||||
public function setUp()
|
||||
{
|
||||
//$_REQUEST
|
||||
$_REQUEST['log'] = "index1";
|
||||
$_REQUEST['log'] = 'index1';
|
||||
$_REQUEST['pos'] = 3;
|
||||
|
||||
//$GLOBALS
|
||||
$GLOBALS['table'] = "table";
|
||||
$GLOBALS['server'] = 1;
|
||||
$GLOBALS['db'] = 'db';
|
||||
$GLOBALS['table'] = 'table';
|
||||
$GLOBALS['PMA_PHP_SELF'] = 'index.php';
|
||||
}
|
||||
|
||||
/**
|
||||
@ -86,6 +74,8 @@ class ServerCollationsControllerTest extends PmaTestCase
|
||||
);
|
||||
|
||||
$container = Container::getDefaultContainer();
|
||||
$container->set('PhpMyAdmin\Response', new ResponseStub());
|
||||
$container->alias('response', 'PhpMyAdmin\Response');
|
||||
|
||||
$class = new ReflectionClass('\PhpMyAdmin\Controllers\Server\ServerCollationsController');
|
||||
$method = $class->getMethod('_getHtmlForCharsets');
|
||||
|
||||
@ -19,7 +19,6 @@ use ReflectionClass;
|
||||
*
|
||||
* @package PhpMyAdmin-test
|
||||
*/
|
||||
|
||||
class ServerDatabasesControllerTest extends PmaTestCase
|
||||
{
|
||||
/**
|
||||
@ -37,11 +36,14 @@ class ServerDatabasesControllerTest extends PmaTestCase
|
||||
$GLOBALS['PMA_Config'] = new Config();
|
||||
$GLOBALS['PMA_Config']->enableBc();
|
||||
|
||||
$GLOBALS['db'] = 'db';
|
||||
$GLOBALS['table'] = "table";
|
||||
$GLOBALS['replication_info']['master']['status'] = false;
|
||||
$GLOBALS['replication_info']['slave']['status'] = false;
|
||||
$GLOBALS['pmaThemeImage'] = 'image';
|
||||
$GLOBALS['text_dir'] = "text_dir";
|
||||
$GLOBALS['PMA_PHP_SELF'] = 'index.php';
|
||||
$GLOBALS['cfg']['Server']['DisableIS'] = false;
|
||||
|
||||
//$_SESSION
|
||||
$GLOBALS['server'] = 1;
|
||||
|
||||
@ -11,6 +11,7 @@ use PhpMyAdmin\Controllers\Server\ServerEnginesController;
|
||||
use PhpMyAdmin\Di\Container;
|
||||
use PhpMyAdmin\StorageEngine;
|
||||
use PhpMyAdmin\Tests\PmaTestCase;
|
||||
use PhpMyAdmin\Tests\Stubs\Response as ResponseStub;
|
||||
use PhpMyAdmin\Theme;
|
||||
use PhpMyAdmin\Url;
|
||||
use PhpMyAdmin\Util;
|
||||
@ -23,6 +24,11 @@ use ReflectionClass;
|
||||
*/
|
||||
class ServerEnginesControllerTest extends PmaTestCase
|
||||
{
|
||||
/**
|
||||
* @var \PhpMyAdmin\Di\Container
|
||||
*/
|
||||
private $container;
|
||||
|
||||
/**
|
||||
* Prepares environment for the test.
|
||||
*
|
||||
@ -36,9 +42,13 @@ class ServerEnginesControllerTest extends PmaTestCase
|
||||
|
||||
//$GLOBALS
|
||||
$GLOBALS['server'] = 0;
|
||||
$GLOBALS['table'] = "table";
|
||||
$GLOBALS['db'] = 'db';
|
||||
$GLOBALS['table'] = 'table';
|
||||
$GLOBALS['PMA_PHP_SELF'] = 'index.php';
|
||||
|
||||
//$_SESSION
|
||||
$this->container = Container::getDefaultContainer();
|
||||
$this->container->set('PhpMyAdmin\Response', new ResponseStub());
|
||||
$this->container->alias('response', 'PhpMyAdmin\Response');
|
||||
}
|
||||
|
||||
/**
|
||||
@ -52,11 +62,9 @@ class ServerEnginesControllerTest extends PmaTestCase
|
||||
$method = $class->getMethod('_getHtmlForAllServerEngines');
|
||||
$method->setAccessible(true);
|
||||
|
||||
$container = Container::getDefaultContainer();
|
||||
|
||||
$ctrl = new ServerEnginesController(
|
||||
$container->get('response'),
|
||||
$container->get('dbi')
|
||||
$this->container->get('response'),
|
||||
$this->container->get('dbi')
|
||||
);
|
||||
$html = $method->invoke($ctrl);
|
||||
|
||||
@ -118,12 +126,10 @@ class ServerEnginesControllerTest extends PmaTestCase
|
||||
$method = $class->getMethod('_getHtmlForServerEngine');
|
||||
$method->setAccessible(true);
|
||||
|
||||
$container = Container::getDefaultContainer();
|
||||
|
||||
$engine_plugin = StorageEngine::getEngine("Pbxt");
|
||||
$ctrl = new ServerEnginesController(
|
||||
$container->get('response'),
|
||||
$container->get('dbi')
|
||||
$this->container->get('response'),
|
||||
$this->container->get('dbi')
|
||||
);
|
||||
$html = $method->invoke($ctrl, $engine_plugin);
|
||||
|
||||
|
||||
@ -10,6 +10,7 @@ namespace PhpMyAdmin\Tests\Controllers\Server;
|
||||
use PhpMyAdmin\Controllers\Server\ServerPluginsController;
|
||||
use PhpMyAdmin\Di\Container;
|
||||
use PhpMyAdmin\Tests\PmaTestCase;
|
||||
use PhpMyAdmin\Tests\Stubs\Response as ResponseStub;
|
||||
use PhpMyAdmin\Theme;
|
||||
use ReflectionClass;
|
||||
|
||||
@ -32,9 +33,10 @@ class ServerPluginsControllerTest extends PmaTestCase
|
||||
$_REQUEST['pos'] = 3;
|
||||
|
||||
//$GLOBALS
|
||||
$GLOBALS['table'] = "table";
|
||||
|
||||
//$_SESSION
|
||||
$GLOBALS['server'] = 0;
|
||||
$GLOBALS['db'] = 'db';
|
||||
$GLOBALS['table'] = 'table';
|
||||
$GLOBALS['PMA_PHP_SELF'] = 'index.php';
|
||||
}
|
||||
|
||||
/**
|
||||
@ -75,6 +77,8 @@ class ServerPluginsControllerTest extends PmaTestCase
|
||||
->will($this->returnValue(true));
|
||||
|
||||
$container = Container::getDefaultContainer();
|
||||
$container->set('PhpMyAdmin\Response', new ResponseStub());
|
||||
$container->alias('response', 'PhpMyAdmin\Response');
|
||||
$container->set('dbi', $dbi);
|
||||
|
||||
$class = new ReflectionClass('\PhpMyAdmin\Controllers\Server\ServerPluginsController');
|
||||
|
||||
@ -42,7 +42,8 @@ class ServerVariablesControllerTest extends PmaTestCase
|
||||
//$GLOBALS
|
||||
$GLOBALS['PMA_PHP_SELF'] = Core::getenv('PHP_SELF');
|
||||
$GLOBALS['server'] = 1;
|
||||
$GLOBALS['table'] = "table";
|
||||
$GLOBALS['db'] = 'db';
|
||||
$GLOBALS['table'] = 'table';
|
||||
|
||||
//$_SESSION
|
||||
|
||||
|
||||
@ -36,12 +36,14 @@ class TableIndexesControllerTest extends PmaTestCase
|
||||
* SET these to avoid undefined index error
|
||||
*/
|
||||
$GLOBALS['server'] = 1;
|
||||
$GLOBALS['db'] = 'db';
|
||||
$GLOBALS['table'] = 'table';
|
||||
$GLOBALS['PMA_PHP_SELF'] = 'index.php';
|
||||
$GLOBALS['cfg']['Server']['pmadb'] = '';
|
||||
$GLOBALS['url_params'] = array(
|
||||
'db' => 'db',
|
||||
'server' => 1
|
||||
);
|
||||
$GLOBALS['db'] = 'db';
|
||||
|
||||
$dbi = $this->getMockBuilder('PhpMyAdmin\DatabaseInterface')
|
||||
->disableOriginalConstructor()
|
||||
|
||||
@ -31,6 +31,9 @@ class TableRelationControllerTest extends PmaTestCase
|
||||
protected function setUp()
|
||||
{
|
||||
$GLOBALS['server'] = 0;
|
||||
$GLOBALS['db'] = 'db';
|
||||
$GLOBALS['table'] = 'table';
|
||||
$GLOBALS['PMA_PHP_SELF'] = 'index.php';
|
||||
//$_SESSION
|
||||
|
||||
$_REQUEST['foreignDb'] = 'db';
|
||||
@ -39,9 +42,28 @@ class TableRelationControllerTest extends PmaTestCase
|
||||
$GLOBALS['dblist'] = new DataBasePMAMockForTblRelation();
|
||||
$GLOBALS['dblist']->databases = new DataBaseMockForTblRelation();
|
||||
|
||||
$indexes = array(
|
||||
array(
|
||||
'Schema' => 'Schema1',
|
||||
'Key_name' => 'Key_name1',
|
||||
'Column_name' => 'Column_name1',
|
||||
),
|
||||
array(
|
||||
'Schema' => 'Schema2',
|
||||
'Key_name' => 'Key_name2',
|
||||
'Column_name' => 'Column_name2',
|
||||
),
|
||||
array(
|
||||
'Schema' => 'Schema3',
|
||||
'Key_name' => 'Key_name3',
|
||||
'Column_name' => 'Column_name3',
|
||||
),
|
||||
);
|
||||
$dbi = $this->getMockBuilder('PhpMyAdmin\DatabaseInterface')
|
||||
->disableOriginalConstructor()
|
||||
->getMock();
|
||||
$dbi->expects($this->any())->method('getTableIndexes')
|
||||
->will($this->returnValue($indexes));
|
||||
|
||||
$GLOBALS['dbi'] = $dbi;
|
||||
|
||||
|
||||
@ -42,6 +42,8 @@ class TableSearchControllerTest extends PmaTestCase
|
||||
$_POST['zoom_submit'] = 'zoom';
|
||||
|
||||
$GLOBALS['server'] = 1;
|
||||
$GLOBALS['db'] = 'db';
|
||||
$GLOBALS['table'] = 'table';
|
||||
$GLOBALS['PMA_PHP_SELF'] = 'index.php';
|
||||
$GLOBALS['cfgRelation'] = Relation::getRelationsParam();
|
||||
$GLOBALS['cfg']['Server']['DisableIS'] = false;
|
||||
|
||||
@ -42,11 +42,10 @@ class TableStructureControllerTest extends PmaTestCase
|
||||
|
||||
//$GLOBALS
|
||||
$GLOBALS['server'] = 1;
|
||||
$GLOBALS['db'] = 'db';
|
||||
$GLOBALS['table'] = 'table';
|
||||
$GLOBALS['cfg']['Server']['DisableIS'] = false;
|
||||
|
||||
$GLOBALS['table'] = "table";
|
||||
|
||||
//$_SESSION
|
||||
$GLOBALS['PMA_PHP_SELF'] = 'index.php';
|
||||
|
||||
$table = $this->getMockBuilder('PhpMyAdmin\Table')
|
||||
->disableOriginalConstructor()
|
||||
|
||||
@ -48,6 +48,7 @@ class ExportTest extends TestCase
|
||||
$GLOBALS['cfg']['BZipDump'] = false;
|
||||
$GLOBALS['cfg']['Export']['asfile'] = true;
|
||||
$GLOBALS['cfg']['Export']['file_template_server'] = "file_template_server";
|
||||
$GLOBALS['cfg']['AvailableCharsets'] = [];
|
||||
$GLOBALS['PMA_PHP_SELF'] = Core::getenv('PHP_SELF');
|
||||
$GLOBALS['PMA_recoding_engine'] = "InnerDB";
|
||||
$GLOBALS['server'] = 0;
|
||||
|
||||
@ -39,6 +39,9 @@ class ResultsTest extends PmaTestCase
|
||||
protected function setUp()
|
||||
{
|
||||
$GLOBALS['server'] = 0;
|
||||
$GLOBALS['db'] = 'db';
|
||||
$GLOBALS['table'] = 'table';
|
||||
$GLOBALS['PMA_PHP_SELF'] = 'index.php';
|
||||
$this->object = new DisplayResults('as', '', '', '');
|
||||
$GLOBALS['PMA_Config'] = new Config();
|
||||
$GLOBALS['PMA_Config']->enableBc();
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/* vim: set expandtab sw=4 ts=4 sts=4: */
|
||||
/**
|
||||
* Abstract parent class for all PMA_GIS_<Geom_type> test classes
|
||||
* Abstract parent class for all Gis<Geom_type> test classes
|
||||
*
|
||||
* @package PhpMyAdmin-test
|
||||
*/
|
||||
@ -10,13 +10,12 @@ namespace PhpMyAdmin\Tests\Gis;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
/**
|
||||
* Abstract parent class for all GIS<Geom_type> test classes
|
||||
* Abstract parent class for all Gis<Geom_type> test classes
|
||||
*
|
||||
* @package PhpMyAdmin-test
|
||||
*/
|
||||
abstract class GisGeomTest extends TestCase
|
||||
abstract class GisGeomTestCase extends TestCase
|
||||
{
|
||||
|
||||
/**
|
||||
* test generateParams method
|
||||
*
|
||||
@ -8,7 +8,7 @@
|
||||
namespace PhpMyAdmin\Tests\Gis;
|
||||
|
||||
use PhpMyAdmin\Gis\GisLineString;
|
||||
use PhpMyAdmin\Tests\Gis\GisGeomTest;
|
||||
use PhpMyAdmin\Tests\Gis\GisGeomTestCase;
|
||||
use TCPDF;
|
||||
|
||||
/**
|
||||
@ -16,7 +16,7 @@ use TCPDF;
|
||||
*
|
||||
* @package PhpMyAdmin-test
|
||||
*/
|
||||
class GisLineStringTest extends GisGeomTest
|
||||
class GisLineStringTest extends GisGeomTestCase
|
||||
{
|
||||
/**
|
||||
* @var GisLineString
|
||||
|
||||
@ -8,7 +8,7 @@
|
||||
namespace PhpMyAdmin\Tests\Gis;
|
||||
|
||||
use PhpMyAdmin\Gis\GisMultiLineString;
|
||||
use PhpMyAdmin\Tests\Gis\GisGeomTest;
|
||||
use PhpMyAdmin\Tests\Gis\GisGeomTestCase;
|
||||
use TCPDF;
|
||||
|
||||
/**
|
||||
@ -16,7 +16,7 @@ use TCPDF;
|
||||
*
|
||||
* @package PhpMyAdmin-test
|
||||
*/
|
||||
class GisMultiLineStringTest extends GisGeomTest
|
||||
class GisMultiLineStringTest extends GisGeomTestCase
|
||||
{
|
||||
/**
|
||||
* @var GisMultiLineString
|
||||
|
||||
@ -8,7 +8,7 @@
|
||||
namespace PhpMyAdmin\Tests\Gis;
|
||||
|
||||
use PhpMyAdmin\Gis\GisMultiPoint;
|
||||
use PhpMyAdmin\Tests\Gis\GisGeomTest;
|
||||
use PhpMyAdmin\Tests\Gis\GisGeomTestCase;
|
||||
use TCPDF;
|
||||
|
||||
/**
|
||||
@ -16,7 +16,7 @@ use TCPDF;
|
||||
*
|
||||
* @package PhpMyAdmin-test
|
||||
*/
|
||||
class GisMultiPointTest extends GisGeomTest
|
||||
class GisMultiPointTest extends GisGeomTestCase
|
||||
{
|
||||
/**
|
||||
* @var GisMultiPoint
|
||||
|
||||
@ -8,7 +8,7 @@
|
||||
namespace PhpMyAdmin\Tests\Gis;
|
||||
|
||||
use PhpMyAdmin\Gis\GisMultiPolygon;
|
||||
use PhpMyAdmin\Tests\Gis\GisGeomTest;
|
||||
use PhpMyAdmin\Tests\Gis\GisGeomTestCase;
|
||||
use TCPDF;
|
||||
|
||||
/**
|
||||
@ -16,7 +16,7 @@ use TCPDF;
|
||||
*
|
||||
* @package PhpMyAdmin-test
|
||||
*/
|
||||
class GisMultiPolygonTest extends GisGeomTest
|
||||
class GisMultiPolygonTest extends GisGeomTestCase
|
||||
{
|
||||
/**
|
||||
* @var GisMultiPolygon
|
||||
|
||||
@ -8,7 +8,7 @@
|
||||
namespace PhpMyAdmin\Tests\Gis;
|
||||
|
||||
use PhpMyAdmin\Gis\GisPoint;
|
||||
use PhpMyAdmin\Tests\Gis\GisGeomTest;
|
||||
use PhpMyAdmin\Tests\Gis\GisGeomTestCase;
|
||||
use TCPDF;
|
||||
|
||||
/**
|
||||
@ -16,7 +16,7 @@ use TCPDF;
|
||||
*
|
||||
* @package PhpMyAdmin-test
|
||||
*/
|
||||
class GisPointTest extends GisGeomTest
|
||||
class GisPointTest extends GisGeomTestCase
|
||||
{
|
||||
/**
|
||||
* @var GisPoint
|
||||
|
||||
@ -8,7 +8,7 @@
|
||||
namespace PhpMyAdmin\Tests\Gis;
|
||||
|
||||
use PhpMyAdmin\Gis\GisPolygon;
|
||||
use PhpMyAdmin\Tests\Gis\GisGeomTest;
|
||||
use PhpMyAdmin\Tests\Gis\GisGeomTestCase;
|
||||
use TCPDF;
|
||||
|
||||
/**
|
||||
@ -16,7 +16,7 @@ use TCPDF;
|
||||
*
|
||||
* @package PhpMyAdmin-test
|
||||
*/
|
||||
class GisPolygonTest extends GisGeomTest
|
||||
class GisPolygonTest extends GisGeomTestCase
|
||||
{
|
||||
/**
|
||||
* @var GisPolygon
|
||||
|
||||
@ -40,6 +40,7 @@ class ExportLatexTest extends PmaTestCase
|
||||
$GLOBALS['plugin_param']['single_table'] = false;
|
||||
$GLOBALS['cfgRelation']['relation'] = true;
|
||||
$GLOBALS['db'] = 'db';
|
||||
$GLOBALS['table'] = 'table';
|
||||
$this->object = new ExportLatex();
|
||||
}
|
||||
|
||||
|
||||
@ -27,6 +27,7 @@ class UsersTest extends TestCase
|
||||
public function testGetHtmlForSubMenusOnUsersPage()
|
||||
{
|
||||
$GLOBALS['server'] = 1;
|
||||
$GLOBALS['cfg']['Server']['DisableIS'] = false;
|
||||
$html = Users::getHtmlForSubMenusOnUsersPage('server_privileges.php');
|
||||
|
||||
//validate 1: topmenu2
|
||||
|
||||
Loading…
Reference in New Issue
Block a user