Fix phpcs errors
Signed-off-by: Maurício Meneghini Fauth <mauriciofauth@gmail.com>
This commit is contained in:
parent
01910f5474
commit
baf0985e5f
@ -63,6 +63,12 @@ class Bookmark
|
||||
*/
|
||||
private $user;
|
||||
|
||||
/**
|
||||
* Bookmark constructor.
|
||||
*
|
||||
* @param DatabaseInterface $dbi DatabaseInterface object
|
||||
* @param string $user Current user
|
||||
*/
|
||||
public function __construct(DatabaseInterface $dbi, string $user)
|
||||
{
|
||||
$this->dbi = $dbi;
|
||||
@ -209,6 +215,8 @@ class Bookmark
|
||||
/**
|
||||
* Defines the bookmark parameters for the current user
|
||||
*
|
||||
* @param string $user Current user
|
||||
*
|
||||
* @return array|bool the bookmark parameters for the current user
|
||||
* @access public
|
||||
*/
|
||||
@ -238,10 +246,12 @@ class Bookmark
|
||||
/**
|
||||
* Creates a Bookmark object from the parameters
|
||||
*
|
||||
* @param array $bkm_fields the properties of the bookmark to add; here,
|
||||
* $bkm_fields['bkm_sql_query'] is urlencoded
|
||||
* @param boolean $all_users whether to make the bookmark available
|
||||
* for all users
|
||||
* @param DatabaseInterface $dbi DatabaseInterface object
|
||||
* @param string $user Current user
|
||||
* @param array $bkm_fields the properties of the bookmark to add; here,
|
||||
* $bkm_fields['bkm_sql_query'] is urlencoded
|
||||
* @param boolean $all_users whether to make the bookmark
|
||||
* available for all users
|
||||
*
|
||||
* @return Bookmark|false
|
||||
*/
|
||||
@ -271,7 +281,9 @@ class Bookmark
|
||||
/**
|
||||
* Gets the list of bookmarks defined for the current database
|
||||
*
|
||||
* @param string|bool $db the current database name or false
|
||||
* @param DatabaseInterface $dbi DatabaseInterface object
|
||||
* @param string $user Current user
|
||||
* @param string|bool $db the current database name or false
|
||||
*
|
||||
* @return Bookmark[] the bookmarks list
|
||||
*
|
||||
@ -325,12 +337,14 @@ class Bookmark
|
||||
/**
|
||||
* Retrieve a specific bookmark
|
||||
*
|
||||
* @param string $db the current database name
|
||||
* @param mixed $id an identifier of the bookmark to get
|
||||
* @param string $id_field which field to look up the identifier
|
||||
* @param boolean $action_bookmark_all true: get all bookmarks regardless
|
||||
* of the owning user
|
||||
* @param boolean $exact_user_match whether to ignore bookmarks with no user
|
||||
* @param DatabaseInterface $dbi DatabaseInterface object
|
||||
* @param string $user Current user
|
||||
* @param string $db the current database name
|
||||
* @param mixed $id an identifier of the bookmark to get
|
||||
* @param string $id_field which field to look up the identifier
|
||||
* @param boolean $action_bookmark_all true: get all bookmarks regardless
|
||||
* of the owning user
|
||||
* @param boolean $exact_user_match whether to ignore bookmarks with no user
|
||||
*
|
||||
* @return Bookmark the bookmark
|
||||
*
|
||||
|
||||
@ -14,6 +14,8 @@ use PhpMyAdmin\Config\FormDisplay;
|
||||
|
||||
/**
|
||||
* Base form for user preferences
|
||||
*
|
||||
* @package PhpMyAdmin
|
||||
*/
|
||||
abstract class BaseForm extends FormDisplay
|
||||
{
|
||||
|
||||
@ -11,6 +11,10 @@ namespace PhpMyAdmin\Config\Forms;
|
||||
|
||||
use PhpMyAdmin\Config\ConfigFile;
|
||||
|
||||
/**
|
||||
* Class BaseFormList
|
||||
* @package PhpMyAdmin\Config\Forms
|
||||
*/
|
||||
class BaseFormList
|
||||
{
|
||||
/**
|
||||
@ -18,20 +22,37 @@ class BaseFormList
|
||||
*/
|
||||
protected static $all = array();
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected static $ns = 'PhpMyAdmin\\Config\\Forms\\';
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
private $_forms;
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public static function getAll()
|
||||
{
|
||||
return static::$all;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $name Name
|
||||
* @return bool
|
||||
*/
|
||||
public static function isValid($name)
|
||||
{
|
||||
return in_array($name, static::$all);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $name Name
|
||||
* @return null|string
|
||||
*/
|
||||
public static function get($name)
|
||||
{
|
||||
if (static::isValid($name)) {
|
||||
|
||||
@ -12,8 +12,15 @@ namespace PhpMyAdmin\Config\Forms\Page;
|
||||
use PhpMyAdmin\Config\Forms\BaseForm;
|
||||
use PhpMyAdmin\Config\Forms\User\MainForm;
|
||||
|
||||
/**
|
||||
* Class BrowseForm
|
||||
* @package PhpMyAdmin\Config\Forms\Page
|
||||
*/
|
||||
class BrowseForm extends BaseForm
|
||||
{
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public static function getForms()
|
||||
{
|
||||
return [
|
||||
|
||||
@ -12,8 +12,15 @@ namespace PhpMyAdmin\Config\Forms\Page;
|
||||
use PhpMyAdmin\Config\Forms\BaseForm;
|
||||
use PhpMyAdmin\Config\Forms\User\MainForm;
|
||||
|
||||
/**
|
||||
* Class DbStructureForm
|
||||
* @package PhpMyAdmin\Config\Forms\Page
|
||||
*/
|
||||
class DbStructureForm extends BaseForm
|
||||
{
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public static function getForms()
|
||||
{
|
||||
return [
|
||||
|
||||
@ -13,8 +13,15 @@ use PhpMyAdmin\Config\Forms\BaseForm;
|
||||
use PhpMyAdmin\Config\Forms\User\MainForm;
|
||||
use PhpMyAdmin\Config\Forms\User\FeaturesForm;
|
||||
|
||||
/**
|
||||
* Class EditForm
|
||||
* @package PhpMyAdmin\Config\Forms\Page
|
||||
*/
|
||||
class EditForm extends BaseForm
|
||||
{
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public static function getForms()
|
||||
{
|
||||
return [
|
||||
|
||||
@ -9,6 +9,10 @@ declare(strict_types=1);
|
||||
|
||||
namespace PhpMyAdmin\Config\Forms\Page;
|
||||
|
||||
/**
|
||||
* Class ExportForm
|
||||
* @package PhpMyAdmin\Config\Forms\Page
|
||||
*/
|
||||
class ExportForm extends \PhpMyAdmin\Config\Forms\User\ExportForm
|
||||
{
|
||||
}
|
||||
|
||||
@ -9,6 +9,10 @@ declare(strict_types=1);
|
||||
|
||||
namespace PhpMyAdmin\Config\Forms\Page;
|
||||
|
||||
/**
|
||||
* Class ImportForm
|
||||
* @package PhpMyAdmin\Config\Forms\Page
|
||||
*/
|
||||
class ImportForm extends \PhpMyAdmin\Config\Forms\User\ImportForm
|
||||
{
|
||||
}
|
||||
|
||||
@ -9,6 +9,10 @@ declare(strict_types=1);
|
||||
|
||||
namespace PhpMyAdmin\Config\Forms\Page;
|
||||
|
||||
/**
|
||||
* Class NaviForm
|
||||
* @package PhpMyAdmin\Config\Forms\Page
|
||||
*/
|
||||
class NaviForm extends \PhpMyAdmin\Config\Forms\User\NaviForm
|
||||
{
|
||||
}
|
||||
|
||||
@ -11,8 +11,15 @@ namespace PhpMyAdmin\Config\Forms\Page;
|
||||
|
||||
use PhpMyAdmin\Config\Forms\BaseFormList;
|
||||
|
||||
/**
|
||||
* Class PageFormList
|
||||
* @package PhpMyAdmin\Config\Forms\Page
|
||||
*/
|
||||
class PageFormList extends BaseFormList
|
||||
{
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
protected static $all = array(
|
||||
'Browse',
|
||||
'DbStructure',
|
||||
@ -23,5 +30,8 @@ class PageFormList extends BaseFormList
|
||||
'Sql',
|
||||
'TableStructure',
|
||||
);
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected static $ns = '\\PhpMyAdmin\\Config\\Forms\\Page\\';
|
||||
}
|
||||
|
||||
@ -9,6 +9,10 @@ declare(strict_types=1);
|
||||
|
||||
namespace PhpMyAdmin\Config\Forms\Page;
|
||||
|
||||
/**
|
||||
* Class SqlForm
|
||||
* @package PhpMyAdmin\Config\Forms\Page
|
||||
*/
|
||||
class SqlForm extends \PhpMyAdmin\Config\Forms\User\SqlForm
|
||||
{
|
||||
}
|
||||
|
||||
@ -12,8 +12,15 @@ namespace PhpMyAdmin\Config\Forms\Page;
|
||||
use PhpMyAdmin\Config\Forms\BaseForm;
|
||||
use PhpMyAdmin\Config\Forms\User\MainForm;
|
||||
|
||||
/**
|
||||
* Class TableStructureForm
|
||||
* @package PhpMyAdmin\Config\Forms\Page
|
||||
*/
|
||||
class TableStructureForm extends BaseForm
|
||||
{
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public static function getForms()
|
||||
{
|
||||
return [
|
||||
|
||||
@ -11,8 +11,15 @@ namespace PhpMyAdmin\Config\Forms\Setup;
|
||||
|
||||
use PhpMyAdmin\Config\Forms\BaseForm;
|
||||
|
||||
/**
|
||||
* Class ConfigForm
|
||||
* @package PhpMyAdmin\Config\Forms\Setup
|
||||
*/
|
||||
class ConfigForm extends BaseForm
|
||||
{
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public static function getForms()
|
||||
{
|
||||
return array(
|
||||
|
||||
@ -9,6 +9,10 @@ declare(strict_types=1);
|
||||
|
||||
namespace PhpMyAdmin\Config\Forms\Setup;
|
||||
|
||||
/**
|
||||
* Class ExportForm
|
||||
* @package PhpMyAdmin\Config\Forms\Setup
|
||||
*/
|
||||
class ExportForm extends \PhpMyAdmin\Config\Forms\User\ExportForm
|
||||
{
|
||||
}
|
||||
|
||||
@ -9,8 +9,15 @@ declare(strict_types=1);
|
||||
|
||||
namespace PhpMyAdmin\Config\Forms\Setup;
|
||||
|
||||
/**
|
||||
* Class FeaturesForm
|
||||
* @package PhpMyAdmin\Config\Forms\Setup
|
||||
*/
|
||||
class FeaturesForm extends \PhpMyAdmin\Config\Forms\User\FeaturesForm
|
||||
{
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public static function getForms()
|
||||
{
|
||||
$result = parent::getForms();
|
||||
|
||||
@ -9,6 +9,10 @@ declare(strict_types=1);
|
||||
|
||||
namespace PhpMyAdmin\Config\Forms\Setup;
|
||||
|
||||
/**
|
||||
* Class ImportForm
|
||||
* @package PhpMyAdmin\Config\Forms\Setup
|
||||
*/
|
||||
class ImportForm extends \PhpMyAdmin\Config\Forms\User\ImportForm
|
||||
{
|
||||
}
|
||||
|
||||
@ -9,8 +9,15 @@ declare(strict_types=1);
|
||||
|
||||
namespace PhpMyAdmin\Config\Forms\Setup;
|
||||
|
||||
/**
|
||||
* Class MainForm
|
||||
* @package PhpMyAdmin\Config\Forms\Setup
|
||||
*/
|
||||
class MainForm extends \PhpMyAdmin\Config\Forms\User\MainForm
|
||||
{
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public static function getForms()
|
||||
{
|
||||
$result = parent::getForms();
|
||||
|
||||
@ -9,6 +9,10 @@ declare(strict_types=1);
|
||||
|
||||
namespace PhpMyAdmin\Config\Forms\Setup;
|
||||
|
||||
/**
|
||||
* Class NaviForm
|
||||
* @package PhpMyAdmin\Config\Forms\Setup
|
||||
*/
|
||||
class NaviForm extends \PhpMyAdmin\Config\Forms\User\NaviForm
|
||||
{
|
||||
}
|
||||
|
||||
@ -11,8 +11,15 @@ namespace PhpMyAdmin\Config\Forms\Setup;
|
||||
|
||||
use PhpMyAdmin\Config\Forms\BaseForm;
|
||||
|
||||
/**
|
||||
* Class ServersForm
|
||||
* @package PhpMyAdmin\Config\Forms\Setup
|
||||
*/
|
||||
class ServersForm extends BaseForm
|
||||
{
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public static function getForms()
|
||||
{
|
||||
return array(
|
||||
|
||||
@ -11,8 +11,15 @@ namespace PhpMyAdmin\Config\Forms\Setup;
|
||||
|
||||
use PhpMyAdmin\Config\Forms\BaseFormList;
|
||||
|
||||
/**
|
||||
* Class SetupFormList
|
||||
* @package PhpMyAdmin\Config\Forms\Setup
|
||||
*/
|
||||
class SetupFormList extends BaseFormList
|
||||
{
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
protected static $all = array(
|
||||
'Config',
|
||||
'Export',
|
||||
@ -23,5 +30,8 @@ class SetupFormList extends BaseFormList
|
||||
'Servers',
|
||||
'Sql',
|
||||
);
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected static $ns = '\\PhpMyAdmin\\Config\\Forms\\Setup\\';
|
||||
}
|
||||
|
||||
@ -9,8 +9,15 @@ declare(strict_types=1);
|
||||
|
||||
namespace PhpMyAdmin\Config\Forms\Setup;
|
||||
|
||||
/**
|
||||
* Class SqlForm
|
||||
* @package PhpMyAdmin\Config\Forms\Setup
|
||||
*/
|
||||
class SqlForm extends \PhpMyAdmin\Config\Forms\User\SqlForm
|
||||
{
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public static function getForms()
|
||||
{
|
||||
$result = parent::getForms();
|
||||
|
||||
@ -11,8 +11,15 @@ namespace PhpMyAdmin\Config\Forms\User;
|
||||
|
||||
use PhpMyAdmin\Config\Forms\BaseForm;
|
||||
|
||||
/**
|
||||
* Class ExportForm
|
||||
* @package PhpMyAdmin\Config\Forms\User
|
||||
*/
|
||||
class ExportForm extends BaseForm
|
||||
{
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public static function getForms()
|
||||
{
|
||||
return array(
|
||||
@ -137,6 +144,9 @@ class ExportForm extends BaseForm
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public static function getName()
|
||||
{
|
||||
return __('Export');
|
||||
|
||||
@ -11,8 +11,15 @@ namespace PhpMyAdmin\Config\Forms\User;
|
||||
|
||||
use PhpMyAdmin\Config\Forms\BaseForm;
|
||||
|
||||
/**
|
||||
* Class FeaturesForm
|
||||
* @package PhpMyAdmin\Config\Forms\User
|
||||
*/
|
||||
class FeaturesForm extends BaseForm
|
||||
{
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public static function getForms()
|
||||
{
|
||||
$result = array(
|
||||
@ -78,6 +85,9 @@ class FeaturesForm extends BaseForm
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public static function getName()
|
||||
{
|
||||
return __('Features');
|
||||
|
||||
@ -11,8 +11,15 @@ namespace PhpMyAdmin\Config\Forms\User;
|
||||
|
||||
use PhpMyAdmin\Config\Forms\BaseForm;
|
||||
|
||||
/**
|
||||
* Class ImportForm
|
||||
* @package PhpMyAdmin\Config\Forms\User
|
||||
*/
|
||||
class ImportForm extends BaseForm
|
||||
{
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public static function getForms()
|
||||
{
|
||||
return array(
|
||||
@ -55,6 +62,9 @@ class ImportForm extends BaseForm
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public static function getName()
|
||||
{
|
||||
return __('Import');
|
||||
|
||||
@ -11,8 +11,15 @@ namespace PhpMyAdmin\Config\Forms\User;
|
||||
|
||||
use PhpMyAdmin\Config\Forms\BaseForm;
|
||||
|
||||
/**
|
||||
* Class MainForm
|
||||
* @package PhpMyAdmin\Config\Forms\User
|
||||
*/
|
||||
class MainForm extends BaseForm
|
||||
{
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public static function getForms()
|
||||
{
|
||||
return array(
|
||||
@ -81,6 +88,9 @@ class MainForm extends BaseForm
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public static function getName()
|
||||
{
|
||||
return __('Main panel');
|
||||
|
||||
@ -11,8 +11,15 @@ namespace PhpMyAdmin\Config\Forms\User;
|
||||
|
||||
use PhpMyAdmin\Config\Forms\BaseForm;
|
||||
|
||||
/**
|
||||
* Class NaviForm
|
||||
* @package PhpMyAdmin\Config\Forms\User
|
||||
*/
|
||||
class NaviForm extends BaseForm
|
||||
{
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public static function getForms()
|
||||
{
|
||||
return array(
|
||||
@ -56,6 +63,9 @@ class NaviForm extends BaseForm
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public static function getName()
|
||||
{
|
||||
return __('Navigation panel');
|
||||
|
||||
@ -11,8 +11,15 @@ namespace PhpMyAdmin\Config\Forms\User;
|
||||
|
||||
use PhpMyAdmin\Config\Forms\BaseForm;
|
||||
|
||||
/**
|
||||
* Class SqlForm
|
||||
* @package PhpMyAdmin\Config\Forms\User
|
||||
*/
|
||||
class SqlForm extends BaseForm
|
||||
{
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public static function getForms()
|
||||
{
|
||||
return array(
|
||||
@ -37,6 +44,9 @@ class SqlForm extends BaseForm
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public static function getName()
|
||||
{
|
||||
return __('SQL queries');
|
||||
|
||||
@ -11,8 +11,15 @@ namespace PhpMyAdmin\Config\Forms\User;
|
||||
|
||||
use PhpMyAdmin\Config\Forms\BaseFormList;
|
||||
|
||||
/**
|
||||
* Class UserFormList
|
||||
* @package PhpMyAdmin\Config\Forms\User
|
||||
*/
|
||||
class UserFormList extends BaseFormList
|
||||
{
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
protected static $all = array(
|
||||
'Features',
|
||||
'Sql',
|
||||
@ -21,5 +28,8 @@ class UserFormList extends BaseFormList
|
||||
'Import',
|
||||
'Export',
|
||||
);
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected static $ns = '\\PhpMyAdmin\\Config\\Forms\\User\\';
|
||||
}
|
||||
|
||||
@ -32,6 +32,9 @@ abstract class Controller
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param Response $response Response object
|
||||
* @param DatabaseInterface $dbi DatabaseInterface object
|
||||
*/
|
||||
public function __construct($response, $dbi)
|
||||
{
|
||||
|
||||
@ -13,6 +13,7 @@ use PhpMyAdmin\Charsets;
|
||||
use PhpMyAdmin\Config\PageSettings;
|
||||
use PhpMyAdmin\Controllers\DatabaseController;
|
||||
use PhpMyAdmin\Core;
|
||||
use PhpMyAdmin\DatabaseInterface;
|
||||
use PhpMyAdmin\Display\CreateTable;
|
||||
use PhpMyAdmin\Message;
|
||||
use PhpMyAdmin\RecentFavoriteTable;
|
||||
@ -69,6 +70,10 @@ class DatabaseStructureController extends DatabaseController
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param Response $response Response object
|
||||
* @param DatabaseInterface $dbi DatabaseInterface object
|
||||
* @param string $db Database name
|
||||
*/
|
||||
public function __construct($response, $dbi, $db)
|
||||
{
|
||||
|
||||
@ -23,6 +23,10 @@ abstract class DatabaseController extends Controller
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param \PhpMyAdmin\Response $response Response object
|
||||
* @param \PhpMyAdmin\DatabaseInterface $dbi DatabaseInterface object
|
||||
* @param string $db Database name
|
||||
*/
|
||||
public function __construct($response, $dbi, $db)
|
||||
{
|
||||
|
||||
@ -31,6 +31,9 @@ class ServerBinlogController extends Controller
|
||||
|
||||
/**
|
||||
* Constructs ServerBinlogController
|
||||
*
|
||||
* @param \PhpMyAdmin\Response $response Response object
|
||||
* @param \PhpMyAdmin\DatabaseInterface $dbi DatabaseInterface object
|
||||
*/
|
||||
public function __construct($response, $dbi)
|
||||
{
|
||||
|
||||
@ -28,6 +28,9 @@ class ServerPluginsController extends Controller
|
||||
|
||||
/**
|
||||
* Constructs ServerPluginsController
|
||||
*
|
||||
* @param \PhpMyAdmin\Response $response Response object
|
||||
* @param \PhpMyAdmin\DatabaseInterface $dbi DatabaseInterface object
|
||||
*/
|
||||
public function __construct($response, $dbi)
|
||||
{
|
||||
|
||||
@ -32,6 +32,9 @@ class ServerVariablesController extends Controller
|
||||
|
||||
/**
|
||||
* Constructs ServerVariablesController
|
||||
*
|
||||
* @param \PhpMyAdmin\Response $response Response object
|
||||
* @param \PhpMyAdmin\DatabaseInterface $dbi DatabaseInterface object
|
||||
*/
|
||||
public function __construct($response, $dbi)
|
||||
{
|
||||
|
||||
@ -43,9 +43,13 @@ class TableChartController extends TableController
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param string $sql_query Query
|
||||
* @param string $url_query Query URL
|
||||
* @param array $cfg Configuration
|
||||
* @param Response $response Response object
|
||||
* @param \PhpMyAdmin\DatabaseInterface $dbi DatabaseInterface object
|
||||
* @param string $db Database name
|
||||
* @param string $table Table name
|
||||
* @param string $sql_query Query
|
||||
* @param string $url_query Query URL
|
||||
* @param array $cfg Configuration
|
||||
*/
|
||||
public function __construct(
|
||||
$response,
|
||||
|
||||
@ -16,9 +16,6 @@ use PhpMyAdmin\Message;
|
||||
use PhpMyAdmin\Template;
|
||||
use PhpMyAdmin\Url;
|
||||
|
||||
require_once 'libraries/common.inc.php';
|
||||
require_once 'libraries/db_common.inc.php';
|
||||
|
||||
/**
|
||||
* Class TableGisVisualizationController
|
||||
*
|
||||
@ -26,7 +23,6 @@ require_once 'libraries/db_common.inc.php';
|
||||
*/
|
||||
class TableGisVisualizationController extends TableController
|
||||
{
|
||||
|
||||
/**
|
||||
* @var array $url_params
|
||||
*/
|
||||
@ -50,11 +46,15 @@ class TableGisVisualizationController extends TableController
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param string $sql_query SQL query for retrieving GIS data
|
||||
* @param array $url_params array of URL parameters
|
||||
* @param string $goto goto script
|
||||
* @param string $back back script
|
||||
* @param array $visualizationSettings visualization settings
|
||||
* @param \PhpMyAdmin\Response $response Response object
|
||||
* @param \PhpMyAdmin\DatabaseInterface $dbi DatabaseInterface object
|
||||
* @param string $db Database name
|
||||
* @param string $table Table name
|
||||
* @param string $sql_query SQL query for retrieving GIS data
|
||||
* @param array $url_params array of URL parameters
|
||||
* @param string $goto goto script
|
||||
* @param string $back back script
|
||||
* @param array $visualizationSettings visualization settings
|
||||
*/
|
||||
public function __construct(
|
||||
$response,
|
||||
@ -69,6 +69,9 @@ class TableGisVisualizationController extends TableController
|
||||
) {
|
||||
parent::__construct($response, $dbi, $db, $table);
|
||||
|
||||
require_once 'libraries/common.inc.php';
|
||||
require_once 'libraries/db_common.inc.php';
|
||||
|
||||
$this->sql_query = $sql_query;
|
||||
$this->url_params = $url_params;
|
||||
$this->url_params['goto'] = $goto;
|
||||
|
||||
@ -31,7 +31,11 @@ class TableIndexesController extends TableController
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param Index $index Index
|
||||
* @param Response $response Response object
|
||||
* @param \PhpMyAdmin\DatabaseInterface $dbi DatabaseInterface object
|
||||
* @param string $db Database name
|
||||
* @param string $table Table name
|
||||
* @param Index $index Index object
|
||||
*/
|
||||
public function __construct(
|
||||
$response,
|
||||
|
||||
@ -63,12 +63,16 @@ class TableRelationController extends TableController
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param array|null $options_array Options
|
||||
* @param array|null $cfgRelation Config relation
|
||||
* @param string $tbl_storage_engine Table storage engine
|
||||
* @param array|null $existrel Relations
|
||||
* @param array|null $existrel_foreign External relations
|
||||
* @param string $upd_query Update query
|
||||
* @param \PhpMyAdmin\Response $response Response object
|
||||
* @param DatabaseInterface $dbi DatabaseInterface object
|
||||
* @param string $db Database name
|
||||
* @param string $table Table name
|
||||
* @param array|null $options_array Options
|
||||
* @param array|null $cfgRelation Config relation
|
||||
* @param string $tbl_storage_engine Table storage engine
|
||||
* @param array|null $existrel Relations
|
||||
* @param array|null $existrel_foreign External relations
|
||||
* @param string $upd_query Update query
|
||||
*/
|
||||
public function __construct(
|
||||
$response,
|
||||
|
||||
@ -90,8 +90,12 @@ class TableSearchController extends TableController
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param string $searchType Search type
|
||||
* @param string $url_query URL query
|
||||
* @param \PhpMyAdmin\Response $response Response object
|
||||
* @param DatabaseInterface $dbi DatabaseInterface object
|
||||
* @param string $db Database name
|
||||
* @param string $table Table name
|
||||
* @param string $searchType Search type
|
||||
* @param string $url_query URL query
|
||||
*/
|
||||
public function __construct(
|
||||
$response,
|
||||
|
||||
@ -88,20 +88,22 @@ class TableStructureController extends TableController
|
||||
/**
|
||||
* TableStructureController constructor
|
||||
*
|
||||
* @param string $db DB name
|
||||
* @param string $table Table name
|
||||
* @param string $type Indicate the db_structure or tbl_structure
|
||||
* @param int $num_tables Number of tables
|
||||
* @param int $pos Current position in the list
|
||||
* @param bool $db_is_system_schema DB is information_schema
|
||||
* @param int $total_num_tables Number of tables
|
||||
* @param array $tables Tables in the DB
|
||||
* @param bool $is_show_stats Whether stats show or not
|
||||
* @param bool $tbl_is_view Table is a view
|
||||
* @param string $tbl_storage_engine Table storage engine
|
||||
* @param int $table_info_num_rows Number of rows
|
||||
* @param string $tbl_collation Table collation
|
||||
* @param array $showtable Show table info
|
||||
* @param \PhpMyAdmin\Response $response Response object
|
||||
* @param \PhpMyAdmin\DatabaseInterface $dbi DatabaseInterface object
|
||||
* @param string $db Database name
|
||||
* @param string $table Table name
|
||||
* @param string $type Indicate the db_structure or tbl_structure
|
||||
* @param int $num_tables Number of tables
|
||||
* @param int $pos Current position in the list
|
||||
* @param bool $db_is_system_schema DB is information_schema
|
||||
* @param int $total_num_tables Number of tables
|
||||
* @param array $tables Tables in the DB
|
||||
* @param bool $is_show_stats Whether stats show or not
|
||||
* @param bool $tbl_is_view Table is a view
|
||||
* @param string $tbl_storage_engine Table storage engine
|
||||
* @param int $table_info_num_rows Number of rows
|
||||
* @param string $tbl_collation Table collation
|
||||
* @param array $showtable Show table info
|
||||
*/
|
||||
public function __construct(
|
||||
$response,
|
||||
|
||||
@ -28,6 +28,11 @@ abstract class TableController extends Controller
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param \PhpMyAdmin\Response $response Response object
|
||||
* @param \PhpMyAdmin\DatabaseInterface $dbi DatabaseInterface object
|
||||
* @param string $db Database name
|
||||
* @param string $table Table name
|
||||
*/
|
||||
public function __construct(
|
||||
$response,
|
||||
|
||||
@ -589,7 +589,7 @@ class Import
|
||||
* (NONE or VARCHAR or DECIMAL or INT or BIGINT)
|
||||
* @param int $curr_type Type of the current cell
|
||||
* (NONE or VARCHAR or DECIMAL or INT or BIGINT)
|
||||
* @param string $cell The current cell
|
||||
* @param string $cell The current cell
|
||||
*
|
||||
* @return string|int Size of the given cell in the type-appropriate format
|
||||
* @access public
|
||||
|
||||
@ -57,7 +57,7 @@ abstract class ListAbstract extends ArrayObject
|
||||
* checks if the given db names exists in the current list, if there is
|
||||
* missing at least one item it returns false otherwise true
|
||||
*
|
||||
* @param mixed ... $params
|
||||
* @param mixed ... $params params
|
||||
* @return bool true if all items exists, otherwise false
|
||||
*/
|
||||
public function exists(...$params)
|
||||
|
||||
@ -644,7 +644,7 @@ class Message
|
||||
/**
|
||||
* wrapper for sprintf()
|
||||
*
|
||||
* @param mixed ... $params
|
||||
* @param mixed ... $params Params
|
||||
* @return string formatted
|
||||
*/
|
||||
public static function format(...$params): string
|
||||
|
||||
@ -203,7 +203,7 @@ class Plugins
|
||||
* @param string $section name of config section in
|
||||
* $GLOBALS['cfg'][$section] for plugin
|
||||
* @param string $name name of select element
|
||||
* @param array &$list array with plugin instances
|
||||
* @param array $list array with plugin instances
|
||||
* @param string $cfgname name of config value, if none same as $name
|
||||
*
|
||||
* @return string html select tag
|
||||
@ -525,7 +525,7 @@ class Plugins
|
||||
* Returns html div with editable options for plugin
|
||||
*
|
||||
* @param string $section name of config section in $GLOBALS['cfg'][$section]
|
||||
* @param array &$list array with plugin instances
|
||||
* @param array $list array with plugin instances
|
||||
*
|
||||
* @return string html fieldset with plugin options
|
||||
*/
|
||||
|
||||
@ -18,6 +18,8 @@ use PragmaRX\Google2FA\Google2FA;
|
||||
* HOTP and TOTP based two-factor authentication
|
||||
*
|
||||
* Also known as Google, Authy, or OTP
|
||||
*
|
||||
* @package PhpMyAdmin
|
||||
*/
|
||||
class Application extends TwoFactorPlugin
|
||||
{
|
||||
|
||||
@ -14,6 +14,8 @@ use PhpMyAdmin\Template;
|
||||
|
||||
/**
|
||||
* Invalid two-factor authentication showing that configured choice is not available.
|
||||
*
|
||||
* @package PhpMyAdmin
|
||||
*/
|
||||
class Invalid extends TwoFactorPlugin
|
||||
{
|
||||
|
||||
@ -20,6 +20,8 @@ use Samyoul\U2F\U2FServer\U2FException;
|
||||
* Hardware key based two-factor authentication
|
||||
*
|
||||
* Supports FIDO U2F tokens
|
||||
*
|
||||
* @package PhpMyAdmin
|
||||
*/
|
||||
class Key extends TwoFactorPlugin
|
||||
{
|
||||
|
||||
@ -16,6 +16,8 @@ use PhpMyAdmin\Template;
|
||||
* Simple two-factor authentication auth asking just for confirmation.
|
||||
*
|
||||
* This has no practical use, but can be used for testing.
|
||||
*
|
||||
* @package PhpMyAdmin
|
||||
*/
|
||||
class Simple extends TwoFactorPlugin
|
||||
{
|
||||
|
||||
@ -19,6 +19,8 @@ use PhpMyAdmin\TwoFactor;
|
||||
* This is basic implementation which does no
|
||||
* additional authentication, subclasses are expected
|
||||
* to implement this.
|
||||
*
|
||||
* @package PhpMyAdmin
|
||||
*/
|
||||
class TwoFactorPlugin
|
||||
{
|
||||
|
||||
@ -13,6 +13,8 @@ use PhpMyAdmin\UserPreferences;
|
||||
|
||||
/**
|
||||
* Two factor authentication wrapper class
|
||||
*
|
||||
* @package PhpMyAdmin
|
||||
*/
|
||||
class TwoFactor
|
||||
{
|
||||
|
||||
@ -17,15 +17,10 @@
|
||||
<testsuite name="Classes">
|
||||
<directory suffix="Test.php">test/classes</directory>
|
||||
</testsuite>
|
||||
<testsuite name="Engines">
|
||||
<directory suffix="_test.php">test/engines</directory>
|
||||
</testsuite>
|
||||
<testsuite name="Unit">
|
||||
<file>test/Environment_test.php</file>
|
||||
<directory suffix="_test.php">test/libraries/core</directory>
|
||||
<directory suffix="_test.php">test/libraries/common</directory>
|
||||
<directory suffix="_test.php">test/libraries/rte</directory>
|
||||
<directory suffix="_test.php">test/libraries</directory>
|
||||
<file>test/EnvironmentTest.php</file>
|
||||
<directory suffix="Test.php">test/libraries/common</directory>
|
||||
<directory suffix="Test.php">test/libraries</directory>
|
||||
</testsuite>
|
||||
<testsuite name="Selenium">
|
||||
<directory suffix="Test.php">test/selenium</directory>
|
||||
|
||||
@ -19,15 +19,10 @@
|
||||
<testsuite name="Classes">
|
||||
<directory suffix="Test.php">test/classes</directory>
|
||||
</testsuite>
|
||||
<testsuite name="Engines">
|
||||
<directory suffix="_test.php">test/engines</directory>
|
||||
</testsuite>
|
||||
<testsuite name="Unit">
|
||||
<file>test/Environment_test.php</file>
|
||||
<directory suffix="_test.php">test/libraries/core</directory>
|
||||
<directory suffix="_test.php">test/libraries/common</directory>
|
||||
<directory suffix="_test.php">test/libraries/rte</directory>
|
||||
<directory suffix="_test.php">test/libraries</directory>
|
||||
<file>test/EnvironmentTest.php</file>
|
||||
<directory suffix="Test.php">test/libraries/common</directory>
|
||||
<directory suffix="Test.php">test/libraries</directory>
|
||||
</testsuite>
|
||||
<testsuite name="Selenium">
|
||||
<directory suffix="Test.php">test/selenium</directory>
|
||||
|
||||
@ -7,19 +7,21 @@
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace PhpMyAdmin\Tests;
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
require_once 'config.sample.inc.php';
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
/**
|
||||
* Environment tests
|
||||
*
|
||||
* @package PhpMyAdmin-test
|
||||
*/
|
||||
class Environment_Test extends TestCase
|
||||
class EnvironmentTest extends TestCase
|
||||
{
|
||||
/**
|
||||
* Tests PHP version
|
||||
@ -79,6 +79,9 @@ class AdvisorTest extends PmaTestCase
|
||||
/**
|
||||
* test for Advisor::byTime
|
||||
*
|
||||
* @param float $time time
|
||||
* @param string $expected expected result
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @dataProvider advisorTimes
|
||||
@ -89,6 +92,9 @@ class AdvisorTest extends PmaTestCase
|
||||
$this->assertEquals($expected, $result);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function advisorTimes()
|
||||
{
|
||||
return array(
|
||||
|
||||
@ -19,6 +19,9 @@ use PHPUnit\Framework\TestCase;
|
||||
*/
|
||||
class CharsetsTest extends TestCase
|
||||
{
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function setUp()
|
||||
{
|
||||
$GLOBALS['cfg']['DBG']['sql'] = false;
|
||||
|
||||
@ -31,6 +31,12 @@ class DescriptionTest extends PmaTestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $item item
|
||||
* @param string $type type
|
||||
* @param string $expected expected result
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @dataProvider getValues
|
||||
*/
|
||||
public function testGet($item, $type, $expected)
|
||||
@ -38,6 +44,9 @@ class DescriptionTest extends PmaTestCase
|
||||
$this->assertEquals($expected, Descriptions::get($item, $type));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function getValues()
|
||||
{
|
||||
return array(
|
||||
@ -62,6 +71,8 @@ class DescriptionTest extends PmaTestCase
|
||||
/**
|
||||
* Assertion for getting description key
|
||||
*
|
||||
* @param string $key key
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function assertGet($key)
|
||||
@ -72,7 +83,9 @@ class DescriptionTest extends PmaTestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* Test getting all names for configuratons
|
||||
* Test getting all names for configurations
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function testAll()
|
||||
{
|
||||
|
||||
@ -23,6 +23,9 @@ use PhpMyAdmin\Tests\PmaTestCase;
|
||||
*/
|
||||
class FormListTest extends PmaTestCase
|
||||
{
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function setUp()
|
||||
{
|
||||
$GLOBALS['PMA_Config'] = new Config();
|
||||
@ -35,6 +38,8 @@ class FormListTest extends PmaTestCase
|
||||
* @param string $class Class to test
|
||||
* @param string $prefix Reuturned class prefix
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @dataProvider formObjects
|
||||
*/
|
||||
public function testForms($class, $prefix)
|
||||
@ -65,6 +70,9 @@ class FormListTest extends PmaTestCase
|
||||
$this->assertEquals('', $forms->displayErrors());
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function formObjects()
|
||||
{
|
||||
return array(
|
||||
|
||||
@ -22,8 +22,16 @@ use ReflectionProperty;
|
||||
*/
|
||||
class ServeConfigChecksTest extends PmaTestCase
|
||||
{
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
private $sessionID;
|
||||
|
||||
/**
|
||||
* @throws \ReflectionException
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setUp()
|
||||
{
|
||||
$GLOBALS['PMA_Config'] = new Config();
|
||||
@ -42,6 +50,9 @@ class ServeConfigChecksTest extends PmaTestCase
|
||||
unset($_SESSION[$this->sessionID]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function testManyErrors()
|
||||
{
|
||||
$_SESSION[$this->sessionID]['Servers'] = array(
|
||||
@ -100,6 +111,9 @@ class ServeConfigChecksTest extends PmaTestCase
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function testBlowfishCreate()
|
||||
{
|
||||
$_SESSION[$this->sessionID]['Servers'] = array(
|
||||
@ -134,9 +148,11 @@ class ServeConfigChecksTest extends PmaTestCase
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function testBlowfish()
|
||||
{
|
||||
|
||||
$_SESSION[$this->sessionID]['blowfish_secret'] = 'sec';
|
||||
|
||||
$_SESSION[$this->sessionID]['Servers'] = array(
|
||||
|
||||
@ -486,6 +486,15 @@ class ConfigTest extends PmaTestCase
|
||||
/**
|
||||
* test for IsHttp
|
||||
*
|
||||
* @param string $scheme http scheme
|
||||
* @param string $https https
|
||||
* @param string $uri request uri
|
||||
* @param string $lb http https from lb
|
||||
* @param string $front http front end https
|
||||
* @param string $proto http x forwarded proto
|
||||
* @param int $port server port
|
||||
* @param bool $expected expected result
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @dataProvider httpsParams
|
||||
@ -1024,6 +1033,10 @@ class ConfigTest extends PmaTestCase
|
||||
/**
|
||||
* Test for checkServers
|
||||
*
|
||||
* @param array $settings settings array
|
||||
* @param array $expected expected result
|
||||
* @param bool $error error
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @dataProvider serverSettingsProvider
|
||||
@ -1075,6 +1088,10 @@ class ConfigTest extends PmaTestCase
|
||||
/**
|
||||
* Test for selectServer
|
||||
*
|
||||
* @param array $settings settings array
|
||||
* @param string $request request
|
||||
* @param int $expected expected result
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @dataProvider selectServerProvider
|
||||
|
||||
@ -41,8 +41,18 @@ class TableRelationControllerTest extends PmaTestCase
|
||||
$_REQUEST['foreignDb'] = 'db';
|
||||
$_REQUEST['foreignTable'] = 'table';
|
||||
|
||||
$GLOBALS['dblist'] = new DataBasePMAMockForTblRelation();
|
||||
$GLOBALS['dblist']->databases = new DataBaseMockForTblRelation();
|
||||
$GLOBALS['dblist'] = new \stdClass();
|
||||
$GLOBALS['dblist']->databases = new class
|
||||
{
|
||||
/**
|
||||
* @param mixed $name name
|
||||
* @return bool
|
||||
*/
|
||||
public function exists($name)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
$indexes = array(
|
||||
array(
|
||||
@ -259,33 +269,3 @@ class TableRelationControllerTest extends PmaTestCase
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Mock class for DataBasePMAMock
|
||||
*
|
||||
* @package PhpMyAdmin-test
|
||||
*/
|
||||
Class DataBasePMAMockForTblRelation
|
||||
{
|
||||
var $databases;
|
||||
}
|
||||
|
||||
/**
|
||||
* Mock class for DataBaseMock
|
||||
*
|
||||
* @package PhpMyAdmin-test
|
||||
*/
|
||||
Class DataBaseMockForTblRelation
|
||||
{
|
||||
/**
|
||||
* mock function to return table is existed
|
||||
*
|
||||
* @param string $name table name
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
function exists($name)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@ -76,7 +76,7 @@ class SearchTest extends PmaTestCase
|
||||
* @param string $name method name
|
||||
* @param array $params parameters for the invocation
|
||||
*
|
||||
* @return the output from the protected method.
|
||||
* @return mixed the output from the protected method.
|
||||
*/
|
||||
private function callProtectedFunction($name, $params)
|
||||
{
|
||||
@ -89,6 +89,11 @@ class SearchTest extends PmaTestCase
|
||||
/**
|
||||
* Test for generating where clause for different search types
|
||||
*
|
||||
* @param string $type type
|
||||
* @param string $expected expected result
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @dataProvider searchTypes
|
||||
*/
|
||||
public function testGetWhereClause($type, $expected)
|
||||
|
||||
@ -21,6 +21,9 @@ use PhpMyAdmin\Util;
|
||||
*/
|
||||
class DatabaseInterfaceTest extends PmaTestCase
|
||||
{
|
||||
/**
|
||||
* @var DatabaseInterface
|
||||
*/
|
||||
private $_dbi;
|
||||
|
||||
/**
|
||||
@ -38,6 +41,10 @@ class DatabaseInterfaceTest extends PmaTestCase
|
||||
/**
|
||||
* Tests for DBI::getCurrentUser() method.
|
||||
*
|
||||
* @param array $value value
|
||||
* @param string $string string
|
||||
* @param array $expected expected result
|
||||
*
|
||||
* @return void
|
||||
* @test
|
||||
* @dataProvider currentUserData
|
||||
@ -92,11 +99,11 @@ class DatabaseInterfaceTest extends PmaTestCase
|
||||
->method('realQuery')
|
||||
->will($this->returnValue(true));
|
||||
|
||||
$meta1 = new FieldMeta();
|
||||
$meta1 = new \stdClass();
|
||||
$meta1->table = "meta1_table";
|
||||
$meta1->name = "meta1_name";
|
||||
|
||||
$meta2 = new FieldMeta();
|
||||
$meta2 = new \stdClass();
|
||||
$meta2->table = "meta2_table";
|
||||
$meta2->name = "meta2_name";
|
||||
|
||||
@ -371,6 +378,8 @@ class DatabaseInterfaceTest extends PmaTestCase
|
||||
* @param string $error_message Error message as returned by server
|
||||
* @param string $match Expected text
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @dataProvider errorData
|
||||
*/
|
||||
public function testFormatError($error_number, $error_message, $match)
|
||||
@ -381,6 +390,9 @@ class DatabaseInterfaceTest extends PmaTestCase
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function errorData()
|
||||
{
|
||||
return array(
|
||||
@ -396,6 +408,9 @@ class DatabaseInterfaceTest extends PmaTestCase
|
||||
/**
|
||||
* Tests for DBI::isAmazonRds() method.
|
||||
*
|
||||
* @param mixed $value value
|
||||
* @param mixed $expected expected result
|
||||
*
|
||||
* @return void
|
||||
* @test
|
||||
* @dataProvider isAmazonRdsData
|
||||
@ -450,6 +465,9 @@ class DatabaseInterfaceTest extends PmaTestCase
|
||||
$this->assertEquals($upgrade, $ver_int < $GLOBALS['cfg']['MysqlMinVersion']['internal']);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function versionData()
|
||||
{
|
||||
return array(
|
||||
@ -499,14 +517,3 @@ class DatabaseInterfaceTest extends PmaTestCase
|
||||
$dbi->setCollation('utf8mb4_bin_ci');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* class for Table Field Meta
|
||||
*
|
||||
* @package PhpMyAdmin-test
|
||||
*/
|
||||
class FieldMeta
|
||||
{
|
||||
public $table;
|
||||
public $name;
|
||||
}
|
||||
|
||||
@ -19,11 +19,17 @@ use PHPUnit\Framework\TestCase;
|
||||
*/
|
||||
class EncodingTest extends TestCase
|
||||
{
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function setUp()
|
||||
{
|
||||
Encoding::initEngine();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function tearDown()
|
||||
{
|
||||
Encoding::initEngine();
|
||||
@ -45,6 +51,9 @@ class EncodingTest extends TestCase
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function testInvalidConversion()
|
||||
{
|
||||
// Invalid value to use default case
|
||||
@ -55,6 +64,9 @@ class EncodingTest extends TestCase
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function testRecode()
|
||||
{
|
||||
if (! function_exists('recode_string')) {
|
||||
@ -70,6 +82,9 @@ class EncodingTest extends TestCase
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function testIconv()
|
||||
{
|
||||
if (! function_exists('iconv')) {
|
||||
@ -86,6 +101,9 @@ class EncodingTest extends TestCase
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function testMbstring()
|
||||
{
|
||||
Encoding::setEngine(Encoding::ENGINE_MB);
|
||||
@ -100,9 +118,6 @@ class EncodingTest extends TestCase
|
||||
/**
|
||||
* Test for kanjiChangeOrder
|
||||
*
|
||||
* @param string $kanji_test_list current list
|
||||
* @param string $expected expected list
|
||||
*
|
||||
* @return void
|
||||
* @test
|
||||
*/
|
||||
@ -204,6 +219,9 @@ class EncodingTest extends TestCase
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function testListEncodings()
|
||||
{
|
||||
$GLOBALS['cfg']['AvailableCharsets'] = ['utf-8'];
|
||||
|
||||
@ -21,6 +21,7 @@ use PhpMyAdmin\Theme;
|
||||
class ErrorTest extends PmaTestCase
|
||||
{
|
||||
/**
|
||||
* @var Error
|
||||
* @access protected
|
||||
*/
|
||||
protected $object;
|
||||
@ -76,6 +77,9 @@ class ErrorTest extends PmaTestCase
|
||||
/**
|
||||
* Test for setFile
|
||||
*
|
||||
* @param string $file actual
|
||||
* @param string $expected expected
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @dataProvider filePathProvider
|
||||
|
||||
@ -25,6 +25,8 @@ class FontTest extends PmaTestCase
|
||||
|
||||
/**
|
||||
* Sets up the fixture
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function setUp()
|
||||
{
|
||||
|
||||
@ -55,6 +55,11 @@ class IpAllowDenyTest extends TestCase
|
||||
/**
|
||||
* Test for Core::getIp
|
||||
*
|
||||
* @param string $remote remote
|
||||
* @param string $header header
|
||||
* @param string $expected expected result
|
||||
* @param string $proxyip proxyip
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @dataProvider proxyIPs
|
||||
|
||||
@ -19,6 +19,9 @@ use PhpMyAdmin\Tests\PmaTestCase;
|
||||
*/
|
||||
class LanguageTest extends PmaTestCase
|
||||
{
|
||||
/**
|
||||
* @var LanguageManager
|
||||
*/
|
||||
private $manager;
|
||||
|
||||
/**
|
||||
@ -35,6 +38,9 @@ class LanguageTest extends PmaTestCase
|
||||
$this->manager = new LanguageManager();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function tearDown()
|
||||
{
|
||||
// Ensure we have English locale after tests
|
||||
|
||||
@ -36,7 +36,7 @@ class AuthenticationCookieTest extends PmaTestCase
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
function setup()
|
||||
protected function setUp()
|
||||
{
|
||||
$GLOBALS['PMA_Config'] = new Config();
|
||||
$GLOBALS['PMA_Config']->enableBc();
|
||||
@ -92,6 +92,9 @@ class AuthenticationCookieTest extends PmaTestCase
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
private function getAuthErrorMockResponse()
|
||||
{
|
||||
$mockResponse = $this->mockResponse();
|
||||
@ -769,6 +772,9 @@ class AuthenticationCookieTest extends PmaTestCase
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function testAuthFailsDeny()
|
||||
{
|
||||
$this->object = $this->getMockBuilder('PhpMyAdmin\Plugins\Auth\AuthenticationCookie')
|
||||
@ -791,6 +797,9 @@ class AuthenticationCookieTest extends PmaTestCase
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function testAuthFailsActivity()
|
||||
{
|
||||
$this->object = $this->getMockBuilder('PhpMyAdmin\Plugins\Auth\AuthenticationCookie')
|
||||
@ -816,6 +825,9 @@ class AuthenticationCookieTest extends PmaTestCase
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function testAuthFailsDBI()
|
||||
{
|
||||
$this->object = $this->getMockBuilder('PhpMyAdmin\Plugins\Auth\AuthenticationCookie')
|
||||
@ -849,6 +861,9 @@ class AuthenticationCookieTest extends PmaTestCase
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function testAuthFailsErrno()
|
||||
{
|
||||
$this->object = $this->getMockBuilder('PhpMyAdmin\Plugins\Auth\AuthenticationCookie')
|
||||
@ -1036,6 +1051,10 @@ class AuthenticationCookieTest extends PmaTestCase
|
||||
/**
|
||||
* Test for secret splitting using getAESSecret
|
||||
*
|
||||
* @param string $secret secret
|
||||
* @param string $mac mac
|
||||
* @param string $aes aes
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @dataProvider secretsProvider
|
||||
@ -1051,6 +1070,10 @@ class AuthenticationCookieTest extends PmaTestCase
|
||||
/**
|
||||
* Test for secret splitting using getMACSecret and getAESSecret
|
||||
*
|
||||
* @param string $secret secret
|
||||
* @param string $mac mac
|
||||
* @param string $aes aes
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @dataProvider secretsProvider
|
||||
@ -1063,6 +1086,11 @@ class AuthenticationCookieTest extends PmaTestCase
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws \ReflectionException
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function testPasswordChange()
|
||||
{
|
||||
$newPassword = 'PMAPASSWD2';
|
||||
@ -1167,6 +1195,14 @@ class AuthenticationCookieTest extends PmaTestCase
|
||||
/**
|
||||
* Test for PhpMyAdmin\Plugins\Auth\AuthenticationCookie::checkRules
|
||||
*
|
||||
* @param string $user user
|
||||
* @param string $pass pass
|
||||
* @param string $ip ip
|
||||
* @param bool $root root
|
||||
* @param bool $nopass nopass
|
||||
* @param array $rules rules
|
||||
* @param string $expected expected result
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @dataProvider checkRulesProvider
|
||||
@ -1198,6 +1234,9 @@ class AuthenticationCookieTest extends PmaTestCase
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function checkRulesProvider()
|
||||
{
|
||||
return array(
|
||||
|
||||
@ -57,6 +57,14 @@ class AuthenticationHttpTest extends PmaTestCase
|
||||
unset($this->object);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param mixed $set_minimal set minimal
|
||||
* @param mixed $body_id body id
|
||||
* @param mixed $set_title set title
|
||||
* @param mixed ... $headers headers
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function doMockResponse($set_minimal, $body_id, $set_title, ...$headers)
|
||||
{
|
||||
// mock footer
|
||||
@ -133,6 +141,9 @@ class AuthenticationHttpTest extends PmaTestCase
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function testAuthVerbose()
|
||||
{
|
||||
$_REQUEST['old_usr'] = '';
|
||||
@ -146,6 +157,9 @@ class AuthenticationHttpTest extends PmaTestCase
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function testAuthHost()
|
||||
{
|
||||
$GLOBALS['cfg']['Server']['verbose'] = '';
|
||||
@ -159,6 +173,9 @@ class AuthenticationHttpTest extends PmaTestCase
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function testAuthRealm()
|
||||
{
|
||||
$GLOBALS['cfg']['Server']['host'] = '';
|
||||
|
||||
@ -20,11 +20,19 @@ use ReflectionProperty;
|
||||
*/
|
||||
class PmaTestCase extends TestCase
|
||||
{
|
||||
/**
|
||||
* @var Response
|
||||
*/
|
||||
protected $restoreInstance = null;
|
||||
/**
|
||||
* @var Response
|
||||
*/
|
||||
protected $attrInstance = null;
|
||||
|
||||
/**
|
||||
* This method is called before the first test of this test class is run.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public static function setUpBeforeClass()
|
||||
{
|
||||
|
||||
@ -19,15 +19,6 @@ use PHPUnit\Framework\TestCase;
|
||||
*/
|
||||
class SanitizeTest extends TestCase
|
||||
{
|
||||
/**
|
||||
* Setup various pre conditions
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
function setUp()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests for proper escaping of XSS.
|
||||
*
|
||||
@ -63,6 +54,9 @@ class SanitizeTest extends TestCase
|
||||
/**
|
||||
* Tests links to documentation.
|
||||
*
|
||||
* @param string $link link
|
||||
* @param string $expected expected result
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @dataProvider docLinks
|
||||
|
||||
@ -46,8 +46,18 @@ class TableTest extends PmaTestCase
|
||||
|
||||
$relation = new Relation();
|
||||
$GLOBALS['cfgRelation'] = $relation->getRelationsParam();
|
||||
$GLOBALS['dblist'] = new DataBasePMAMock();
|
||||
$GLOBALS['dblist']->databases = new DataBaseMock();
|
||||
$GLOBALS['dblist'] = new \stdClass();
|
||||
$GLOBALS['dblist']->databases = new class
|
||||
{
|
||||
/**
|
||||
* @param mixed $name name
|
||||
* @return bool
|
||||
*/
|
||||
public function exists($name)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
$sql_isView_true = "SELECT TABLE_NAME
|
||||
FROM information_schema.VIEWS
|
||||
@ -377,14 +387,15 @@ class TableTest extends PmaTestCase
|
||||
/**
|
||||
* Test name validation
|
||||
*
|
||||
* @param string $name name to test
|
||||
* @param boolean $result expected result
|
||||
* @param string $name name to test
|
||||
* @param boolean $result expected result
|
||||
* @param boolean $is_backquoted is backquoted
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @dataProvider dataValidateName
|
||||
*/
|
||||
public function testValidateName($name, $result, $is_backquoted=false)
|
||||
public function testValidateName($name, $result, $is_backquoted = false)
|
||||
{
|
||||
$this->assertEquals(
|
||||
$result,
|
||||
@ -1353,35 +1364,4 @@ class TableTest extends PmaTestCase
|
||||
$create_options
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Mock class for DataBasePMAMock
|
||||
*
|
||||
* @package PhpMyAdmin-test
|
||||
*/
|
||||
Class DataBasePMAMock
|
||||
{
|
||||
var $databases;
|
||||
}
|
||||
|
||||
/**
|
||||
* Mock class for DataBaseMock
|
||||
*
|
||||
* @package PhpMyAdmin-test
|
||||
*/
|
||||
Class DataBaseMock
|
||||
{
|
||||
/**
|
||||
* mock function to return table is existed
|
||||
*
|
||||
* @param string $name table name
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
function exists($name)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@ -261,6 +261,11 @@ class TransformationsTest extends TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $value value
|
||||
* @param string $expected expected result
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @dataProvider fixupData
|
||||
*/
|
||||
public function testFixup($value, $expected)
|
||||
@ -271,6 +276,9 @@ class TransformationsTest extends TestCase
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function fixupData()
|
||||
{
|
||||
return array(
|
||||
|
||||
@ -20,6 +20,9 @@ use Samyoul\U2F\U2FServer\SignRequest;
|
||||
*/
|
||||
class TwoFactorTest extends PmaTestCase
|
||||
{
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function setUp()
|
||||
{
|
||||
$GLOBALS['server'] = 1;
|
||||
@ -53,6 +56,9 @@ class TwoFactorTest extends PmaTestCase
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function testNone()
|
||||
{
|
||||
$object = $this->getTwoFactorMock('user', ['type' => 'db']);
|
||||
@ -68,6 +74,9 @@ class TwoFactorTest extends PmaTestCase
|
||||
$this->assertEquals('', $object->setup());
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function testSimple()
|
||||
{
|
||||
$GLOBALS['cfg']['DBG']['simple2fa'] = true;
|
||||
@ -88,6 +97,9 @@ class TwoFactorTest extends PmaTestCase
|
||||
$this->assertEquals('', $object->setup());
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function testLoad()
|
||||
{
|
||||
$object = new TwoFactor('user');
|
||||
@ -95,6 +107,9 @@ class TwoFactorTest extends PmaTestCase
|
||||
$this->assertEquals('', $backend::$id);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function testConfigureSimple()
|
||||
{
|
||||
$GLOBALS['cfg']['DBG']['simple2fa'] = true;
|
||||
@ -110,6 +125,9 @@ class TwoFactorTest extends PmaTestCase
|
||||
$this->assertFalse($object->configure('simple'));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function testApplication()
|
||||
{
|
||||
$object = new TwoFactor('user');
|
||||
@ -150,6 +168,9 @@ class TwoFactorTest extends PmaTestCase
|
||||
$this->assertNotEquals('', $object->setup());
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function testKey()
|
||||
{
|
||||
$object = new TwoFactor('user');
|
||||
@ -188,6 +209,8 @@ class TwoFactorTest extends PmaTestCase
|
||||
|
||||
/**
|
||||
* Test getting AppId
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function testKeyAppId()
|
||||
{
|
||||
@ -211,6 +234,8 @@ class TwoFactorTest extends PmaTestCase
|
||||
/**
|
||||
* Test based on upstream test data:
|
||||
* https://github.com/Yubico/php-u2flib-server
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function testKeyAuthentication()
|
||||
{
|
||||
@ -246,6 +271,8 @@ class TwoFactorTest extends PmaTestCase
|
||||
|
||||
/**
|
||||
* Test listing of available backends.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function testBackends()
|
||||
{
|
||||
|
||||
@ -138,6 +138,8 @@ class UtilTest extends PmaTestCase
|
||||
|
||||
/**
|
||||
* Test for random generation
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function testGenerateRandom()
|
||||
{
|
||||
@ -2049,6 +2051,10 @@ class UtilTest extends PmaTestCase
|
||||
/**
|
||||
* Test for Util::linkOrButton
|
||||
*
|
||||
* @param array $params params
|
||||
* @param int $limit limit
|
||||
* @param string $match match
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @dataProvider linksOrButtons
|
||||
|
||||
@ -1,4 +1,10 @@
|
||||
<?php
|
||||
/* vim: set expandtab sw=4 ts=4 sts=4: */
|
||||
/**
|
||||
* tests for PhpMyAdmin\Utils\HttpRequest class
|
||||
*
|
||||
* @package PhpMyAdmin-test
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace PhpMyAdmin\Tests\Utils;
|
||||
@ -7,10 +13,20 @@ use PhpMyAdmin\Utils\HttpRequest;
|
||||
use PhpMyAdmin\Tests\PmaTestCase;
|
||||
use ReflectionClass;
|
||||
|
||||
/**
|
||||
* Class HttpRequestTest
|
||||
* @package PhpMyAdmin\Tests\Utils
|
||||
*/
|
||||
class HttpRequestTest extends PmaTestCase
|
||||
{
|
||||
/**
|
||||
* @var HttpRequest
|
||||
*/
|
||||
private $httpRequest;
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
protected function setUp()
|
||||
{
|
||||
$this->httpRequest = new HttpRequest();
|
||||
@ -66,6 +82,11 @@ class HttpRequestTest extends PmaTestCase
|
||||
/**
|
||||
* Test for http request using Curl
|
||||
*
|
||||
* @param string $url url
|
||||
* @param string $method method
|
||||
* @param bool $return_only_status return only status
|
||||
* @param bool $expected expected result
|
||||
*
|
||||
* @group medium
|
||||
*
|
||||
* @return void
|
||||
@ -84,6 +105,11 @@ class HttpRequestTest extends PmaTestCase
|
||||
/**
|
||||
* Test for http request using Curl with CURLOPT_CAPATH
|
||||
*
|
||||
* @param string $url url
|
||||
* @param string $method method
|
||||
* @param bool $return_only_status return only status
|
||||
* @param bool $expected expected result
|
||||
*
|
||||
* @group medium
|
||||
*
|
||||
* @return void
|
||||
@ -109,6 +135,11 @@ class HttpRequestTest extends PmaTestCase
|
||||
/**
|
||||
* Test for http request using Curl with CURLOPT_CAINFO
|
||||
*
|
||||
* @param string $url url
|
||||
* @param string $method method
|
||||
* @param bool $return_only_status return only status
|
||||
* @param bool $expected expected result
|
||||
*
|
||||
* @group medium
|
||||
*
|
||||
* @return void
|
||||
@ -134,6 +165,11 @@ class HttpRequestTest extends PmaTestCase
|
||||
/**
|
||||
* Test for http request using fopen
|
||||
*
|
||||
* @param string $url url
|
||||
* @param string $method method
|
||||
* @param bool $return_only_status return only status
|
||||
* @param bool $expected expected result
|
||||
*
|
||||
* @group medium
|
||||
*
|
||||
* @return void
|
||||
@ -155,6 +191,11 @@ class HttpRequestTest extends PmaTestCase
|
||||
/**
|
||||
* Test for http request using generic interface
|
||||
*
|
||||
* @param string $url url
|
||||
* @param string $method method
|
||||
* @param bool $return_only_status return only status
|
||||
* @param bool $expected expected result
|
||||
*
|
||||
* @group medium
|
||||
*
|
||||
* @return void
|
||||
|
||||
@ -19,8 +19,14 @@ use ZipArchive;
|
||||
*/
|
||||
class ZipExtensionTest extends PmaTestCase
|
||||
{
|
||||
/**
|
||||
* @var ZipExtension
|
||||
*/
|
||||
private $zipExtension;
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
protected function setUp()
|
||||
{
|
||||
$this->zipExtension = new ZipExtension();
|
||||
@ -142,6 +148,8 @@ class ZipExtensionTest extends PmaTestCase
|
||||
/**
|
||||
* Helper function to get ZipArchive for content.
|
||||
*
|
||||
* @param mixed $file file
|
||||
*
|
||||
* @return ZipArchive
|
||||
*/
|
||||
private function getZip($file)
|
||||
|
||||
@ -7,6 +7,8 @@
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace PhpMyAdmin\Tests;
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
/**
|
||||
@ -14,14 +16,14 @@ use PHPUnit\Framework\TestCase;
|
||||
*
|
||||
* @package PhpMyAdmin-test
|
||||
*/
|
||||
class PMA_DBI_Test extends TestCase
|
||||
class DummyDbiTest extends TestCase
|
||||
{
|
||||
/**
|
||||
* Configures test parameters.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
function setup()
|
||||
protected function setUp()
|
||||
{
|
||||
$GLOBALS['cfg']['DBG']['sql'] = false;
|
||||
$GLOBALS['cfg']['IconvExtraParams'] = '';
|
||||
@ -7,6 +7,8 @@
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace PhpMyAdmin\Tests;
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
/**
|
||||
@ -16,22 +18,11 @@ use PHPUnit\Framework\TestCase;
|
||||
*/
|
||||
class FilesTest extends TestCase
|
||||
{
|
||||
/**
|
||||
* Sets up the fixture, for example, opens a network connection.
|
||||
* This method is called before a test is executed.
|
||||
*
|
||||
* @access protected
|
||||
* @return void
|
||||
*/
|
||||
public function setUp()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Test for dynamic javascript files
|
||||
*
|
||||
* @param $name string Filename to test
|
||||
* @param $expected string Expected output
|
||||
* @param string $name Filename to test
|
||||
* @param string $expected Expected output
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
@ -8,6 +8,8 @@
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace PhpMyAdmin\Tests;
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
/**
|
||||
@ -16,7 +18,7 @@ use PHPUnit\Framework\TestCase;
|
||||
* @package PhpMyAdmin-test
|
||||
* @group common.lib-tests
|
||||
*/
|
||||
class PMA_GetCheckboxTest extends TestCase
|
||||
class GetCheckboxTest extends TestCase
|
||||
{
|
||||
/**
|
||||
* Test for checkbox.phtml
|
||||
@ -31,6 +31,9 @@ class CreateDropDatabaseTest extends TestBase
|
||||
$this->skipIfNotSuperUser();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function setUpPage()
|
||||
{
|
||||
parent::setUpPage();
|
||||
|
||||
@ -48,6 +48,9 @@ class CreateRemoveUserTest extends TestBase
|
||||
$this->_txtPassword = 'abc_123';
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function setUpPage()
|
||||
{
|
||||
parent::setUpPage();
|
||||
|
||||
@ -30,6 +30,9 @@ class DbOperationsTest extends TestBase
|
||||
$this->login();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
private function _getToDBOperations()
|
||||
{
|
||||
$this->gotoHomepage();
|
||||
|
||||
@ -19,6 +19,9 @@ namespace PhpMyAdmin\Tests\Selenium;
|
||||
*/
|
||||
class LoginTest extends TestBase
|
||||
{
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function setUpPage()
|
||||
{
|
||||
parent::setUpPage();
|
||||
|
||||
@ -19,7 +19,6 @@ namespace PhpMyAdmin\Tests\Selenium;
|
||||
*/
|
||||
class SqlQueryTest extends TestBase
|
||||
{
|
||||
|
||||
/**
|
||||
* Setup the browser environment to run the selenium test case
|
||||
*
|
||||
@ -168,6 +167,9 @@ class SqlQueryTest extends TestBase
|
||||
$this->_testInlineEdit();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
private function _testInlineEdit()
|
||||
{
|
||||
$this->waitForElement('byCssSelector', 'a.inline_edit_sql')->click();
|
||||
|
||||
@ -19,7 +19,9 @@ namespace PhpMyAdmin\Tests\Selenium;
|
||||
*/
|
||||
class TableCreateTest extends TestBase
|
||||
{
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function setUpPage()
|
||||
{
|
||||
parent::setUpPage();
|
||||
|
||||
@ -28,7 +28,7 @@ abstract class TestBase extends Selenium2TestCase
|
||||
* mysqli object
|
||||
*
|
||||
* @access private
|
||||
* @var mysqli
|
||||
* @var \mysqli
|
||||
*/
|
||||
protected $_mysqli;
|
||||
|
||||
@ -620,7 +620,8 @@ abstract class TestBase extends Selenium2TestCase
|
||||
/**
|
||||
* Navigates browser to a database page.
|
||||
*
|
||||
* @param string $database Name of database
|
||||
* @param string $database Name of database
|
||||
* @param bool $gotoHomepageRequired Go to homepage required
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
@ -721,7 +722,7 @@ abstract class TestBase extends Selenium2TestCase
|
||||
/**
|
||||
* Mark unsuccessful tests as 'Failures' on Browerstack
|
||||
*
|
||||
* @param \Throwable $e
|
||||
* @param \Throwable $e Throwable
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
|
||||
@ -19,6 +19,9 @@ namespace PhpMyAdmin\Tests\Selenium;
|
||||
*/
|
||||
class XSSTest extends TestBase
|
||||
{
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function setUpPage()
|
||||
{
|
||||
parent::setUpPage();
|
||||
|
||||
@ -1,4 +1,10 @@
|
||||
<?php
|
||||
/* vim: set expandtab sw=4 ts=4 sts=4: */
|
||||
/**
|
||||
* Styles for CodeMirror editor for the Metro theme
|
||||
*
|
||||
* @package PhpMyAdmin-theme
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
// unplanned execution path
|
||||
|
||||
@ -1,4 +1,10 @@
|
||||
<?php
|
||||
/* vim: set expandtab sw=4 ts=4 sts=4: */
|
||||
/**
|
||||
* Common styles for the Metro theme
|
||||
*
|
||||
* @package PhpMyAdmin-theme
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
// unplanned execution path
|
||||
|
||||
@ -1,4 +1,10 @@
|
||||
<?php
|
||||
/* vim: set expandtab sw=4 ts=4 sts=4: */
|
||||
/**
|
||||
* Designer styles for the Metro theme
|
||||
*
|
||||
* @package PhpMyAdmin-theme
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
// unplanned execution path
|
||||
|
||||
@ -1,4 +1,10 @@
|
||||
<?php
|
||||
/* vim: set expandtab sw=4 ts=4 sts=4: */
|
||||
/**
|
||||
* ENUM editor styles for the Metro theme
|
||||
*
|
||||
* @package PhpMyAdmin-theme
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
// unplanned execution path
|
||||
|
||||
@ -1,4 +1,10 @@
|
||||
<?php
|
||||
/* vim: set expandtab sw=4 ts=4 sts=4: */
|
||||
/**
|
||||
* GIS styles for the Metro theme
|
||||
*
|
||||
* @package PhpMyAdmin-theme
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
// unplanned execution path
|
||||
|
||||
@ -1,4 +1,10 @@
|
||||
<?php
|
||||
/* vim: set expandtab sw=4 ts=4 sts=4: */
|
||||
/**
|
||||
* Styles for jqplot for the Metro theme
|
||||
*
|
||||
* @package PhpMyAdmin-theme
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
// unplanned execution path
|
||||
|
||||
@ -1,4 +1,10 @@
|
||||
<?php
|
||||
/* vim: set expandtab sw=4 ts=4 sts=4: */
|
||||
/**
|
||||
* Navigation styles for the Metro theme
|
||||
*
|
||||
* @package PhpMyAdmin-theme
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
// unplanned execution path
|
||||
|
||||
@ -1,4 +1,12 @@
|
||||
<?php
|
||||
/* vim: set expandtab sw=4 ts=4 sts=4: */
|
||||
/**
|
||||
* Styles for the resizable menus
|
||||
*
|
||||
* used by js/vendor/jquery/jquery.menuResizer-1.0.js
|
||||
*
|
||||
* @package PhpMyAdmin-theme
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
// unplanned execution path
|
||||
|
||||
@ -1,4 +1,11 @@
|
||||
<?php
|
||||
/* vim: set expandtab sw=4 ts=4 sts=4: */
|
||||
/**
|
||||
* Styles for management of Routines, Triggers and Events
|
||||
* for the Metro theme
|
||||
*
|
||||
* @package PhpMyAdmin-theme
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
// unplanned execution path
|
||||
|
||||
@ -1,4 +1,11 @@
|
||||
<?php
|
||||
/* vim: set expandtab sw=4 ts=4 sts=4: */
|
||||
/**
|
||||
* configures general layout
|
||||
* for detailed layout configuration please refer to the css files
|
||||
*
|
||||
* @package PhpMyAdmin-theme
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
$GLOBALS['cfg']['NaviWidth'] = '250';
|
||||
|
||||
Loading…
Reference in New Issue
Block a user