Fix methods and properties visibility issues

Signed-off-by: Maurício Meneghini Fauth <mauriciofauth@gmail.com>
This commit is contained in:
Maurício Meneghini Fauth 2018-05-30 21:02:26 -03:00
parent 285e38e931
commit 2005cca77f
143 changed files with 362 additions and 356 deletions

View File

@ -61,7 +61,7 @@ class ServerCollationsController extends Controller
*
* @return string
*/
function _getHtmlForCharsets(
public function _getHtmlForCharsets(
array $mysqlCharsets,
array $mysqlCollations,
array $mysqlCharsetsDesc,

View File

@ -432,7 +432,7 @@ class ServerDatabasesController extends Controller
*
* @return string $column_order, $out
*/
function _buildHtmlForDb(
public function _buildHtmlForDb(
array $current,
array $column_order,
array $replication_types,

View File

@ -643,7 +643,7 @@ class TableSearchController extends TableController
*
* @return string HTML for previewing strings found and their replacements
*/
function getReplacePreview(
public function getReplacePreview(
$columnIndex,
$find,
$replaceWith,

View File

@ -3015,7 +3015,7 @@ class DatabaseInterface
*
* @return string $server_collation
*/
function getServerCollation(): string
public function getServerCollation(): string
{
return $this->fetchValue('SELECT @@collation_server');
}

View File

@ -34,7 +34,7 @@ class DbiDummy implements DbiExtension
/**
* @var int
*/
const OFFSET_GLOBAL = 1000;
public const OFFSET_GLOBAL = 1000;
/**
* DbiDummy constructor.

View File

@ -35,55 +35,55 @@ use PhpMyAdmin\Util;
class Results
{
// Define constants
const NO_EDIT_OR_DELETE = 'nn';
const UPDATE_ROW = 'ur';
const DELETE_ROW = 'dr';
const KILL_PROCESS = 'kp';
public const NO_EDIT_OR_DELETE = 'nn';
public const UPDATE_ROW = 'ur';
public const DELETE_ROW = 'dr';
public const KILL_PROCESS = 'kp';
const POSITION_LEFT = 'left';
const POSITION_RIGHT = 'right';
const POSITION_BOTH = 'both';
const POSITION_NONE = 'none';
public const POSITION_LEFT = 'left';
public const POSITION_RIGHT = 'right';
public const POSITION_BOTH = 'both';
public const POSITION_NONE = 'none';
const PLACE_TOP_DIRECTION_DROPDOWN = 'top_direction_dropdown';
const PLACE_BOTTOM_DIRECTION_DROPDOWN = 'bottom_direction_dropdown';
public const PLACE_TOP_DIRECTION_DROPDOWN = 'top_direction_dropdown';
public const PLACE_BOTTOM_DIRECTION_DROPDOWN = 'bottom_direction_dropdown';
const DISPLAY_FULL_TEXT = 'F';
const DISPLAY_PARTIAL_TEXT = 'P';
public const DISPLAY_FULL_TEXT = 'F';
public const DISPLAY_PARTIAL_TEXT = 'P';
const HEADER_FLIP_TYPE_AUTO = 'auto';
const HEADER_FLIP_TYPE_CSS = 'css';
const HEADER_FLIP_TYPE_FAKE = 'fake';
public const HEADER_FLIP_TYPE_AUTO = 'auto';
public const HEADER_FLIP_TYPE_CSS = 'css';
public const HEADER_FLIP_TYPE_FAKE = 'fake';
const DATE_FIELD = 'date';
const DATETIME_FIELD = 'datetime';
const TIMESTAMP_FIELD = 'timestamp';
const TIME_FIELD = 'time';
const STRING_FIELD = 'string';
const GEOMETRY_FIELD = 'geometry';
const BLOB_FIELD = 'BLOB';
const BINARY_FIELD = 'BINARY';
public const DATE_FIELD = 'date';
public const DATETIME_FIELD = 'datetime';
public const TIMESTAMP_FIELD = 'timestamp';
public const TIME_FIELD = 'time';
public const STRING_FIELD = 'string';
public const GEOMETRY_FIELD = 'geometry';
public const BLOB_FIELD = 'BLOB';
public const BINARY_FIELD = 'BINARY';
const RELATIONAL_KEY = 'K';
const RELATIONAL_DISPLAY_COLUMN = 'D';
public const RELATIONAL_KEY = 'K';
public const RELATIONAL_DISPLAY_COLUMN = 'D';
const GEOMETRY_DISP_GEOM = 'GEOM';
const GEOMETRY_DISP_WKT = 'WKT';
const GEOMETRY_DISP_WKB = 'WKB';
public const GEOMETRY_DISP_GEOM = 'GEOM';
public const GEOMETRY_DISP_WKT = 'WKT';
public const GEOMETRY_DISP_WKB = 'WKB';
const SMART_SORT_ORDER = 'SMART';
const ASCENDING_SORT_DIR = 'ASC';
const DESCENDING_SORT_DIR = 'DESC';
public const SMART_SORT_ORDER = 'SMART';
public const ASCENDING_SORT_DIR = 'ASC';
public const DESCENDING_SORT_DIR = 'DESC';
const TABLE_TYPE_INNO_DB = 'InnoDB';
const ALL_ROWS = 'all';
const QUERY_TYPE_SELECT = 'SELECT';
public const TABLE_TYPE_INNO_DB = 'InnoDB';
public const ALL_ROWS = 'all';
public const QUERY_TYPE_SELECT = 'SELECT';
const ROUTINE_PROCEDURE = 'procedure';
const ROUTINE_FUNCTION = 'function';
public const ROUTINE_PROCEDURE = 'procedure';
public const ROUTINE_FUNCTION = 'function';
const ACTION_LINK_CONTENT_ICONS = 'icons';
const ACTION_LINK_CONTENT_TEXT = 'text';
public const ACTION_LINK_CONTENT_ICONS = 'icons';
public const ACTION_LINK_CONTENT_TEXT = 'text';
// Declare global fields

View File

@ -23,11 +23,11 @@ use PhpMyAdmin\Util;
*/
class Index
{
const PRIMARY = 1;
const UNIQUE = 2;
const INDEX = 4;
const SPATIAL = 8;
const FULLTEXT = 16;
public const PRIMARY = 1;
public const UNIQUE = 2;
public const INDEX = 4;
public const SPATIAL = 8;
public const FULLTEXT = 16;
/**
* Class-wide storage container for indexes (caching, singleton)

View File

@ -23,11 +23,11 @@ class Node
/**
* @var int Defines a possible node type
*/
const CONTAINER = 0;
public const CONTAINER = 0;
/**
* @var int Defines a possible node type
*/
const OBJECT = 1;
public const OBJECT = 1;
/**
* @var string A non-unique identifier for the node
* This may be trimmed when grouping nodes

View File

@ -19,7 +19,7 @@ use PhpMyAdmin\ZipExtension;
class OpenDocument
{
const NS = <<<EOT
public const NS = <<<EOT
xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0"
xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0"
xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0"

View File

@ -23,13 +23,13 @@ use TCPDF_FONTS;
*/
class Pdf extends TCPDF
{
var $footerset;
var $Alias = [];
public $footerset;
public $Alias = [];
/**
* PDF font to use.
*/
const PMA_PDF_FONT = 'DejaVuSans';
public const PMA_PDF_FONT = 'DejaVuSans';
/**
* Constructs PDF and configures standard parameters.

View File

@ -25,8 +25,8 @@ use TCPDF_STATIC;
*/
class Pdf extends PdfLib
{
var $tablewidths;
var $headerset;
public $tablewidths;
public $headerset;
/**
* @var Relation $relation

View File

@ -41,15 +41,15 @@ class Pdf extends PdfLib
/**
* Defines properties
*/
var $_xMin;
var $_yMin;
var $leftMargin = 10;
var $topMargin = 10;
var $scale;
var $PMA_links;
var $Outlines = [];
var $def_outlines;
var $widths;
public $_xMin;
public $_yMin;
public $leftMargin = 10;
public $topMargin = 10;
public $scale;
public $PMA_links;
public $Outlines = [];
public $def_outlines;
public $widths;
private $_ff = PdfLib::PMA_PDF_FONT;
private $_offline;
private $_pageNumber;

View File

@ -25,10 +25,12 @@ abstract class RelationStats
/**
* Defines properties
*/
public $xSrc, $ySrc;
public $xSrc;
public $ySrc;
public $srcDir;
public $destDir;
public $xDest, $yDest;
public $xDest;
public $yDest;
public $wTick;
/**

View File

@ -36,7 +36,7 @@ use PhpMyAdmin\Relation;
class SvgRelationSchema extends ExportRelationSchema
{
/**
* @var PhpMyAdmin\Plugins\Schema\Dia\TableStatsDia[]|TableStatsEps[]|TableStatsPdf[]|TableStatsSvg[]
* @var \PhpMyAdmin\Plugins\Schema\Dia\TableStatsDia[]|TableStatsEps[]|TableStatsPdf[]|TableStatsSvg[]
*/
private $_tables = [];
/** @var RelationStatsDia[] Relations */
@ -57,7 +57,7 @@ class SvgRelationSchema extends ExportRelationSchema
*
* @see PMA_SVG
*/
function __construct($db)
public function __construct($db)
{
parent::__construct($db, new Svg());

View File

@ -35,7 +35,8 @@ abstract class TableStats
public $displayfield;
public $fields = [];
public $primary = [];
public $x, $y;
public $x;
public $y;
public $width = 0;
public $heightCell = 0;
protected $offline;

View File

@ -449,16 +449,15 @@ class Response
break;
case JSON_ERROR_UNSUPPORTED_TYPE:
$error = 'A value of a type that cannot be encoded was given';
break;
default:
$error = 'Unknown error';
break;
}
echo json_encode(
[
'success' => false,
'error' => 'JSON encoding failed: ' . $error,
]
);
echo json_encode([
'success' => false,
'error' => 'JSON encoding failed: ' . $error,
]);
} else {
echo $result;
}

View File

@ -46,23 +46,23 @@ class StorageEngine
/**
* @var string engine name
*/
var $engine = 'dummy';
public $engine = 'dummy';
/**
* @var string engine title/description
*/
var $title = 'PMA Dummy Engine Class';
public $title = 'PMA Dummy Engine Class';
/**
* @var string engine lang description
*/
var $comment
public $comment
= 'If you read this text inside phpMyAdmin, something went wrong...';
/**
* @var integer engine supported by current server
*/
var $support = PMA_ENGINE_SUPPORT_NO;
public $support = PMA_ENGINE_SUPPORT_NO;
/**
* Constructor

View File

@ -22,7 +22,7 @@ use PhpMyAdmin\SysInfoBase;
*/
class SysInfo
{
const MEMORY_REGEXP = '/^(MemTotal|MemFree|Cached|Buffers|SwapCached|SwapTotal|SwapFree):\s+(.*)\s*kB/im';
public const MEMORY_REGEXP = '/^(MemTotal|MemFree|Cached|Buffers|SwapCached|SwapTotal|SwapFree):\s+(.*)\s*kB/im';
/**
* Returns OS type used for sysinfo class

View File

@ -26,7 +26,7 @@ class SysInfoLinux extends SysInfoBase
*
* @return array with load data
*/
function loadavg()
public function loadavg()
{
$buf = file_get_contents('/proc/stat');
$nums = preg_split(
@ -59,7 +59,7 @@ class SysInfoLinux extends SysInfoBase
*
* @return array with memory usage data
*/
function memory()
public function memory()
{
preg_match_all(
SysInfo::MEMORY_REGEXP,

View File

@ -41,7 +41,7 @@ class SysInfoWINNT extends SysInfoBase
*
* @return array with load data
*/
function loadavg()
public function loadavg()
{
$loadavg = "";
$sum = 0;
@ -101,7 +101,7 @@ class SysInfoWINNT extends SysInfoBase
*
* @return array with memory usage data
*/
function memory()
public function memory()
{
$buffer = $this->_getWMI(
"Win32_OperatingSystem",

View File

@ -36,7 +36,7 @@ class SystemDatabase
* @param DatabaseInterface $dbi Database interface for the system database
*
*/
function __construct(DatabaseInterface $dbi)
public function __construct(DatabaseInterface $dbi)
{
$this->dbi = $dbi;
$this->relation = new Relation();
@ -76,7 +76,7 @@ class SystemDatabase
*
* @return string $new_transformations_sql SQL query for new transformations
*/
function getNewTransformationDataSql(
public function getNewTransformationDataSql(
$pma_transformation_data,
array $column_map,
$view_name,

View File

@ -34,34 +34,34 @@ class Table
/**
* UI preferences properties
*/
const PROP_SORTED_COLUMN = 'sorted_col';
const PROP_COLUMN_ORDER = 'col_order';
const PROP_COLUMN_VISIB = 'col_visib';
public const PROP_SORTED_COLUMN = 'sorted_col';
public const PROP_COLUMN_ORDER = 'col_order';
public const PROP_COLUMN_VISIB = 'col_visib';
/**
* @var string engine (innodb, myisam, bdb, ...)
*/
var $engine = '';
public $engine = '';
/**
* @var string type (view, base table, system view)
*/
var $type = '';
public $type = '';
/**
* @var array UI preferences
*/
var $uiprefs;
public $uiprefs;
/**
* @var array errors occurred
*/
var $errors = [];
public $errors = [];
/**
* @var array messages
*/
var $messages = [];
public $messages = [];
/**
* @var string table name
@ -482,7 +482,7 @@ class Table
*
* @return string field specification
*/
static function generateFieldSpec(
public static function generateFieldSpec(
$name,
$type,
$length = '',
@ -1451,7 +1451,7 @@ class Table
*
* @return boolean whether the string is valid or not
*/
static function isValidName($table_name, $is_backquoted = false)
public static function isValidName($table_name, $is_backquoted = false)
{
if ($table_name !== rtrim($table_name)) {
// trailing spaces not allowed even in backquotes

View File

@ -47,7 +47,7 @@ class Template
*/
static protected $twig;
const BASE_PATH = 'templates/';
public const BASE_PATH = 'templates/';
/**
* Template constructor

View File

@ -28,37 +28,37 @@ class Theme
* @var string theme version
* @access protected
*/
var $version = '0.0.0.0';
public $version = '0.0.0.0';
/**
* @var string theme name
* @access protected
*/
var $name = '';
public $name = '';
/**
* @var string theme id
* @access protected
*/
var $id = '';
public $id = '';
/**
* @var string theme path
* @access protected
*/
var $path = '';
public $path = '';
/**
* @var string image path
* @access protected
*/
var $img_path = '';
public $img_path = '';
/**
* @var integer last modification time for info file
* @access protected
*/
var $mtime_info = 0;
public $mtime_info = 0;
/**
* needed because sometimes, the mtime for different themes
@ -66,13 +66,13 @@ class Theme
* @var integer filesize for info file
* @access protected
*/
var $filesize_info = 0;
public $filesize_info = 0;
/**
* @var array List of css files to load
* @access private
*/
private $_cssFiles = [
public $_cssFiles = [
'common',
'enum_editor',
'gis',
@ -91,7 +91,7 @@ class Theme
* @return boolean whether loading them info was successful or not
* @access public
*/
function loadInfo()
public function loadInfo()
{
$infofile = $this->getPath() . '/theme.json';
if (! @file_exists($infofile)) {
@ -425,7 +425,7 @@ class Theme
*
* @return string CSS code.
*/
function getCssGradient($start_color, $end_color)
public function getCssGradient($start_color, $end_color)
{
$result = [];
// Opera 9.5+, IE 9

View File

@ -37,37 +37,37 @@ class ThemeManager
/**
* @var array available themes
*/
var $themes = [];
public $themes = [];
/**
* @var string cookie name
*/
var $cookie_name = 'pma_theme';
public $cookie_name = 'pma_theme';
/**
* @var boolean
*/
var $per_server = false;
public $per_server = false;
/**
* @var string name of active theme
*/
var $active_theme = '';
public $active_theme = '';
/**
* @var Theme Theme active theme
*/
var $theme = null;
public $theme = null;
/**
* @var string
*/
var $theme_default;
public $theme_default;
/**
* @const string The name of the fallback theme
*/
const FALLBACK_THEME = 'pmahomme';
public const FALLBACK_THEME = 'pmahomme';
/**
* Constructor for Theme Manager class

View File

@ -2077,7 +2077,7 @@ class Util
*
* @return string
*/
static function getCharsetQueryPart($collation, $override = false)
public static function getCharsetQueryPart($collation, $override = false)
{
list($charset) = explode('_', $collation);
$keyword = ' CHARSET=';

View File

@ -28,7 +28,7 @@ class AdvisorTest extends PmaTestCase
*
* @return void
*/
public function setup()
protected function setUp()
{
$GLOBALS['PMA_Config'] = new Config();
$GLOBALS['server'] = 1;

View File

@ -26,7 +26,7 @@ class BookmarkTest extends TestCase
* @access protected
* @return void
*/
public function setUp()
protected function setUp()
{
$GLOBALS['cfg']['Server']['user'] = 'root';
$GLOBALS['cfg']['Server']['pmadb'] = 'phpmyadmin';

View File

@ -57,7 +57,7 @@ class BrowseForeignersTest extends TestCase
*
* @return void
*/
function testGetForeignLimit()
public function testGetForeignLimit()
{
$this->assertNull(
$this->browseForeigners->getForeignLimit('Show all')
@ -99,7 +99,7 @@ class BrowseForeignersTest extends TestCase
*
* @return void
*/
function testGetHtmlForGotoPage()
public function testGetHtmlForGotoPage()
{
$this->assertEquals(
'',
@ -160,7 +160,7 @@ class BrowseForeignersTest extends TestCase
*
* @return void
*/
function testGetDescriptionAndTitle()
public function testGetDescriptionAndTitle()
{
$desc = 'foobar<baz';
@ -189,7 +189,7 @@ class BrowseForeignersTest extends TestCase
*
* @return void
*/
function testGetHtmlForRelationalFieldSelection()
public function testGetHtmlForRelationalFieldSelection()
{
$db = '';
$table = '';

View File

@ -71,7 +71,7 @@ class CentralColumnsTest extends TestCase
*
* @return void
*/
public function setUp()
protected function setUp()
{
$GLOBALS['PMA_Config'] = new Config();
$GLOBALS['cfg']['Server']['user'] = 'pma_user';
@ -203,7 +203,7 @@ class CentralColumnsTest extends TestCase
*
* @return void
*/
function testGetCount()
public function testGetCount()
{
$GLOBALS['dbi']->expects($this->once())
->method('fetchResult')

View File

@ -22,7 +22,7 @@ class CharsetsTest extends TestCase
/**
* @return void
*/
public function setUp()
protected function setUp()
{
$GLOBALS['cfg']['DBG']['sql'] = false;
$GLOBALS['cfg']['Server']['DisableIS'] = false;

View File

@ -24,7 +24,7 @@ class ConfigFileTest extends PmaTestCase
* Any valid key that exists in config.default.php and isn't empty
* @var string
*/
const SIMPLE_KEY_WITH_DEFAULT_VALUE = 'DefaultQueryTable';
public const SIMPLE_KEY_WITH_DEFAULT_VALUE = 'DefaultQueryTable';
/**
* Object under test

View File

@ -25,7 +25,7 @@ class DescriptionTest extends PmaTestCase
*
* @return void
*/
public function setUp()
protected function setUp()
{
$GLOBALS['PMA_Config'] = new Config();
}

View File

@ -26,7 +26,7 @@ class FormDisplayTemplateTest extends TestCase
*
* @return void
*/
public function setUp()
protected function setUp()
{
$GLOBALS['PMA_Config'] = new Config();
}

View File

@ -34,7 +34,7 @@ class FormDisplayTest extends PmaTestCase
*
* @return void
*/
function setup()
protected function setUp()
{
$GLOBALS['pmaThemePath'] = $GLOBALS['PMA_Theme']->getPath();
$GLOBALS['PMA_Config'] = new Config();

View File

@ -33,7 +33,7 @@ class FormTest extends PmaTestCase
*
* @return void
*/
function setup()
protected function setUp()
{
$GLOBALS['pmaThemePath'] = $GLOBALS['PMA_Theme']->getPath();
$GLOBALS['PMA_Config'] = new Config();

View File

@ -26,7 +26,7 @@ class FormListTest extends PmaTestCase
/**
* @return void
*/
public function setUp()
protected function setUp()
{
$GLOBALS['PMA_Config'] = new Config();
$GLOBALS['server'] = 1;

View File

@ -25,7 +25,7 @@ class PageSettingsTest extends PmaTestCase
*
* @return void
*/
public function setUp()
protected function setUp()
{
$GLOBALS['PMA_Config'] = new Config();
$GLOBALS['server'] = 1;
@ -85,7 +85,7 @@ class PageSettingsTest extends PmaTestCase
*
* @return void
*/
function testGetNaviSettings()
public function testGetNaviSettings()
{
$html = PageSettings::getNaviSettings();

View File

@ -32,7 +32,7 @@ class ServeConfigChecksTest extends PmaTestCase
*
* @return void
*/
public function setUp()
protected function setUp()
{
$GLOBALS['PMA_Config'] = new Config();
$GLOBALS['cfg']['AvailableCharsets'] = [];

View File

@ -37,7 +37,7 @@ class DatabaseStructureControllerTest extends PmaTestCase
*
* @return void
*/
public function setUp()
protected function setUp()
{
//$_REQUEST
$_REQUEST['log'] = "index1";

View File

@ -29,7 +29,7 @@ class ServerBinlogControllerTest extends PmaTestCase
*
* @return void
*/
public function setUp()
protected function setUp()
{
//$_REQUEST
$_REQUEST['log'] = "index1";

View File

@ -29,7 +29,7 @@ class ServerCollationsControllerTest extends PmaTestCase
*
* @return void
*/
public function setUp()
protected function setUp()
{
//$_REQUEST
$_REQUEST['log'] = 'index1';

View File

@ -28,7 +28,7 @@ class ServerDatabasesControllerTest extends PmaTestCase
*
* @return void
*/
public function setUp()
protected function setUp()
{
//$_REQUEST
$_REQUEST['log'] = "index1";

View File

@ -36,7 +36,7 @@ class ServerEnginesControllerTest extends PmaTestCase
*
* @return void
*/
public function setUp()
protected function setUp()
{
//$_REQUEST
$_REQUEST['log'] = "index1";

View File

@ -28,7 +28,7 @@ class ServerPluginsControllerTest extends PmaTestCase
*
* @return void
*/
public function setUp()
protected function setUp()
{
//$_REQUEST
$_REQUEST['log'] = "index1";

View File

@ -35,7 +35,7 @@ class ServerVariablesControllerTest extends PmaTestCase
*
* @return void
*/
public function setUp()
protected function setUp()
{
//$_REQUEST
$_REQUEST['log'] = "index1";

View File

@ -36,7 +36,7 @@ class TableStructureControllerTest extends PmaTestCase
*
* @return void
*/
public function setUp()
protected function setUp()
{
//$_REQUEST
$_REQUEST['log'] = "index1";

View File

@ -46,7 +46,7 @@ class CoreTest extends PmaTestCase
*
* @return void
*/
public function setUp()
protected function setUp()
{
$GLOBALS['server'] = 0;
$GLOBALS['db'] = '';
@ -59,7 +59,7 @@ class CoreTest extends PmaTestCase
*
* @return void
*/
function testArrayRead()
public function testArrayRead()
{
$arr = [
"int" => 1,
@ -147,7 +147,7 @@ class CoreTest extends PmaTestCase
*
* @return void
*/
function testArrayWrite()
public function testArrayWrite()
{
$arr = [
"int" => 1,
@ -201,7 +201,7 @@ class CoreTest extends PmaTestCase
*
* @return void
*/
function testArrayRemove()
public function testArrayRemove()
{
$arr = [
"int" => 1,
@ -269,7 +269,7 @@ class CoreTest extends PmaTestCase
*
* @dataProvider providerTestGotoNowhere
*/
function testGotoNowhere($page, $whiteList, $expected)
public function testGotoNowhere($page, $whiteList, $expected)
{
$this->assertSame($expected, Core::checkPageValidity($page, $whiteList));
}
@ -634,7 +634,7 @@ class CoreTest extends PmaTestCase
*
* @dataProvider provideTestIsAllowedDomain
*/
function testIsAllowedDomain($url, $expected)
public function testIsAllowedDomain($url, $expected)
{
$_SERVER['SERVER_NAME'] = 'server.local';
$this->assertEquals(
@ -648,7 +648,7 @@ class CoreTest extends PmaTestCase
*
* @return array
*/
function provideTestIsAllowedDomain()
public function provideTestIsAllowedDomain()
{
return [
['https://www.phpmyadmin.net/', true],
@ -996,7 +996,7 @@ class CoreTest extends PmaTestCase
*
* @dataProvider provideTestSafeUnserialize
*/
function testSafeUnserialize($data, $expected)
public function testSafeUnserialize($data, $expected)
{
$this->assertEquals(
$expected,
@ -1009,7 +1009,7 @@ class CoreTest extends PmaTestCase
*
* @return array
*/
function provideTestSafeUnserialize()
public function provideTestSafeUnserialize()
{
return [
['s:6:"foobar";', 'foobar'],
@ -1035,7 +1035,7 @@ class CoreTest extends PmaTestCase
*
* @dataProvider provideTestSanitizeMySQLHost
*/
function testSanitizeMySQLHost($host, $expected)
public function testSanitizeMySQLHost($host, $expected)
{
$this->assertEquals(
$expected,
@ -1048,7 +1048,7 @@ class CoreTest extends PmaTestCase
*
* @return array
*/
function provideTestSanitizeMySQLHost()
public function provideTestSanitizeMySQLHost()
{
return [
['p:foo.bar', 'foo.bar'],
@ -1084,7 +1084,7 @@ class CoreTest extends PmaTestCase
*
* @return void
*/
function testMissingExtensionFatal()
public function testMissingExtensionFatal()
{
$ext = 'php_ext';
$warn = 'The <a href="' . Core::getPHPDocLink('book.' . $ext . '.php')
@ -1101,7 +1101,7 @@ class CoreTest extends PmaTestCase
*
* @return void
*/
function testMissingExtensionFatalWithExtra()
public function testMissingExtensionFatalWithExtra()
{
$ext = 'php_ext';
$extra = 'Appended Extra String';

View File

@ -31,7 +31,7 @@ class ChangePasswordTest extends TestCase
*
* @return void
*/
public function setUp()
protected function setUp()
{
//$GLOBALS
$GLOBALS['PMA_Config'] = new Config();

View File

@ -29,7 +29,7 @@ class CreateTableTest extends TestCase
*
* @return void
*/
public function setUp()
protected function setUp()
{
//$GLOBALS
$GLOBALS['server'] = 0;

View File

@ -34,7 +34,7 @@ class ExportTest extends TestCase
*
* @return void
*/
public function setUp()
protected function setUp()
{
//$GLOBALS
$GLOBALS['cfg']['MaxRows'] = 10;

View File

@ -22,7 +22,7 @@ class EncodingTest extends TestCase
/**
* @return void
*/
public function setUp()
protected function setUp()
{
Encoding::initEngine();
}

View File

@ -24,7 +24,7 @@ class FileTest extends PmaTestCase
*
* @return void
*/
public function setup()
protected function setUp()
{
$GLOBALS['charset_conversion'] = false;
}

View File

@ -38,7 +38,7 @@ class FontTest extends PmaTestCase
*
* @return void
*/
function testGetStringWidth()
public function testGetStringWidth()
{
// empty string
$this->assertEquals(
@ -160,7 +160,7 @@ class FontTest extends PmaTestCase
*
* @return void
*/
function testGetStringWidthFont()
public function testGetStringWidthFont()
{
// string "phpMyAdmin", with Arial 10
$this->assertEquals(
@ -192,7 +192,7 @@ class FontTest extends PmaTestCase
*
* @return void
*/
function testGetStringWidthSize()
public function testGetStringWidthSize()
{
// string "phpMyAdmin", with font size 0
$this->assertEquals(
@ -224,7 +224,7 @@ class FontTest extends PmaTestCase
*
* @return void
*/
function testGetStringWidthCharLists()
public function testGetStringWidthCharLists()
{
// string "a", with invalid charlist (= array without proper structure)
$this->assertEquals(

View File

@ -28,7 +28,7 @@ class HeaderTest extends PmaTestCase
*
* @return void
*/
function setup()
protected function setUp()
{
if (!defined('PMA_IS_WINDOWS')) {
define('PMA_IS_WINDOWS', false);

View File

@ -32,7 +32,7 @@ class ImportTest extends TestCase
*
* @return void
*/
public function setUp()
protected function setUp()
{
$GLOBALS['server'] = 0;
$GLOBALS['cfg']['ServerDefault'] = '';
@ -44,7 +44,7 @@ class ImportTest extends TestCase
*
* @return void
*/
function testCheckTimeout()
public function testCheckTimeout()
{
global $timestamp, $maximum_time, $timeout_passed;
@ -89,7 +89,7 @@ class ImportTest extends TestCase
*
* @return void
*/
function testLookForUse()
public function testLookForUse()
{
$this->assertEquals(
[null, null],
@ -137,7 +137,7 @@ class ImportTest extends TestCase
*
* @dataProvider provGetColumnAlphaName
*/
function testGetColumnAlphaName($expected, $num)
public function testGetColumnAlphaName($expected, $num)
{
$this->assertEquals($expected, $this->import->getColumnAlphaName($num));
}
@ -147,7 +147,7 @@ class ImportTest extends TestCase
*
* @return array
*/
function provGetColumnAlphaName()
public function provGetColumnAlphaName()
{
return [
['A', 1],
@ -169,7 +169,7 @@ class ImportTest extends TestCase
*
* @dataProvider provGetColumnNumberFromName
*/
function testGetColumnNumberFromName($expected, $name)
public function testGetColumnNumberFromName($expected, $name)
{
$this->assertEquals($expected, $this->import->getColumnNumberFromName($name));
}
@ -179,7 +179,7 @@ class ImportTest extends TestCase
*
* @return array
*/
function provGetColumnNumberFromName()
public function provGetColumnNumberFromName()
{
return [
[1, 'A'],
@ -201,7 +201,7 @@ class ImportTest extends TestCase
*
* @dataProvider provGetDecimalPrecision
*/
function testGetDecimalPrecision($expected, $size)
public function testGetDecimalPrecision($expected, $size)
{
$this->assertEquals($expected, $this->import->getDecimalPrecision($size));
}
@ -211,7 +211,7 @@ class ImportTest extends TestCase
*
* @return array
*/
function provGetDecimalPrecision()
public function provGetDecimalPrecision()
{
return [
[2, '2,1'],
@ -231,7 +231,7 @@ class ImportTest extends TestCase
*
* @dataProvider provGetDecimalScale
*/
function testGetDecimalScale($expected, $size)
public function testGetDecimalScale($expected, $size)
{
$this->assertEquals($expected, $this->import->getDecimalScale($size));
}
@ -241,7 +241,7 @@ class ImportTest extends TestCase
*
* @return array
*/
function provGetDecimalScale()
public function provGetDecimalScale()
{
return [
[1, '2,1'],
@ -261,7 +261,7 @@ class ImportTest extends TestCase
*
* @dataProvider provGetDecimalSize
*/
function testGetDecimalSize($expected, $cell)
public function testGetDecimalSize($expected, $cell)
{
$this->assertEquals($expected, $this->import->getDecimalSize($cell));
}
@ -271,7 +271,7 @@ class ImportTest extends TestCase
*
* @return array
*/
function provGetDecimalSize()
public function provGetDecimalSize()
{
return [
[[2, 1, '2,1'], '2.1'],
@ -294,7 +294,7 @@ class ImportTest extends TestCase
*
* @dataProvider provDetectType
*/
function testDetectType($expected, $type, $cell)
public function testDetectType($expected, $type, $cell)
{
$this->assertEquals($expected, $this->import->detectType($type, $cell));
}
@ -304,7 +304,7 @@ class ImportTest extends TestCase
*
* @return array
*/
function provDetectType()
public function provDetectType()
{
return [
[Import::NONE, null, 'NULL'],
@ -328,7 +328,7 @@ class ImportTest extends TestCase
*
* @return void
*/
function testPMAGetMatchedRows()
public function testPMAGetMatchedRows()
{
$GLOBALS['db'] = 'PMA';
//mock DBI
@ -379,7 +379,7 @@ class ImportTest extends TestCase
*
* @return void
*/
function simulatedQueryTest($sql_query, $simulated_query)
public function simulatedQueryTest($sql_query, $simulated_query)
{
$parser = new Parser($sql_query);
$analyzed_sql_results = [
@ -414,7 +414,7 @@ class ImportTest extends TestCase
*
* @return void
*/
function testPMACheckIfRollbackPossible()
public function testPMACheckIfRollbackPossible()
{
$GLOBALS['db'] = 'PMA';
//mock DBI

View File

@ -26,7 +26,7 @@ class IndexTest extends PmaTestCase
*
* @return void
*/
public function setup()
protected function setUp()
{
$this->_params['Schema'] = "PMA_Schema";
$this->_params['Table'] = "PMA_Table";

View File

@ -34,7 +34,7 @@ class InsertEditTest extends TestCase
*
* @return void
*/
public function setup()
protected function setUp()
{
$GLOBALS['server'] = 1;
$GLOBALS['PMA_PHP_SELF'] = 'index.php';

View File

@ -29,7 +29,7 @@ class LanguageTest extends PmaTestCase
*
* @return void
*/
public function setup()
protected function setUp()
{
$loc = LOCALE_PATH . '/cs/LC_MESSAGES/phpmyadmin.mo';
if (! is_readable($loc)) {

View File

@ -28,7 +28,7 @@ class ListDatabaseTest extends PmaTestCase
*
* @return void
*/
public function setup()
protected function setUp()
{
$GLOBALS['cfg']['Server']['only_db'] = ['single\\_db'];
$this->object = new ListDatabase();

View File

@ -25,7 +25,7 @@ class MenuTest extends PmaTestCase
*
* @return void
*/
function setup()
protected function setUp()
{
if (!defined('PMA_IS_WINDOWS')) {
define('PMA_IS_WINDOWS', false);
@ -45,7 +45,7 @@ class MenuTest extends PmaTestCase
*
* @return void
*/
function testServer()
public function testServer()
{
$menu = new Menu('server', '', '');
$this->assertContains(
@ -59,7 +59,7 @@ class MenuTest extends PmaTestCase
*
* @return void
*/
function testDatabase()
public function testDatabase()
{
$menu = new Menu('server', 'pma_test', '');
$this->assertContains(
@ -73,7 +73,7 @@ class MenuTest extends PmaTestCase
*
* @return void
*/
function testTable()
public function testTable()
{
$menu = new Menu('server', 'pma_test', 'table1');
$this->assertContains(
@ -87,7 +87,7 @@ class MenuTest extends PmaTestCase
*
* @return void
*/
function testTableDisplay()
public function testTableDisplay()
{
$menu = new Menu('server', 'pma_test', '');
$this->expectOutputString(
@ -102,7 +102,7 @@ class MenuTest extends PmaTestCase
*
* @return void
*/
function testSetTable()
public function testSetTable()
{
$menu = new Menu('server', 'pma_test', '');
$menu->setTable('table1');

View File

@ -26,7 +26,7 @@ class NodeFactoryTest extends PmaTestCase
*
* @return void
*/
public function setup()
protected function setUp()
{
$GLOBALS['server'] = 0;
}

View File

@ -25,7 +25,7 @@ class NodeColumnContainerTest extends PmaTestCase
*
* @return void
*/
public function setup()
protected function setUp()
{
$GLOBALS['server'] = 0;
}

View File

@ -25,7 +25,7 @@ class NodeColumnTest extends PmaTestCase
*
* @return void
*/
public function setup()
protected function setUp()
{
$GLOBALS['server'] = 0;
}

View File

@ -25,7 +25,7 @@ class NodeDatabaseTest extends PmaTestCase
*
* @return void
*/
public function setup()
protected function setUp()
{
$GLOBALS['server'] = 0;
$GLOBALS['cfg']['DefaultTabDatabase'] = 'structure';

View File

@ -25,7 +25,7 @@ class NodeEventContainerTest extends PmaTestCase
*
* @return void
*/
public function setup()
protected function setUp()
{
$GLOBALS['server'] = 0;
}

View File

@ -25,7 +25,7 @@ class NodeEventTest extends PmaTestCase
*
* @return void
*/
public function setup()
protected function setUp()
{
$GLOBALS['server'] = 0;
}

View File

@ -25,7 +25,7 @@ class NodeFunctionContainerTest extends PmaTestCase
*
* @return void
*/
public function setup()
protected function setUp()
{
$GLOBALS['server'] = 0;
}

View File

@ -25,7 +25,7 @@ class NodeFunctionTest extends PmaTestCase
*
* @return void
*/
public function setup()
protected function setUp()
{
$GLOBALS['server'] = 0;
}

View File

@ -25,7 +25,7 @@ class NodeIndexContainerTest extends PmaTestCase
*
* @return void
*/
public function setup()
protected function setUp()
{
$GLOBALS['server'] = 0;
}

View File

@ -25,7 +25,7 @@ class NodeIndexTest extends PmaTestCase
*
* @return void
*/
public function setup()
protected function setUp()
{
$GLOBALS['server'] = 0;
}

View File

@ -25,7 +25,7 @@ class NodeProcedureContainerTest extends PmaTestCase
*
* @return void
*/
public function setup()
protected function setUp()
{
$GLOBALS['server'] = 0;
}

View File

@ -25,7 +25,7 @@ class NodeProcedureTest extends PmaTestCase
*
* @return void
*/
public function setup()
protected function setUp()
{
$GLOBALS['server'] = 0;
}

View File

@ -25,7 +25,7 @@ class NodeTableContainerTest extends PmaTestCase
*
* @return void
*/
public function setup()
protected function setUp()
{
$GLOBALS['server'] = 0;
$GLOBALS['cfg']['NavigationTreeEnableGrouping'] = true;

View File

@ -25,7 +25,7 @@ class NodeTableTest extends PmaTestCase
*
* @return void
*/
public function setup()
protected function setUp()
{
$GLOBALS['server'] = 0;
$GLOBALS['cfg']['NavigationTreeDefaultTabTable'] = 'b_browse';

View File

@ -27,7 +27,7 @@ class NodeTest extends PmaTestCase
*
* @return void
*/
public function setup()
protected function setUp()
{
$GLOBALS['server'] = 0;
$GLOBALS['cfg']['Server']['DisableIS'] = false;

View File

@ -25,7 +25,7 @@ class NodeTriggerContainerTest extends PmaTestCase
*
* @return void
*/
public function setup()
protected function setUp()
{
$GLOBALS['server'] = 0;
}

View File

@ -25,7 +25,7 @@ class NodeTriggerTest extends PmaTestCase
*
* @return void
*/
public function setup()
protected function setUp()
{
$GLOBALS['server'] = 0;
}

View File

@ -25,7 +25,7 @@ class NodeViewContainerTest extends PmaTestCase
*
* @return void
*/
public function setup()
protected function setUp()
{
$GLOBALS['server'] = 0;
$GLOBALS['cfg']['NavigationTreeEnableGrouping'] = true;

View File

@ -25,7 +25,7 @@ class NodeViewTest extends PmaTestCase
*
* @return void
*/
public function setup()
protected function setUp()
{
$GLOBALS['server'] = 0;
}

View File

@ -32,7 +32,7 @@ class NormalizationTest extends TestCase
*
* @return void
*/
public function setUp()
protected function setUp()
{
$GLOBALS['cfg']['LimitChars'] = 50;
$GLOBALS['cfg']['ServerDefault'] = "PMA_server";

View File

@ -25,7 +25,7 @@ class PdfTest extends PmaTestCase
*
* @return void
*/
public function setup()
protected function setUp()
{
$GLOBALS['PMA_Config'] = new Config();
$GLOBALS['PMA_Config']->enableBc();

View File

@ -23,6 +23,9 @@ use ReflectionProperty;
*/
class ExportCodegenTest extends PmaTestCase
{
/**
* @var ExportCodegen
*/
protected $object;
/**
@ -30,10 +33,10 @@ class ExportCodegenTest extends PmaTestCase
*
* @return void
*/
function setup()
protected function setUp()
{
$GLOBALS['server'] = 0;
$this->object = new ExportCodegen(null);
$this->object = new ExportCodegen();
}
/**

View File

@ -30,7 +30,7 @@ class ExportCsvTest extends PmaTestCase
*
* @return void
*/
function setup()
protected function setUp()
{
$GLOBALS['server'] = 0;
$this->object = new ExportCsv();

View File

@ -29,7 +29,7 @@ class ExportExcelTest extends PmaTestCase
*
* @return void
*/
function setup()
protected function setUp()
{
$GLOBALS['server'] = 0;
$this->object = new ExportExcel();

View File

@ -30,7 +30,7 @@ class ExportHtmlwordTest extends PmaTestCase
*
* @return void
*/
function setup()
protected function setUp()
{
$GLOBALS['server'] = 0;
$this->object = new ExportHtmlword();

View File

@ -29,7 +29,7 @@ class ExportJsonTest extends PmaTestCase
*
* @return void
*/
function setup()
protected function setUp()
{
$GLOBALS['server'] = 0;
$GLOBALS['output_kanji_conversion'] = false;

View File

@ -29,7 +29,7 @@ class ExportLatexTest extends PmaTestCase
*
* @return void
*/
function setup()
protected function setUp()
{
$GLOBALS['server'] = 0;
$GLOBALS['output_kanji_conversion'] = false;

View File

@ -30,7 +30,7 @@ class ExportMediawikiTest extends PmaTestCase
*
* @return void
*/
function setup()
protected function setUp()
{
$GLOBALS['server'] = 0;
$GLOBALS['output_kanji_conversion'] = false;

View File

@ -31,7 +31,7 @@ class ExportOdsTest extends PmaTestCase
*
* @return void
*/
function setup()
protected function setUp()
{
$GLOBALS['server'] = 0;
$GLOBALS['output_kanji_conversion'] = false;

View File

@ -31,7 +31,7 @@ class ExportOdtTest extends PmaTestCase
*
* @return void
*/
function setup()
protected function setUp()
{
$GLOBALS['server'] = 0;
$GLOBALS['output_kanji_conversion'] = false;

View File

@ -30,7 +30,7 @@ class ExportPdfTest extends PmaTestCase
*
* @return void
*/
function setup()
protected function setUp()
{
$GLOBALS['server'] = 0;
$GLOBALS['output_kanji_conversion'] = false;

View File

@ -30,7 +30,7 @@ class ExportPhparrayTest extends PmaTestCase
*
* @return void
*/
function setup()
protected function setUp()
{
$GLOBALS['server'] = 0;
$GLOBALS['output_kanji_conversion'] = false;

View File

@ -32,7 +32,7 @@ class ExportSqlTest extends PmaTestCase
*
* @return void
*/
function setup()
protected function setUp()
{
$GLOBALS['server'] = 0;
$GLOBALS['db'] = 'db';

View File

@ -30,7 +30,7 @@ class ExportTexytextTest extends PmaTestCase
*
* @return void
*/
function setup()
protected function setUp()
{
$GLOBALS['server'] = 0;
$GLOBALS['output_kanji_conversion'] = false;

View File

@ -31,7 +31,7 @@ class ExportXmlTest extends PmaTestCase
*
* @return void
*/
function setup()
protected function setUp()
{
$GLOBALS['server'] = 0;
$GLOBALS['output_kanji_conversion'] = false;

View File

@ -30,7 +30,7 @@ class ExportYamlTest extends PmaTestCase
*
* @return void
*/
function setup()
protected function setUp()
{
$GLOBALS['server'] = 0;
$GLOBALS['output_kanji_conversion'] = false;

View File

@ -26,7 +26,7 @@ class TablePropertyTest extends PmaTestCase
*
* @return void
*/
function setup()
protected function setUp()
{
$GLOBALS['server'] = 0;
$row = [' name ', 'int ', true, ' PRI', '0', 'mysql'];

View File

@ -26,7 +26,7 @@ class OptionsPropertyMainGroupTest extends TestCase
*
* @return void
*/
protected function setup()
protected function setUp()
{
$this->object = new OptionsPropertyMainGroup();
}

View File

@ -26,7 +26,7 @@ class OptionsPropertyRootGroupTest extends TestCase
*
* @return void
*/
protected function setup()
protected function setUp()
{
$this->object = new OptionsPropertyRootGroup();
}

Some files were not shown because too many files have changed in this diff Show More