From 47f0960dce6a2a07428f7e600a4a9815abe8a537 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maur=C3=ADcio=20Meneghini=20Fauth?= Date: Tue, 7 Jul 2020 11:31:33 -0300 Subject: [PATCH] Add return type declaration to test methods MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: MaurĂ­cio Meneghini Fauth --- test/classes/AbstractNetworkTestCase.php | 4 +- test/classes/AdvisorTest.php | 14 +- test/classes/BookmarkTest.php | 16 +- test/classes/BrowseForeignersTest.php | 16 +- test/classes/CentralColumnsTest.php | 72 ++--- test/classes/CheckUserPrivilegesTest.php | 8 +- test/classes/Config/ConfigFileTest.php | 72 ++--- test/classes/Config/DescriptionTest.php | 10 +- .../Config/FormDisplayTemplateTest.php | 44 +--- test/classes/Config/FormDisplayTest.php | 44 +--- test/classes/Config/FormTest.php | 28 +- test/classes/Config/Forms/FormListTest.php | 2 +- test/classes/Config/PageSettingsTest.php | 12 +- .../classes/Config/ServerConfigChecksTest.php | 15 +- test/classes/ConfigTest.php | 77 ++---- .../Database/StructureControllerTest.php | 28 +- .../Server/DatabasesControllerTest.php | 10 +- .../Server/PluginsControllerTest.php | 4 +- .../Table/IndexesControllerTest.php | 8 +- .../Table/RelationControllerTest.php | 20 +- .../Table/SearchControllerTest.php | 8 +- .../Table/StructureControllerTest.php | 12 +- test/classes/CoreTest.php | 194 ++++---------- test/classes/CreateAddFieldTest.php | 6 +- test/classes/Database/Designer/CommonTest.php | 28 +- test/classes/Database/DesignerTest.php | 20 +- test/classes/Database/EventsTest.php | 8 +- test/classes/Database/QbeTest.php | 68 ++--- test/classes/Database/RoutinesTest.php | 48 ++-- test/classes/Database/SearchTest.php | 14 +- test/classes/Database/TriggersTest.php | 14 +- test/classes/DatabaseInterfaceTest.php | 40 +-- test/classes/Dbal/DbiDummyTest.php | 12 +- test/classes/Display/ChangePasswordTest.php | 4 +- test/classes/Display/CreateTableTest.php | 4 +- test/classes/Display/ExportTest.php | 12 +- test/classes/Display/ResultsTest.php | 70 ++--- test/classes/EncodingTest.php | 44 +--- test/classes/Engines/BdbTest.php | 12 +- test/classes/Engines/BinlogTest.php | 4 +- test/classes/Engines/InnodbTest.php | 40 +-- test/classes/Engines/MemoryTest.php | 4 +- test/classes/Engines/MrgMyisamTest.php | 4 +- test/classes/Engines/MyisamTest.php | 4 +- test/classes/Engines/NdbclusterTest.php | 12 +- test/classes/Engines/PbxtTest.php | 14 +- test/classes/EnvironmentTest.php | 4 +- test/classes/ErrorHandlerTest.php | 46 +--- test/classes/ErrorTest.php | 34 +-- test/classes/ExportTest.php | 8 +- test/classes/FileTest.php | 2 +- test/classes/FontTest.php | 16 +- test/classes/FooterTest.php | 40 +-- test/classes/Gis/GisGeomTestCase.php | 4 +- .../classes/Gis/GisGeometryCollectionTest.php | 30 +-- test/classes/Gis/GisGeometryTest.php | 10 +- test/classes/Gis/GisLineStringTest.php | 30 +-- test/classes/Gis/GisMultiLineStringTest.php | 34 +-- test/classes/Gis/GisMultiPointTest.php | 34 +-- test/classes/Gis/GisMultiPolygonTest.php | 34 +-- test/classes/Gis/GisPointTest.php | 32 +-- test/classes/Gis/GisPolygonTest.php | 40 ++- test/classes/GitTest.php | 44 +--- test/classes/HeaderTest.php | 32 +-- test/classes/ImportTest.php | 32 +-- test/classes/IndexTest.php | 20 +- test/classes/InsertEditTest.php | 248 +++++------------- test/classes/IpAllowDenyTest.php | 10 +- test/classes/LanguageTest.php | 32 +-- test/classes/LinterTest.php | 10 +- test/classes/ListDatabaseTest.php | 16 +- test/classes/MenuTest.php | 20 +- test/classes/MessageTest.php | 124 +++------ test/classes/MimeTest.php | 2 +- test/classes/Navigation/NavigationTest.php | 12 +- .../classes/Navigation/NavigationTreeTest.php | 12 +- test/classes/Navigation/NodeFactoryTest.php | 20 +- .../Nodes/NodeColumnContainerTest.php | 4 +- .../Navigation/Nodes/NodeColumnTest.php | 4 +- .../Nodes/NodeDatabaseChildTest.php | 4 +- .../Navigation/Nodes/NodeDatabaseTest.php | 16 +- .../Nodes/NodeEventContainerTest.php | 4 +- .../Navigation/Nodes/NodeEventTest.php | 4 +- .../Nodes/NodeFunctionContainerTest.php | 4 +- .../Navigation/Nodes/NodeFunctionTest.php | 4 +- .../Nodes/NodeIndexContainerTest.php | 4 +- .../Navigation/Nodes/NodeIndexTest.php | 4 +- .../Nodes/NodeProcedureContainerTest.php | 4 +- .../Navigation/Nodes/NodeProcedureTest.php | 4 +- .../Nodes/NodeTableContainerTest.php | 4 +- .../Navigation/Nodes/NodeTableTest.php | 6 +- test/classes/Navigation/Nodes/NodeTest.php | 68 ++--- .../Nodes/NodeTriggerContainerTest.php | 4 +- .../Navigation/Nodes/NodeTriggerTest.php | 4 +- .../Nodes/NodeViewContainerTest.php | 4 +- test/classes/NormalizationTest.php | 64 ++--- test/classes/PdfTest.php | 12 +- .../Plugins/Auth/AuthenticationConfigTest.php | 16 +- .../Plugins/Auth/AuthenticationCookieTest.php | 141 +++------- .../Plugins/Auth/AuthenticationHttpTest.php | 37 +-- .../Plugins/Auth/AuthenticationSignonTest.php | 56 +--- .../Plugins/Export/ExportCodegenTest.php | 44 +--- test/classes/Plugins/Export/ExportCsvTest.php | 28 +- .../Plugins/Export/ExportExcelTest.php | 4 +- .../Plugins/Export/ExportHtmlwordTest.php | 48 +--- .../classes/Plugins/Export/ExportJsonTest.php | 28 +- .../Plugins/Export/ExportLatexTest.php | 36 +-- .../Plugins/Export/ExportMediawikiTest.php | 32 +-- test/classes/Plugins/Export/ExportOdsTest.php | 32 +-- test/classes/Plugins/Export/ExportOdtTest.php | 52 +--- test/classes/Plugins/Export/ExportPdfTest.php | 36 +-- .../Plugins/Export/ExportPhparrayTest.php | 28 +- test/classes/Plugins/Export/ExportSqlTest.php | 96 ++----- .../Plugins/Export/ExportTexytextTest.php | 48 +--- test/classes/Plugins/Export/ExportXmlTest.php | 28 +- .../classes/Plugins/Export/ExportYamlTest.php | 28 +- .../Export/Helpers/TablePropertyTest.php | 36 +-- test/classes/Plugins/Import/ImportCsvTest.php | 20 +- test/classes/Plugins/Import/ImportLdiTest.php | 20 +- .../Plugins/Import/ImportMediawikiTest.php | 8 +- test/classes/Plugins/Import/ImportOdsTest.php | 8 +- test/classes/Plugins/Import/ImportShpTest.php | 20 +- test/classes/Plugins/Import/ImportSqlTest.php | 4 +- test/classes/Plugins/Import/ImportXmlTest.php | 8 +- .../Plugins/Schema/DiaRelationSchemaTest.php | 4 +- .../Plugins/Schema/EpsRelationSchemaTest.php | 8 +- .../Schema/ExportRelationSchemaTest.php | 28 +- .../Plugins/Schema/PdfRelationSchemaTest.php | 4 +- .../Plugins/Schema/SvgRelationSchemaTest.php | 4 +- .../TransformationPluginsTest.php | 8 +- .../Groups/OptionsPropertyMainGroupTest.php | 4 +- .../Groups/OptionsPropertyRootGroupTest.php | 8 +- .../Groups/OptionsPropertySubgroupTest.php | 8 +- .../Options/Items/PropertyItemsTest.php | 36 +-- .../Options/OptionsPropertyGroupTest.php | 20 +- .../Options/OptionsPropertyItemTest.php | 16 +- .../Options/OptionsPropertyOneItemTest.php | 20 +- .../Plugins/ExportPluginPropertiesTest.php | 8 +- .../Plugins/ImportPluginPropertiesTest.php | 12 +- .../Plugins/PluginPropertyItemTest.php | 4 +- test/classes/Properties/PropertyItemTest.php | 4 +- test/classes/RelationTest.php | 24 +- test/classes/ReplicationGuiTest.php | 12 +- test/classes/SanitizeTest.php | 50 +--- test/classes/ScriptsTest.php | 20 +- test/classes/Server/PrivilegesTest.php | 144 +++------- test/classes/Server/SelectTest.php | 4 +- test/classes/Server/SysInfo/SysInfoTest.php | 10 +- test/classes/Server/UserGroupsTest.php | 16 +- test/classes/Setup/ConfigGeneratorTest.php | 16 +- test/classes/Setup/FormProcessingTest.php | 4 +- test/classes/Setup/IndexTest.php | 16 +- test/classes/SqlQueryFormTest.php | 8 +- test/classes/SqlTest.php | 40 +-- test/classes/StorageEngineTest.php | 46 +--- test/classes/SystemDatabaseTest.php | 8 +- test/classes/TableTest.php | 118 +++------ test/classes/TemplateTest.php | 12 +- test/classes/ThemeManagerTest.php | 20 +- test/classes/ThemeTest.php | 58 ++-- test/classes/TrackerTest.php | 54 ++-- test/classes/TrackingTest.php | 52 +--- test/classes/TransformationsTest.php | 20 +- test/classes/TwoFactorTest.php | 37 +-- test/classes/TypesTest.php | 58 ++-- test/classes/UrlTest.php | 16 +- test/classes/UserPreferencesTest.php | 32 +-- test/classes/UtilTest.php | 96 +++---- test/classes/Utils/HttpRequestTest.php | 10 +- test/classes/VersionInformationTest.php | 22 +- test/classes/ZipExtensionTest.php | 24 +- test/selenium/ChangePasswordTest.php | 4 +- test/selenium/CreateDropDatabaseTest.php | 12 +- test/selenium/CreateRemoveUserTest.php | 4 +- test/selenium/Database/EventsTest.php | 26 +- test/selenium/Database/OperationsTest.php | 23 +- test/selenium/Database/ProceduresTest.php | 22 +- test/selenium/Database/QueryByExampleTest.php | 4 +- test/selenium/Database/StructureTest.php | 12 +- test/selenium/Database/TriggersTest.php | 28 +- test/selenium/ExportTest.php | 4 +- test/selenium/ImportTest.php | 22 +- test/selenium/LoginTest.php | 8 +- test/selenium/NormalizationTest.php | 4 +- test/selenium/ServerSettingsTest.php | 16 +- test/selenium/SqlQueryTest.php | 12 +- test/selenium/Table/BrowseTest.php | 24 +- test/selenium/Table/CreateTest.php | 8 +- test/selenium/Table/InsertTest.php | 8 +- test/selenium/Table/OperationsTest.php | 34 +-- test/selenium/Table/StructureTest.php | 12 +- test/selenium/TestBase.php | 42 +-- test/selenium/TrackingTest.php | 20 +- test/selenium/XssTest.php | 4 +- 194 files changed, 1360 insertions(+), 3640 deletions(-) diff --git a/test/classes/AbstractNetworkTestCase.php b/test/classes/AbstractNetworkTestCase.php index 791a312552..30c9107bf2 100644 --- a/test/classes/AbstractNetworkTestCase.php +++ b/test/classes/AbstractNetworkTestCase.php @@ -37,10 +37,8 @@ abstract class AbstractNetworkTestCase extends AbstractTestCase * Creates mock of Response object for header testing * * @param mixed[]|string|StringContains ...$param parameter for header method - * - * @return MockObject */ - public function mockResponse(...$param) + public function mockResponse(...$param): MockObject { $mockResponse = $this->getMockBuilder(Response::class) ->disableOriginalConstructor() diff --git a/test/classes/AdvisorTest.php b/test/classes/AdvisorTest.php index d2ed6a50ef..ec1a9dd7c4 100644 --- a/test/classes/AdvisorTest.php +++ b/test/classes/AdvisorTest.php @@ -44,7 +44,7 @@ class AdvisorTest extends AbstractTestCase * * @return array */ - public function escapeStrings() + public function escapeStrings(): array { return [ [ @@ -68,10 +68,8 @@ class AdvisorTest extends AbstractTestCase /** * test for parseRulesFile - * - * @return void */ - public function testParse() + public function testParse(): void { $advisor = new Advisor($GLOBALS['dbi'], new ExpressionLanguage()); $parseResult = $advisor->parseRulesFile(Advisor::GENERIC_RULES_FILE); @@ -95,7 +93,7 @@ class AdvisorTest extends AbstractTestCase /** * @return array */ - public function advisorTimes() + public function advisorTimes(): array { return [ [ @@ -123,10 +121,8 @@ class AdvisorTest extends AbstractTestCase /** * test for Advisor::timespanFormat - * - * @return void */ - public function testAdvisorTimespanFormat() + public function testAdvisorTimespanFormat(): void { $result = Advisor::timespanFormat(1200); $this->assertEquals('0 days, 0 hours, 20 minutes and 0 seconds', $result); @@ -170,7 +166,7 @@ class AdvisorTest extends AbstractTestCase * * @return array */ - public function rulesProvider() + public function rulesProvider(): array { return [ [ diff --git a/test/classes/BookmarkTest.php b/test/classes/BookmarkTest.php index ae4ad57494..d8a7d72131 100644 --- a/test/classes/BookmarkTest.php +++ b/test/classes/BookmarkTest.php @@ -32,10 +32,8 @@ class BookmarkTest extends AbstractTestCase /** * Tests for Bookmark:getParams() - * - * @return void */ - public function testGetParams() + public function testGetParams(): void { $this->assertFalse( Bookmark::getParams($GLOBALS['cfg']['Server']['user']) @@ -44,10 +42,8 @@ class BookmarkTest extends AbstractTestCase /** * Tests for Bookmark::getList() - * - * @return void */ - public function testGetList() + public function testGetList(): void { $this->assertEquals( [], @@ -61,10 +57,8 @@ class BookmarkTest extends AbstractTestCase /** * Tests for Bookmark::get() - * - * @return void */ - public function testGet() + public function testGet(): void { $this->assertNull( Bookmark::get( @@ -78,10 +72,8 @@ class BookmarkTest extends AbstractTestCase /** * Tests for Bookmark::save() - * - * @return void */ - public function testSave() + public function testSave(): void { $bookmarkData = [ 'bkm_database' => 'phpmyadmin', diff --git a/test/classes/BrowseForeignersTest.php b/test/classes/BrowseForeignersTest.php index 926f2f7fac..80c3e18aa4 100644 --- a/test/classes/BrowseForeignersTest.php +++ b/test/classes/BrowseForeignersTest.php @@ -33,10 +33,8 @@ class BrowseForeignersTest extends AbstractTestCase /** * Test for BrowseForeigners::getForeignLimit - * - * @return void */ - public function testGetForeignLimit() + public function testGetForeignLimit(): void { $this->assertNull( $this->browseForeigners->getForeignLimit('Show all') @@ -70,10 +68,8 @@ class BrowseForeignersTest extends AbstractTestCase /** * Test for BrowseForeigners::getHtmlForGotoPage - * - * @return void */ - public function testGetHtmlForGotoPage() + public function testGetHtmlForGotoPage(): void { $this->assertEquals( '', @@ -137,10 +133,8 @@ class BrowseForeignersTest extends AbstractTestCase /** * Test for BrowseForeigners::getDescriptionAndTitle - * - * @return void */ - public function testGetDescriptionAndTitle() + public function testGetDescriptionAndTitle(): void { $desc = 'foobarassertSame( [ @@ -183,10 +181,8 @@ class CentralColumnsTest extends AbstractTestCase /** * Test for getColumnsList - * - * @return void */ - public function testGetColumnsList() + public function testGetColumnsList(): void { $GLOBALS['dbi']->expects($this->exactly(2)) ->method('fetchResult') @@ -207,10 +203,8 @@ class CentralColumnsTest extends AbstractTestCase /** * Test for getCount - * - * @return void */ - public function testGetCount() + public function testGetCount(): void { $GLOBALS['dbi']->expects($this->once()) ->method('fetchResult') @@ -233,10 +227,8 @@ class CentralColumnsTest extends AbstractTestCase /** * Test for syncUniqueColumns - * - * @return void */ - public function testSyncUniqueColumns() + public function testSyncUniqueColumns(): void { $_POST['db'] = 'PMA_db'; $_POST['table'] = 'PMA_table'; @@ -250,10 +242,8 @@ class CentralColumnsTest extends AbstractTestCase /** * Test for deleteColumnsFromList - * - * @return void */ - public function testDeleteColumnsFromList() + public function testDeleteColumnsFromList(): void { $_POST['db'] = 'PMA_db'; $_POST['table'] = 'PMA_table'; @@ -312,10 +302,8 @@ class CentralColumnsTest extends AbstractTestCase /** * Test for makeConsistentWithList - * - * @return void */ - public function testMakeConsistentWithList() + public function testMakeConsistentWithList(): void { $GLOBALS['dbi']->expects($this->any()) ->method('fetchResult') @@ -337,10 +325,8 @@ class CentralColumnsTest extends AbstractTestCase /** * Test for getFromTable - * - * @return void */ - public function testGetFromTable() + public function testGetFromTable(): void { $db = 'PMA_db'; $table = 'PMA_table'; @@ -371,10 +357,8 @@ class CentralColumnsTest extends AbstractTestCase /** * Test for getFromTable with $allFields = true - * - * @return void */ - public function testGetFromTableWithAllFields() + public function testGetFromTableWithAllFields(): void { $db = 'PMA_db'; $table = 'PMA_table'; @@ -403,10 +387,8 @@ class CentralColumnsTest extends AbstractTestCase /** * Test for updateOneColumn - * - * @return void */ - public function testUpdateOneColumn() + public function testUpdateOneColumn(): void { $this->assertTrue( $this->centralColumns->updateOneColumn( @@ -440,10 +422,8 @@ class CentralColumnsTest extends AbstractTestCase /** * Test for updateMultipleColumn - * - * @return void */ - public function testUpdateMultipleColumn() + public function testUpdateMultipleColumn(): void { $params = []; $params['db'] = 'phpmyadmin'; @@ -486,10 +466,8 @@ class CentralColumnsTest extends AbstractTestCase /** * Test for getHtmlForEditingPage - * - * @return void */ - public function testGetHtmlForEditingPage() + public function testGetHtmlForEditingPage(): void { $GLOBALS['dbi']->expects($this->any()) ->method('fetchResult') @@ -563,10 +541,8 @@ class CentralColumnsTest extends AbstractTestCase /** * Test for getListRaw - * - * @return void */ - public function testGetListRaw() + public function testGetListRaw(): void { $GLOBALS['dbi']->expects($this->once()) ->method('fetchResult') @@ -591,10 +567,8 @@ class CentralColumnsTest extends AbstractTestCase /** * Test for getListRaw with a table name - * - * @return void */ - public function testGetListRawWithTable() + public function testGetListRawWithTable(): void { $GLOBALS['dbi']->expects($this->once()) ->method('fetchResult') @@ -620,10 +594,8 @@ class CentralColumnsTest extends AbstractTestCase /** * Test for getHtmlForMain - * - * @return void */ - public function testGetHtmlForMain() + public function testGetHtmlForMain(): void { $db = 'phpmyadmin'; $total_rows = 50; @@ -705,10 +677,8 @@ class CentralColumnsTest extends AbstractTestCase /** * Test for configErrorMessage - * - * @return void */ - public function testConfigErrorMessage() + public function testConfigErrorMessage(): void { $this->assertInstanceOf( Message::class, @@ -718,10 +688,8 @@ class CentralColumnsTest extends AbstractTestCase /** * Test for findExistingColNames - * - * @return void */ - public function testFindExistingColNames() + public function testFindExistingColNames(): void { $GLOBALS['dbi']->expects($this->once()) ->method('fetchResult') @@ -752,10 +720,8 @@ class CentralColumnsTest extends AbstractTestCase /** * Test for getTableFooter - * - * @return void */ - public function testGetTableFooter() + public function testGetTableFooter(): void { $pmaThemeImage = 'pmaThemeImage'; $text_dir = 'text_dir'; @@ -773,10 +739,8 @@ class CentralColumnsTest extends AbstractTestCase /** * Test for getHtmlForColumnDropdown - * - * @return void */ - public function testGetHtmlForColumnDropdown() + public function testGetHtmlForColumnDropdown(): void { $db = 'PMA_db'; $selected_tbl = 'PMA_table'; diff --git a/test/classes/CheckUserPrivilegesTest.php b/test/classes/CheckUserPrivilegesTest.php index 565694cc29..a9354e4584 100644 --- a/test/classes/CheckUserPrivilegesTest.php +++ b/test/classes/CheckUserPrivilegesTest.php @@ -36,10 +36,8 @@ class CheckUserPrivilegesTest extends AbstractTestCase /** * Test for getItemsFromShowGrantsRow - * - * @return void */ - public function testGetItemsFromShowGrantsRow() + public function testGetItemsFromShowGrantsRow(): void { // TEST CASE 1 $show_grants_full_row = 'GRANT ALL PRIVILEGES ON *.* ' @@ -158,10 +156,8 @@ class CheckUserPrivilegesTest extends AbstractTestCase /** * Test for checkRequiredPrivilegesForAdjust - * - * @return void */ - public function testCheckRequiredPrivilegesForAdjust() + public function testCheckRequiredPrivilegesForAdjust(): void { // TEST CASE 1 $show_grants_full_row = 'GRANT ALL PRIVILEGES ON *.* ' diff --git a/test/classes/Config/ConfigFileTest.php b/test/classes/Config/ConfigFileTest.php index 03aebdca64..9d01a9f3a6 100644 --- a/test/classes/Config/ConfigFileTest.php +++ b/test/classes/Config/ConfigFileTest.php @@ -56,11 +56,9 @@ class ConfigFileTest extends AbstractTestCase /** * Test for new ConfigFile() * - * @return void - * * @test */ - public function testNewObjectState() + public function testNewObjectState(): void { // Check default dynamic values $this->assertEquals( @@ -84,11 +82,9 @@ class ConfigFileTest extends AbstractTestCase /** * Test for ConfigFile::setPersistKeys() * - * @return void - * * @test */ - public function testPersistentKeys() + public function testPersistentKeys(): void { $default_simple_value = $this->object->getDefault( self::SIMPLE_KEY_WITH_DEFAULT_VALUE @@ -137,11 +133,9 @@ class ConfigFileTest extends AbstractTestCase /** * Test for ConfigFile::setAllowedKeys * - * @return void - * * @test */ - public function testAllowedKeys() + public function testAllowedKeys(): void { /** * Case 1: filter should not allow to set b @@ -178,11 +172,9 @@ class ConfigFileTest extends AbstractTestCase /** * Test for ConfigFile::setCfgUpdateReadMapping * - * @return void - * * @test */ - public function testConfigReadMapping() + public function testConfigReadMapping(): void { $this->object->setCfgUpdateReadMapping( [ @@ -215,11 +207,9 @@ class ConfigFileTest extends AbstractTestCase /** * Test for ConfigFile::resetConfigData * - * @return void - * * @test */ - public function testResetConfigData() + public function testResetConfigData(): void { $this->object->set('key', 'value'); @@ -232,11 +222,9 @@ class ConfigFileTest extends AbstractTestCase /** * Test for ConfigFile::setConfigData * - * @return void - * * @test */ - public function testSetConfigData() + public function testSetConfigData(): void { $this->object->set('abc', 'should be deleted by setConfigData'); $this->object->setConfigData(['a' => 'b']); @@ -254,11 +242,9 @@ class ConfigFileTest extends AbstractTestCase /** * Test for ConfigFile::set and ConfigFile::get * - * @return void - * * @test */ - public function testBasicSetUsage() + public function testBasicSetUsage(): void { $default_host = $this->object->getDefault('Servers/1/host'); $nondefault_host = $default_host . '.abc'; @@ -297,11 +283,9 @@ class ConfigFileTest extends AbstractTestCase /** * Test for ConfigFile::set - in PMA Setup * - * @return void - * * @test */ - public function testConfigFileSetInSetup() + public function testConfigFileSetInSetup(): void { $default_value = $this->object->getDefault( self::SIMPLE_KEY_WITH_DEFAULT_VALUE @@ -315,11 +299,9 @@ class ConfigFileTest extends AbstractTestCase /** * Test for ConfigFile::set - in user preferences * - * @return void - * * @test */ - public function testConfigFileSetInUserPreferences() + public function testConfigFileSetInUserPreferences(): void { $default_value = $this->object->getDefault( self::SIMPLE_KEY_WITH_DEFAULT_VALUE @@ -348,12 +330,10 @@ class ConfigFileTest extends AbstractTestCase /** * Test for ConfigFile::getFlatDefaultConfig * - * @return void - * * @test * @group medium */ - public function testGetFlatDefaultConfig() + public function testGetFlatDefaultConfig(): void { $flat_default_config = $this->object->getFlatDefaultConfig(); @@ -381,11 +361,9 @@ class ConfigFileTest extends AbstractTestCase /** * Test for ConfigFile::updateWithGlobalConfig * - * @return void - * * @test */ - public function testUpdateWithGlobalConfig() + public function testUpdateWithGlobalConfig(): void { $this->object->set('key', 'value'); $this->object->set('key2', 'value'); @@ -403,11 +381,9 @@ class ConfigFileTest extends AbstractTestCase /** * Test for ConfigFile::getCanonicalPath * - * @return void - * * @test */ - public function testGetCanonicalPath() + public function testGetCanonicalPath(): void { $this->assertEquals( 'Servers/1/abcd', @@ -423,11 +399,9 @@ class ConfigFileTest extends AbstractTestCase /** * Test for ConfigFile::getDbEntry * - * @return void - * * @test */ - public function testGetDbEntry() + public function testGetDbEntry(): void { $cfg_db = include ROOT_PATH . 'libraries/config.values.php'; // verify that $cfg_db read from config.values.php is valid @@ -447,11 +421,9 @@ class ConfigFileTest extends AbstractTestCase /** * Test for ConfigFile::getServerCount * - * @return void - * * @test */ - public function testGetServerCount() + public function testGetServerCount(): void { $this->object->set('Servers/1/x', 1); $this->object->set('Servers/2/x', 2); @@ -497,11 +469,9 @@ class ConfigFileTest extends AbstractTestCase /** * Test for ConfigFile::getServers * - * @return void - * * @test */ - public function testGetServers() + public function testGetServers(): void { $this->object->set('Servers/1/x', 'a'); $this->object->set('Servers/2/x', 'b'); @@ -518,11 +488,9 @@ class ConfigFileTest extends AbstractTestCase /** * Test for ConfigFile::getServerDSN * - * @return void - * * @test */ - public function testGetServerDSN() + public function testGetServerDSN(): void { $this->assertEquals( '', @@ -587,11 +555,9 @@ class ConfigFileTest extends AbstractTestCase /** * Test for ConfigFile::getServerName * - * @return void - * * @test */ - public function testGetServerName() + public function testGetServerName(): void { $this->assertEquals( '', @@ -614,11 +580,9 @@ class ConfigFileTest extends AbstractTestCase /** * Test for ConfigFile::getConfigArray * - * @return void - * * @test */ - public function testGetConfigArray() + public function testGetConfigArray(): void { $this->object->setPersistKeys([self::SIMPLE_KEY_WITH_DEFAULT_VALUE]); $this->object->set('Array/test', ['x', 'y']); diff --git a/test/classes/Config/DescriptionTest.php b/test/classes/Config/DescriptionTest.php index 4eeb2dc228..fea2739c71 100644 --- a/test/classes/Config/DescriptionTest.php +++ b/test/classes/Config/DescriptionTest.php @@ -40,7 +40,7 @@ class DescriptionTest extends AbstractTestCase /** * @return array */ - public function getValues() + public function getValues(): array { return [ [ @@ -65,10 +65,8 @@ class DescriptionTest extends AbstractTestCase * Assertion for getting description key * * @param string $key key - * - * @return void */ - public function assertGet($key) + public function assertGet($key): void { $this->assertNotNull(Descriptions::get($key, 'name')); $this->assertNotNull(Descriptions::get($key, 'desc')); @@ -77,10 +75,8 @@ class DescriptionTest extends AbstractTestCase /** * Test getting all names for configurations - * - * @return void */ - public function testAll() + public function testAll(): void { $nested = [ 'Export', diff --git a/test/classes/Config/FormDisplayTemplateTest.php b/test/classes/Config/FormDisplayTemplateTest.php index 4af348fb59..425e76a32a 100644 --- a/test/classes/Config/FormDisplayTemplateTest.php +++ b/test/classes/Config/FormDisplayTemplateTest.php @@ -35,10 +35,8 @@ class FormDisplayTemplateTest extends AbstractTestCase /** * Test for displayFormTop() - * - * @return void */ - public function testDisplayFormTop() + public function testDisplayFormTop(): void { $_SERVER['REQUEST_URI'] = 'https://www.phpmyadmin.net'; $GLOBALS['cfg']['ServerDefault'] = ''; @@ -73,10 +71,8 @@ class FormDisplayTemplateTest extends AbstractTestCase /** * Test for displayTabsTop() - * - * @return void */ - public function testDisplayTabsTop() + public function testDisplayTabsTop(): void { $result = $this->formDisplayTemplate->displayTabsTop(['one', 'two']); @@ -103,10 +99,8 @@ class FormDisplayTemplateTest extends AbstractTestCase /** * Test for displayFieldsetTop() - * - * @return void */ - public function testDisplayFieldsetTop() + public function testDisplayFieldsetTop(): void { $attributes = ['name' => 'attrname']; $errors = [ @@ -149,10 +143,8 @@ class FormDisplayTemplateTest extends AbstractTestCase /** * Test for displayInput() - * - * @return void */ - public function testDisplayInput() + public function testDisplayInput(): void { $opts = []; $opts['errors'] = ['e1']; @@ -399,10 +391,8 @@ class FormDisplayTemplateTest extends AbstractTestCase /** * Test for displayGroupHeader() - * - * @return void */ - public function testDisplayGroupHeader() + public function testDisplayGroupHeader(): void { $this->assertEquals( '', @@ -435,10 +425,8 @@ class FormDisplayTemplateTest extends AbstractTestCase /** * Test for displayGroupFooter() - * - * @return void */ - public function testDisplayGroupFooter() + public function testDisplayGroupFooter(): void { $this->formDisplayTemplate->group = 3; $this->formDisplayTemplate->displayGroupFooter(); @@ -450,10 +438,8 @@ class FormDisplayTemplateTest extends AbstractTestCase /** * Test for displayFieldsetBottom() - * - * @return void */ - public function testDisplayFieldsetBottom() + public function testDisplayFieldsetBottom(): void { // with PMA_SETUP $this->config->set('is_setup', true); @@ -493,10 +479,8 @@ class FormDisplayTemplateTest extends AbstractTestCase /** * Test for displayTabsBottom() - * - * @return void */ - public function testDisplayTabsBottom() + public function testDisplayTabsBottom(): void { $result = $this->formDisplayTemplate->displayTabsBottom(); $this->assertEquals( @@ -507,10 +491,8 @@ class FormDisplayTemplateTest extends AbstractTestCase /** * Test for displayFormBottom() - * - * @return void */ - public function testDisplayFormBottom() + public function testDisplayFormBottom(): void { $result = $this->formDisplayTemplate->displayFormBottom(); $this->assertEquals( @@ -521,10 +503,8 @@ class FormDisplayTemplateTest extends AbstractTestCase /** * Test for addJsValidate() - * - * @return void */ - public function testAddJsValidate() + public function testAddJsValidate(): void { $validators = [ 'one' => [ @@ -551,10 +531,8 @@ class FormDisplayTemplateTest extends AbstractTestCase /** * Test for displayJavascript() - * - * @return void */ - public function testDisplayJavascript() + public function testDisplayJavascript(): void { $this->assertEquals( '', diff --git a/test/classes/Config/FormDisplayTest.php b/test/classes/Config/FormDisplayTest.php index 71e11b89dc..8670a9cbf4 100644 --- a/test/classes/Config/FormDisplayTest.php +++ b/test/classes/Config/FormDisplayTest.php @@ -53,11 +53,9 @@ class FormDisplayTest extends AbstractTestCase /** * Test for FormDisplay::__constructor * - * @return void - * * @group medium */ - public function testFormDisplayContructor() + public function testFormDisplayContructor(): void { $reflection = new ReflectionProperty(FormDisplay::class, '_jsLangStrings'); $reflection->setAccessible(true); @@ -71,11 +69,9 @@ class FormDisplayTest extends AbstractTestCase /** * Test for FormDisplay::registerForm * - * @return void - * * @group medium */ - public function testRegisterForm() + public function testRegisterForm(): void { $reflection = new ReflectionClass(FormDisplay::class); @@ -124,11 +120,9 @@ class FormDisplayTest extends AbstractTestCase /** * Test for FormDisplay::process * - * @return void - * * @group medium */ - public function testProcess() + public function testProcess(): void { $this->assertFalse( $this->object->process(true, true) @@ -161,10 +155,8 @@ class FormDisplayTest extends AbstractTestCase /** * Test for FormDisplay::displayErrors - * - * @return void */ - public function testDisplayErrors() + public function testDisplayErrors(): void { $reflection = new ReflectionClass(FormDisplay::class); @@ -207,10 +199,8 @@ class FormDisplayTest extends AbstractTestCase /** * Test for FormDisplay::fixErrors - * - * @return void */ - public function testFixErrors() + public function testFixErrors(): void { $reflection = new ReflectionClass(FormDisplay::class); @@ -255,10 +245,8 @@ class FormDisplayTest extends AbstractTestCase /** * Test for FormDisplay::validateSelect - * - * @return void */ - public function testValidateSelect() + public function testValidateSelect(): void { $attrValidateSelect = new ReflectionMethod( FormDisplay::class, @@ -321,10 +309,8 @@ class FormDisplayTest extends AbstractTestCase /** * Test for FormDisplay::hasErrors - * - * @return void */ - public function testHasErrors() + public function testHasErrors(): void { $attrErrors = new ReflectionProperty(FormDisplay::class, '_errors'); $attrErrors->setAccessible(true); @@ -348,10 +334,8 @@ class FormDisplayTest extends AbstractTestCase /** * Test for FormDisplay::getDocLink - * - * @return void */ - public function testGetDocLink() + public function testGetDocLink(): void { $this->assertEquals( './url.php?url=https%3A%2F%2Fdocs.phpmyadmin.net%2Fen%2Flatest%2F' . @@ -372,10 +356,8 @@ class FormDisplayTest extends AbstractTestCase /** * Test for FormDisplay::getOptName - * - * @return void */ - public function testGetOptName() + public function testGetOptName(): void { $method = new ReflectionMethod(FormDisplay::class, 'getOptName'); $method->setAccessible(true); @@ -393,10 +375,8 @@ class FormDisplayTest extends AbstractTestCase /** * Test for FormDisplay::loadUserprefsInfo - * - * @return void */ - public function testLoadUserprefsInfo() + public function testLoadUserprefsInfo(): void { $method = new ReflectionMethod(FormDisplay::class, 'loadUserprefsInfo'); $method->setAccessible(true); @@ -416,10 +396,8 @@ class FormDisplayTest extends AbstractTestCase /** * Test for FormDisplay::setComments - * - * @return void */ - public function testSetComments() + public function testSetComments(): void { $method = new ReflectionMethod(FormDisplay::class, 'setComments'); $method->setAccessible(true); diff --git a/test/classes/Config/FormTest.php b/test/classes/Config/FormTest.php index 0ef5686eb3..8ddaba471a 100644 --- a/test/classes/Config/FormTest.php +++ b/test/classes/Config/FormTest.php @@ -58,11 +58,9 @@ class FormTest extends AbstractTestCase /** * Test for Form::__constructor * - * @return void - * * @group medium */ - public function testContructor() + public function testContructor(): void { $this->assertEquals( 1, @@ -80,10 +78,8 @@ class FormTest extends AbstractTestCase /** * Test for Form::getOptionType - * - * @return void */ - public function testGetOptionType() + public function testGetOptionType(): void { $attrFieldsTypes = new ReflectionProperty(Form::class, '_fieldsTypes'); $attrFieldsTypes->setAccessible(true); @@ -104,10 +100,8 @@ class FormTest extends AbstractTestCase /** * Test for Form::getOptionValueList - * - * @return void */ - public function testGetOptionValueList() + public function testGetOptionValueList(): void { $this->assertEquals( [ @@ -139,10 +133,8 @@ class FormTest extends AbstractTestCase /** * Test for Form::readFormPathsCallback - * - * @return void */ - public function testReadFormPathsCallBack() + public function testReadFormPathsCallBack(): void { $reflection = new ReflectionClass(Form::class); $method = $reflection->getMethod('readFormPathsCallback'); @@ -192,10 +184,8 @@ class FormTest extends AbstractTestCase /** * Test for Form::readFormPaths - * - * @return void */ - public function testReadFormPaths() + public function testReadFormPaths(): void { $reflection = new ReflectionClass(Form::class); $method = $reflection->getMethod('readFormPaths'); @@ -248,10 +238,8 @@ class FormTest extends AbstractTestCase /** * Test for Form::readTypes - * - * @return void */ - public function testReadTypes() + public function testReadTypes(): void { $reflection = new ReflectionClass(Form::class); $method = $reflection->getMethod('readTypes'); @@ -282,10 +270,8 @@ class FormTest extends AbstractTestCase /** * Test for Form::loadForm - * - * @return void */ - public function testLoadForm() + public function testLoadForm(): void { $this->object = $this->getMockBuilder(Form::class) ->disableOriginalConstructor() diff --git a/test/classes/Config/Forms/FormListTest.php b/test/classes/Config/Forms/FormListTest.php index 5845333105..c6ef552042 100644 --- a/test/classes/Config/Forms/FormListTest.php +++ b/test/classes/Config/Forms/FormListTest.php @@ -62,7 +62,7 @@ class FormListTest extends AbstractTestCase /** * @return array */ - public function formObjects() + public function formObjects(): array { return [ [ diff --git a/test/classes/Config/PageSettingsTest.php b/test/classes/Config/PageSettingsTest.php index aea74a826f..cb4bb9812b 100644 --- a/test/classes/Config/PageSettingsTest.php +++ b/test/classes/Config/PageSettingsTest.php @@ -34,10 +34,8 @@ class PageSettingsTest extends AbstractTestCase /** * Test showGroup when group passed does not exist - * - * @return void */ - public function testShowGroupNonExistent() + public function testShowGroupNonExistent(): void { $object = PageSettings::showGroup('NonExistent'); @@ -46,10 +44,8 @@ class PageSettingsTest extends AbstractTestCase /** * Test showGroup with a known group name - * - * @return void */ - public function testShowGroupBrowse() + public function testShowGroupBrowse(): void { $object = PageSettings::showGroup('Browse'); @@ -80,10 +76,8 @@ class PageSettingsTest extends AbstractTestCase /** * Test getNaviSettings - * - * @return void */ - public function testGetNaviSettings() + public function testGetNaviSettings(): void { $html = PageSettings::getNaviSettings(); diff --git a/test/classes/Config/ServerConfigChecksTest.php b/test/classes/Config/ServerConfigChecksTest.php index 962e5130f1..ff871e56f9 100644 --- a/test/classes/Config/ServerConfigChecksTest.php +++ b/test/classes/Config/ServerConfigChecksTest.php @@ -44,10 +44,7 @@ class ServerConfigChecksTest extends AbstractTestCase unset($_SESSION[$this->sessionID]); } - /** - * @return void - */ - public function testManyErrors() + public function testManyErrors(): void { $_SESSION[$this->sessionID]['Servers'] = [ '1' => [ @@ -105,10 +102,7 @@ class ServerConfigChecksTest extends AbstractTestCase ); } - /** - * @return void - */ - public function testBlowfishCreate() + public function testBlowfishCreate(): void { $_SESSION[$this->sessionID]['Servers'] = [ '1' => [ @@ -142,10 +136,7 @@ class ServerConfigChecksTest extends AbstractTestCase ); } - /** - * @return void - */ - public function testBlowfish() + public function testBlowfish(): void { $_SESSION[$this->sessionID]['blowfish_secret'] = 'sec'; diff --git a/test/classes/ConfigTest.php b/test/classes/ConfigTest.php index 95bedc444b..e90916cf75 100644 --- a/test/classes/ConfigTest.php +++ b/test/classes/ConfigTest.php @@ -86,11 +86,9 @@ class ConfigTest extends AbstractTestCase /** * Test for CheckSystem * - * @return void - * * @group medium */ - public function testCheckSystem() + public function testCheckSystem(): void { $this->object->checkSystem(); @@ -100,10 +98,8 @@ class ConfigTest extends AbstractTestCase /** * Test for checkOutputCompression - * - * @return void */ - public function testCheckOutputCompression() + public function testCheckOutputCompression(): void { $this->object->set('OBGzip', 'auto'); @@ -155,7 +151,7 @@ class ConfigTest extends AbstractTestCase * * @return array */ - public function userAgentProvider() + public function userAgentProvider(): array { return [ [ @@ -259,10 +255,8 @@ class ConfigTest extends AbstractTestCase /** * test for CheckGd2 - * - * @return void */ - public function testCheckGd2() + public function testCheckGd2(): void { $prevIsGb2Val = $this->object->get('PMA_IS_GD2'); @@ -349,7 +343,7 @@ class ConfigTest extends AbstractTestCase * * @return array */ - public function serverNames() + public function serverNames(): array { return [ [ @@ -365,10 +359,8 @@ class ConfigTest extends AbstractTestCase /** * test for CheckWebServerOs - * - * @return void */ - public function testCheckWebServerOs() + public function testCheckWebServerOs(): void { $this->object->checkWebServerOs(); @@ -395,11 +387,9 @@ class ConfigTest extends AbstractTestCase /** * Tests loading of default values * - * @return void - * * @group large */ - public function testLoadDefaults() + public function testLoadDefaults(): void { $prevDefaultSource = $this->object->default_source; @@ -445,10 +435,8 @@ class ConfigTest extends AbstractTestCase /** * test for CheckConfigSource - * - * @return void */ - public function testCheckConfigSource() + public function testCheckConfigSource(): void { $this->object->setSource('unexisted.config.php'); $this->assertFalse($this->object->checkConfigSource()); @@ -462,10 +450,8 @@ class ConfigTest extends AbstractTestCase /** * Test getting and setting config values - * - * @return void */ - public function testGetAndSet() + public function testGetAndSet(): void { $this->assertNull($this->object->get('unresisting_setting')); @@ -476,10 +462,8 @@ class ConfigTest extends AbstractTestCase /** * Tests setting configuration source - * - * @return void */ - public function testGetSetSource() + public function testGetSetSource(): void { echo $this->object->getSource(); @@ -544,7 +528,7 @@ class ConfigTest extends AbstractTestCase * * @return array */ - public function httpsParams() + public function httpsParams(): array { return [ [ @@ -761,15 +745,12 @@ class ConfigTest extends AbstractTestCase /** * Test for backward compatibility globals * - * @return void - * * @depends testCheckSystem * @depends testCheckWebServer * @depends testLoadDefaults - * * @group large */ - public function testEnableBc() + public function testEnableBc(): void { $this->object->enableBc(); @@ -810,7 +791,7 @@ class ConfigTest extends AbstractTestCase * * @return array data for testGetRootPath */ - public function rootUris() + public function rootUris(): array { return [ [ @@ -918,7 +899,7 @@ class ConfigTest extends AbstractTestCase * * @return array */ - public function configPaths() + public function configPaths(): array { return [ [ @@ -939,22 +920,18 @@ class ConfigTest extends AbstractTestCase /** * Test for loading user preferences * - * @return void - * * @todo Test actually preferences loading * @doesNotPerformAssertions */ - public function testLoadUserPreferences() + public function testLoadUserPreferences(): void { $this->object->loadUserPreferences(); } /** * Test for setting user config value - * - * @return void */ - public function testSetUserValue() + public function testSetUserValue(): void { $this->object->setUserValue(null, 'lang', 'cs', 'en'); $this->object->setUserValue('TEST_COOKIE_USER_VAL', '', 'cfg_val_1'); @@ -966,20 +943,16 @@ class ConfigTest extends AbstractTestCase /** * Test for getting user config value - * - * @return void */ - public function testGetUserValue() + public function testGetUserValue(): void { $this->assertEquals($this->object->getUserValue('test_val', 'val'), 'val'); } /** * Should test getting unique value for theme - * - * @return void */ - public function testGetThemeUniqueValue() + public function testGetThemeUniqueValue(): void { $partial_sum = $this->object->source_mtime + $this->object->default_source_mtime + @@ -992,10 +965,8 @@ class ConfigTest extends AbstractTestCase /** * Should test checking of config permissions - * - * @return void */ - public function testCheckPermissions() + public function testCheckPermissions(): void { //load file permissions for the current permissions file $perms = @fileperms($this->object->getSource()); @@ -1014,10 +985,8 @@ class ConfigTest extends AbstractTestCase /** * Test for setting cookies - * - * @return void */ - public function testSetCookie() + public function testSetCookie(): void { $this->object->set('is_https', false); $this->assertFalse( @@ -1115,7 +1084,7 @@ class ConfigTest extends AbstractTestCase * * @return array */ - public function serverSettingsProvider() + public function serverSettingsProvider(): array { return [ 'empty' => [ @@ -1164,7 +1133,7 @@ class ConfigTest extends AbstractTestCase * * @return array */ - public function selectServerProvider() + public function selectServerProvider(): array { return [ 'zero' => [ @@ -1237,7 +1206,7 @@ class ConfigTest extends AbstractTestCase * * @return array */ - public function connectionParams() + public function connectionParams(): array { $cfg_basic = [ 'user' => 'u', diff --git a/test/classes/Controllers/Database/StructureControllerTest.php b/test/classes/Controllers/Database/StructureControllerTest.php index b537452e5a..d1f7e0c892 100644 --- a/test/classes/Controllers/Database/StructureControllerTest.php +++ b/test/classes/Controllers/Database/StructureControllerTest.php @@ -101,11 +101,9 @@ class StructureControllerTest extends AbstractTestCase /** * Tests for getValuesForInnodbTable() * - * @return void - * * @test */ - public function testGetValuesForInnodbTable() + public function testGetValuesForInnodbTable(): void { $class = new ReflectionClass(StructureController::class); $method = $class->getMethod('getValuesForInnodbTable'); @@ -208,11 +206,9 @@ class StructureControllerTest extends AbstractTestCase /** * Tests for the getValuesForAriaTable() * - * @return void - * * @test */ - public function testGetValuesForAriaTable() + public function testGetValuesForAriaTable(): void { $class = new ReflectionClass(StructureController::class); $method = $class->getMethod('getValuesForAriaTable'); @@ -334,11 +330,9 @@ class StructureControllerTest extends AbstractTestCase /** * Tests for hasTable() * - * @return void - * * @test */ - public function testHasTable() + public function testHasTable(): void { $class = new ReflectionClass(StructureController::class); $method = $class->getMethod('hasTable'); @@ -376,11 +370,9 @@ class StructureControllerTest extends AbstractTestCase /** * Tests for checkFavoriteTable() * - * @return void - * * @test */ - public function testCheckFavoriteTable() + public function testCheckFavoriteTable(): void { $class = new ReflectionClass(StructureController::class); $method = $class->getMethod('checkFavoriteTable'); @@ -416,11 +408,9 @@ class StructureControllerTest extends AbstractTestCase /** * Tests for synchronizeFavoriteTables() * - * @return void - * * @test */ - public function testSynchronizeFavoriteTables() + public function testSynchronizeFavoriteTables(): void { $favoriteInstance = $this->getFavoriteTablesMock(); @@ -481,11 +471,9 @@ class StructureControllerTest extends AbstractTestCase /** * Tests for handleRealRowCountRequestAction() * - * @return void - * * @test */ - public function testHandleRealRowCountRequestAction() + public function testHandleRealRowCountRequestAction(): void { global $is_db; @@ -534,11 +522,9 @@ class StructureControllerTest extends AbstractTestCase } /** - * @return void - * * @throws ReflectionException */ - public function testDisplayTableList() + public function testDisplayTableList(): void { $class = new ReflectionClass(StructureController::class); $method = $class->getMethod('displayTableList'); diff --git a/test/classes/Controllers/Server/DatabasesControllerTest.php b/test/classes/Controllers/Server/DatabasesControllerTest.php index a26814d8a0..50cdf1a07d 100644 --- a/test/classes/Controllers/Server/DatabasesControllerTest.php +++ b/test/classes/Controllers/Server/DatabasesControllerTest.php @@ -116,10 +116,7 @@ class DatabasesControllerTest extends AbstractTestCase $this->assertStringContainsString('name="db_collation"', $actual); } - /** - * @return void - */ - public function testCreateDatabaseAction() + public function testCreateDatabaseAction(): void { $dbi = $this->getMockBuilder(DatabaseInterface::class) ->disableOriginalConstructor() @@ -176,10 +173,7 @@ class DatabasesControllerTest extends AbstractTestCase ); } - /** - * @return void - */ - public function testDropDatabasesAction() + public function testDropDatabasesAction(): void { global $cfg; diff --git a/test/classes/Controllers/Server/PluginsControllerTest.php b/test/classes/Controllers/Server/PluginsControllerTest.php index 578ee3c3fa..faf3692c03 100644 --- a/test/classes/Controllers/Server/PluginsControllerTest.php +++ b/test/classes/Controllers/Server/PluginsControllerTest.php @@ -38,10 +38,8 @@ class PluginsControllerTest extends AbstractTestCase /** * Test for index method - * - * @return void */ - public function testIndex() + public function testIndex(): void { /** * Prepare plugin list diff --git a/test/classes/Controllers/Table/IndexesControllerTest.php b/test/classes/Controllers/Table/IndexesControllerTest.php index cad3cb24f0..ebef7ff39f 100644 --- a/test/classes/Controllers/Table/IndexesControllerTest.php +++ b/test/classes/Controllers/Table/IndexesControllerTest.php @@ -85,11 +85,9 @@ class IndexesControllerTest extends AbstractTestCase /** * Tests for doSaveDataAction() method * - * @return void - * * @test */ - public function testDoSaveDataAction() + public function testDoSaveDataAction(): void { $sql_query = 'ALTER TABLE `db`.`table` DROP PRIMARY KEY, ADD UNIQUE ;'; @@ -137,11 +135,9 @@ class IndexesControllerTest extends AbstractTestCase /** * Tests for displayFormAction() * - * @return void - * * @test */ - public function testDisplayFormAction() + public function testDisplayFormAction(): void { $table = $this->getMockBuilder(Table::class) ->disableOriginalConstructor() diff --git a/test/classes/Controllers/Table/RelationControllerTest.php b/test/classes/Controllers/Table/RelationControllerTest.php index 3e42f9281f..f4b2d59429 100644 --- a/test/classes/Controllers/Table/RelationControllerTest.php +++ b/test/classes/Controllers/Table/RelationControllerTest.php @@ -52,10 +52,8 @@ class RelationControllerTest extends AbstractTestCase { /** * @param mixed $name name - * - * @return bool */ - public function exists($name) + public function exists($name): bool { return true; } @@ -96,11 +94,9 @@ class RelationControllerTest extends AbstractTestCase * Case one: this case is for the situation when the target * table is a view. * - * @return void - * * @test */ - public function testGetDropdownValueForTableActionIsView() + public function testGetDropdownValueForTableActionIsView(): void { $viewColumns = [ 'viewCol', @@ -142,11 +138,9 @@ class RelationControllerTest extends AbstractTestCase * Case one: this case is for the situation when the target * table is not a view (real tabletable). * - * @return void - * * @test */ - public function testGetDropdownValueForTableActionNotView() + public function testGetDropdownValueForTableActionNotView(): void { $indexedColumns = ['primaryTableCol']; $tableMock = $this->getMockBuilder(Table::class) @@ -183,11 +177,9 @@ class RelationControllerTest extends AbstractTestCase * * Case one: foreign * - * @return void - * * @test */ - public function testGetDropdownValueForDbActionOne() + public function testGetDropdownValueForDbActionOne(): void { $GLOBALS['dbi']->expects($this->any()) ->method('fetchArray') @@ -232,11 +224,9 @@ class RelationControllerTest extends AbstractTestCase * * Case two: not foreign * - * @return void - * * @test */ - public function testGetDropdownValueForDbActionTwo() + public function testGetDropdownValueForDbActionTwo(): void { $GLOBALS['dbi']->expects($this->any()) ->method('fetchArray') diff --git a/test/classes/Controllers/Table/SearchControllerTest.php b/test/classes/Controllers/Table/SearchControllerTest.php index 9a1b0fcebb..7814d4280b 100644 --- a/test/classes/Controllers/Table/SearchControllerTest.php +++ b/test/classes/Controllers/Table/SearchControllerTest.php @@ -101,11 +101,9 @@ class SearchControllerTest extends AbstractTestCase /** * Tests for getColumnMinMax() * - * @return void - * * @test */ - public function testGetColumnMinMax() + public function testGetColumnMinMax(): void { $expected = 'SELECT MIN(`column`) AS `min`, ' . 'MAX(`column`) AS `max` ' @@ -133,11 +131,9 @@ class SearchControllerTest extends AbstractTestCase /** * Tests for getDataRowAction() * - * @return void - * * @test */ - public function testGetDataRowAction() + public function testGetDataRowAction(): void { $meta_one = new stdClass(); $meta_one->type = 'int'; diff --git a/test/classes/Controllers/Table/StructureControllerTest.php b/test/classes/Controllers/Table/StructureControllerTest.php index a17ea62ab4..9c58964454 100644 --- a/test/classes/Controllers/Table/StructureControllerTest.php +++ b/test/classes/Controllers/Table/StructureControllerTest.php @@ -71,11 +71,9 @@ class StructureControllerTest extends AbstractTestCase * * Case one: there are no primary key in the table * - * @return void - * * @test */ - public function testGetKeyForTablePrimaryOne() + public function testGetKeyForTablePrimaryOne(): void { $GLOBALS['dbi']->expects($this->any())->method('fetchAssoc') ->will($this->returnValue(null)); @@ -109,11 +107,9 @@ class StructureControllerTest extends AbstractTestCase * * Case two: there are a primary key in the table * - * @return void - * * @test */ - public function testGetKeyForTablePrimaryTwo() + public function testGetKeyForTablePrimaryTwo(): void { $GLOBALS['dbi']->expects($this->any()) ->method('fetchAssoc') @@ -162,11 +158,9 @@ class StructureControllerTest extends AbstractTestCase /** * Tests for adjustColumnPrivileges() * - * @return void - * * @test */ - public function testAdjustColumnPrivileges() + public function testAdjustColumnPrivileges(): void { $class = new ReflectionClass(StructureController::class); $method = $class->getMethod('adjustColumnPrivileges'); diff --git a/test/classes/CoreTest.php b/test/classes/CoreTest.php index 733f7e2f54..0ad4c4dac1 100644 --- a/test/classes/CoreTest.php +++ b/test/classes/CoreTest.php @@ -43,10 +43,8 @@ class CoreTest extends AbstractNetworkTestCase /** * Test for Core::arrayRead - * - * @return void */ - public function testArrayRead() + public function testArrayRead(): void { $arr = [ 'int' => 1, @@ -147,10 +145,8 @@ class CoreTest extends AbstractNetworkTestCase /** * Test for Core::arrayWrite - * - * @return void */ - public function testArrayWrite() + public function testArrayWrite(): void { $arr = [ 'int' => 1, @@ -217,10 +213,8 @@ class CoreTest extends AbstractNetworkTestCase /** * Test for Core::arrayRemove - * - * @return void */ - public function testArrayRemove() + public function testArrayRemove(): void { $arr = [ 'int' => 1, @@ -313,7 +307,7 @@ class CoreTest extends AbstractNetworkTestCase * * @return array */ - public function providerTestGotoNowhere() + public function providerTestGotoNowhere(): array { return [ [ @@ -394,7 +388,7 @@ class CoreTest extends AbstractNetworkTestCase * * @return array */ - public function providerTestPathInfo() + public function providerTestPathInfo(): array { return [ [ @@ -450,10 +444,8 @@ class CoreTest extends AbstractNetworkTestCase /** * Test for Core::fatalError - * - * @return void */ - public function testFatalErrorMessage() + public function testFatalErrorMessage(): void { $this->expectOutputRegex('/FatalError!/'); Core::fatalError('FatalError!'); @@ -461,10 +453,8 @@ class CoreTest extends AbstractNetworkTestCase /** * Test for Core::fatalError - * - * @return void */ - public function testFatalErrorMessageWithArgs() + public function testFatalErrorMessageWithArgs(): void { $message = 'Fatal error #%d in file %s.'; $params = [ @@ -500,7 +490,7 @@ class CoreTest extends AbstractNetworkTestCase * * @return array */ - public function providerTestGetRealSize() + public function providerTestGetRealSize(): array { return [ [ @@ -540,10 +530,8 @@ class CoreTest extends AbstractNetworkTestCase /** * Test for Core::getPHPDocLink - * - * @return void */ - public function testGetPHPDocLink() + public function testGetPHPDocLink(): void { $lang = _pgettext('PHP documentation language', 'en'); $this->assertEquals( @@ -571,7 +559,7 @@ class CoreTest extends AbstractNetworkTestCase * * @return array */ - public function providerTestLinkURL() + public function providerTestLinkURL(): array { return [ [ @@ -595,10 +583,8 @@ class CoreTest extends AbstractNetworkTestCase /** * Test for Core::sendHeaderLocation - * - * @return void */ - public function testSendHeaderLocationWithoutSidWithIis() + public function testSendHeaderLocationWithoutSidWithIis(): void { $GLOBALS['server'] = 0; $GLOBALS['PMA_Config']->enableBc(); @@ -615,10 +601,8 @@ class CoreTest extends AbstractNetworkTestCase /** * Test for Core::sendHeaderLocation - * - * @return void */ - public function testSendHeaderLocationWithoutSidWithoutIis() + public function testSendHeaderLocationWithoutSidWithoutIis(): void { $GLOBALS['server'] = 0; parent::setGlobalConfig(); @@ -633,10 +617,8 @@ class CoreTest extends AbstractNetworkTestCase /** * Test for Core::sendHeaderLocation - * - * @return void */ - public function testSendHeaderLocationIisLongUri() + public function testSendHeaderLocationIisLongUri(): void { $GLOBALS['server'] = 0; parent::setGlobalConfig(); @@ -679,10 +661,8 @@ class CoreTest extends AbstractNetworkTestCase /** * Test for Core::ifSetOr - * - * @return void */ - public function testVarSet() + public function testVarSet(): void { $default = 'foo'; $in = 'bar'; @@ -692,10 +672,8 @@ class CoreTest extends AbstractNetworkTestCase /** * Test for Core::ifSetOr - * - * @return void */ - public function testVarSetWrongType() + public function testVarSetWrongType(): void { $default = 'foo'; $in = 'bar'; @@ -705,10 +683,8 @@ class CoreTest extends AbstractNetworkTestCase /** * Test for Core::ifSetOr - * - * @return void */ - public function testVarNotSet() + public function testVarNotSet(): void { $default = 'foo'; // $in is not set! @@ -718,10 +694,8 @@ class CoreTest extends AbstractNetworkTestCase /** * Test for Core::ifSetOr - * - * @return void */ - public function testVarNotSetNoDefault() + public function testVarNotSetNoDefault(): void { // $in is not set! $out = Core::ifSetOr($in); @@ -750,7 +724,7 @@ class CoreTest extends AbstractNetworkTestCase * * @return array */ - public function provideTestIsAllowedDomain() + public function provideTestIsAllowedDomain(): array { return [ [ @@ -807,7 +781,7 @@ class CoreTest extends AbstractNetworkTestCase * * @return array */ - public static function providerTestNoVarType() + public static function providerTestNoVarType(): array { return [ [ @@ -879,10 +853,8 @@ class CoreTest extends AbstractNetworkTestCase /** * Test for Core::isValid - * - * @return void */ - public function testVarNotSetAfterTest() + public function testVarNotSetAfterTest(): void { Core::isValid($var); $this->assertFalse(isset($var)); @@ -890,20 +862,16 @@ class CoreTest extends AbstractNetworkTestCase /** * Test for Core::isValid - * - * @return void */ - public function testNotSet() + public function testNotSet(): void { $this->assertFalse(Core::isValid($var)); } /** * Test for Core::isValid - * - * @return void */ - public function testEmptyString() + public function testEmptyString(): void { $var = ''; $this->assertFalse(Core::isValid($var)); @@ -911,10 +879,8 @@ class CoreTest extends AbstractNetworkTestCase /** * Test for Core::isValid - * - * @return void */ - public function testNotEmptyString() + public function testNotEmptyString(): void { $var = '0'; $this->assertTrue(Core::isValid($var)); @@ -922,10 +888,8 @@ class CoreTest extends AbstractNetworkTestCase /** * Test for Core::isValid - * - * @return void */ - public function testZero() + public function testZero(): void { $var = 0; $this->assertTrue(Core::isValid($var)); @@ -934,10 +898,8 @@ class CoreTest extends AbstractNetworkTestCase /** * Test for Core::isValid - * - * @return void */ - public function testNullFail() + public function testNullFail(): void { $var = null; $this->assertFalse(Core::isValid($var)); @@ -948,10 +910,8 @@ class CoreTest extends AbstractNetworkTestCase /** * Test for Core::isValid - * - * @return void */ - public function testNotSetArray() + public function testNotSetArray(): void { $array = []; $this->assertFalse(Core::isValid($array['x'])); @@ -959,10 +919,8 @@ class CoreTest extends AbstractNetworkTestCase /** * Test for Core::isValid - * - * @return void */ - public function testScalarString() + public function testScalarString(): void { $var = 'string'; $this->assertTrue(Core::isValid($var, 'len')); @@ -972,10 +930,8 @@ class CoreTest extends AbstractNetworkTestCase /** * Test for Core::isValid - * - * @return void */ - public function testScalarInt() + public function testScalarInt(): void { $var = 1; $this->assertTrue(Core::isValid($var, 'int')); @@ -984,10 +940,8 @@ class CoreTest extends AbstractNetworkTestCase /** * Test for Core::isValid - * - * @return void */ - public function testScalarFloat() + public function testScalarFloat(): void { $var = 1.1; $this->assertTrue(Core::isValid($var, 'float')); @@ -997,10 +951,8 @@ class CoreTest extends AbstractNetworkTestCase /** * Test for Core::isValid - * - * @return void */ - public function testScalarBool() + public function testScalarBool(): void { $var = true; $this->assertTrue(Core::isValid($var, 'scalar')); @@ -1010,10 +962,8 @@ class CoreTest extends AbstractNetworkTestCase /** * Test for Core::isValid - * - * @return void */ - public function testNotScalarArray() + public function testNotScalarArray(): void { $var = ['test']; $this->assertFalse(Core::isValid($var, 'scalar')); @@ -1021,10 +971,8 @@ class CoreTest extends AbstractNetworkTestCase /** * Test for Core::isValid - * - * @return void */ - public function testNotScalarNull() + public function testNotScalarNull(): void { $var = null; $this->assertFalse(Core::isValid($var, 'scalar')); @@ -1032,10 +980,8 @@ class CoreTest extends AbstractNetworkTestCase /** * Test for Core::isValid - * - * @return void */ - public function testNumericInt() + public function testNumericInt(): void { $var = 1; $this->assertTrue(Core::isValid($var, 'numeric')); @@ -1043,10 +989,8 @@ class CoreTest extends AbstractNetworkTestCase /** * Test for Core::isValid - * - * @return void */ - public function testNumericFloat() + public function testNumericFloat(): void { $var = 1.1; $this->assertTrue(Core::isValid($var, 'numeric')); @@ -1054,10 +998,8 @@ class CoreTest extends AbstractNetworkTestCase /** * Test for Core::isValid - * - * @return void */ - public function testNumericZero() + public function testNumericZero(): void { $var = 0; $this->assertTrue(Core::isValid($var, 'numeric')); @@ -1065,10 +1007,8 @@ class CoreTest extends AbstractNetworkTestCase /** * Test for Core::isValid - * - * @return void */ - public function testNumericString() + public function testNumericString(): void { $var = '+0.1'; $this->assertTrue(Core::isValid($var, 'numeric')); @@ -1076,10 +1016,8 @@ class CoreTest extends AbstractNetworkTestCase /** * Test for Core::isValid - * - * @return void */ - public function testValueInArray() + public function testValueInArray(): void { $var = 'a'; $this->assertTrue(Core::isValid($var, ['a', 'b'])); @@ -1087,10 +1025,8 @@ class CoreTest extends AbstractNetworkTestCase /** * Test for Core::isValid - * - * @return void */ - public function testValueNotInArray() + public function testValueNotInArray(): void { $var = 'c'; $this->assertFalse(Core::isValid($var, ['a', 'b'])); @@ -1098,10 +1034,8 @@ class CoreTest extends AbstractNetworkTestCase /** * Test for Core::isValid - * - * @return void */ - public function testNumericIdentical() + public function testNumericIdentical(): void { $var = 1; $compare = 1; @@ -1137,7 +1071,7 @@ class CoreTest extends AbstractNetworkTestCase * * @return array */ - public function provideTestSimilarType() + public function provideTestSimilarType(): array { return [ [ @@ -1188,10 +1122,8 @@ class CoreTest extends AbstractNetworkTestCase /** * Test for Core::isValid - * - * @return void */ - public function testOtherTypes() + public function testOtherTypes(): void { $var = new CoreTest(); $this->assertFalse(Core::isValid($var, 'class')); @@ -1218,7 +1150,7 @@ class CoreTest extends AbstractNetworkTestCase * * @return array */ - public function provideTestSafeUnserialize() + public function provideTestSafeUnserialize(): array { return [ [ @@ -1290,7 +1222,7 @@ class CoreTest extends AbstractNetworkTestCase * * @return array */ - public function provideTestSanitizeMySQLHost() + public function provideTestSanitizeMySQLHost(): array { return [ [ @@ -1314,10 +1246,8 @@ class CoreTest extends AbstractNetworkTestCase /** * Test for replacing dots. - * - * @return void */ - public function testReplaceDots() + public function testReplaceDots(): void { $this->assertEquals( Core::securePath('../../../etc/passwd'), @@ -1335,10 +1265,8 @@ class CoreTest extends AbstractNetworkTestCase /** * Test for Core::warnMissingExtension - * - * @return void */ - public function testMissingExtensionFatal() + public function testMissingExtensionFatal(): void { $ext = 'php_ext'; $warn = 'The assertStringContainsString( 'name="criteriaSort[0]"', @@ -148,10 +144,8 @@ class QbeTest extends AbstractTestCase /** * Test for getShowRow - * - * @return void */ - public function testGetShowRow() + public function testGetShowRow(): void { $this->assertEquals( 'assertEquals( '' @@ -197,10 +189,8 @@ class QbeTest extends AbstractTestCase /** * Test for getAndOrColCell - * - * @return void */ - public function testGetAndOrColCell() + public function testGetAndOrColCell(): void { $this->assertEquals( 'Or:assertEquals( '' @@ -251,10 +239,8 @@ class QbeTest extends AbstractTestCase /** * Test for getInputboxRow - * - * @return void */ - public function testGetInputboxRow() + public function testGetInputboxRow(): void { $this->assertEquals( 'assertEquals( '', @@ -339,10 +319,8 @@ class QbeTest extends AbstractTestCase /** * Test for getOrderByClause - * - * @return void */ - public function testGetOrderByClause() + public function testGetOrderByClause(): void { $this->assertEquals( '', @@ -357,10 +335,8 @@ class QbeTest extends AbstractTestCase /** * Test for getIndexes - * - * @return void */ - public function testGetIndexes() + public function testGetIndexes(): void { $this->assertEquals( [ @@ -389,10 +365,8 @@ class QbeTest extends AbstractTestCase /** * Test for getLeftJoinColumnCandidates - * - * @return void */ - public function testGetLeftJoinColumnCandidates() + public function testGetLeftJoinColumnCandidates(): void { $this->assertEquals( [0 => 'column2'], @@ -418,10 +392,8 @@ class QbeTest extends AbstractTestCase /** * Test for getMasterTable - * - * @return void */ - public function testGetMasterTable() + public function testGetMasterTable(): void { $this->assertEquals( 0, @@ -448,10 +420,8 @@ class QbeTest extends AbstractTestCase /** * Test for getWhereClauseTablesAndColumns - * - * @return void */ - public function testGetWhereClauseTablesAndColumns() + public function testGetWhereClauseTablesAndColumns(): void { $_POST['criteriaColumn'] = [ 'table1.id', @@ -475,10 +445,8 @@ class QbeTest extends AbstractTestCase /** * Test for getFromClause - * - * @return void */ - public function testGetFromClause() + public function testGetFromClause(): void { $_POST['criteriaColumn'] = [ 'table1.id', @@ -499,10 +467,8 @@ class QbeTest extends AbstractTestCase /** * Test for getSQLQuery - * - * @return void */ - public function testGetSQLQuery() + public function testGetSQLQuery(): void { $_POST['criteriaColumn'] = [ 'table1.id', diff --git a/test/classes/Database/RoutinesTest.php b/test/classes/Database/RoutinesTest.php index 379b8308b0..b8ab071bb7 100644 --- a/test/classes/Database/RoutinesTest.php +++ b/test/classes/Database/RoutinesTest.php @@ -68,7 +68,7 @@ class RoutinesTest extends AbstractTestCase * * @return array */ - public function providerGetDataFromRequest() + public function providerGetDataFromRequest(): array { return [ [ @@ -295,10 +295,8 @@ class RoutinesTest extends AbstractTestCase /** * Test for getParameterRow - * - * @return void */ - public function testGetParameterRowEmpty() + public function testGetParameterRowEmpty(): void { $this->assertEquals('', $this->routines->getParameterRow([], 0)); } @@ -326,7 +324,7 @@ class RoutinesTest extends AbstractTestCase * * @return array */ - public function providerGetParameterRow() + public function providerGetParameterRow(): array { $data = [ 'item_name' => '', @@ -407,7 +405,7 @@ class RoutinesTest extends AbstractTestCase * * @return array */ - public function providerGetParameterRowAjax() + public function providerGetParameterRowAjax(): array { $data = [ 'item_name' => '', @@ -465,12 +463,10 @@ class RoutinesTest extends AbstractTestCase * @param array $data Data for routine * @param array $matcher Matcher * - * @return void - * * @depends testGetParameterRowAjax * @dataProvider providerGetEditorForm1 */ - public function testGetEditorForm1($data, $matcher) + public function testGetEditorForm1($data, $matcher): void { $this->assertStringContainsString( $matcher, @@ -483,7 +479,7 @@ class RoutinesTest extends AbstractTestCase * * @return array */ - public function providerGetEditorForm1() + public function providerGetEditorForm1(): array { $data = [ 'item_name' => '', @@ -585,12 +581,10 @@ class RoutinesTest extends AbstractTestCase * @param array $data Data for routine * @param array $matcher Matcher * - * @return void - * * @depends testGetParameterRowAjax * @dataProvider providerGetEditorForm2 */ - public function testGetEditorForm2($data, $matcher) + public function testGetEditorForm2($data, $matcher): void { $this->assertStringContainsString( $matcher, @@ -603,7 +597,7 @@ class RoutinesTest extends AbstractTestCase * * @return array */ - public function providerGetEditorForm2() + public function providerGetEditorForm2(): array { $data = [ 'item_name' => 'foo', @@ -705,12 +699,10 @@ class RoutinesTest extends AbstractTestCase * @param array $data Data for routine * @param array $matcher Matcher * - * @return void - * * @depends testGetParameterRowAjax * @dataProvider providerGetEditorForm3 */ - public function testGetEditorForm3($data, $matcher) + public function testGetEditorForm3($data, $matcher): void { Response::getInstance()->setAjax(true); $this->assertStringContainsString( @@ -725,7 +717,7 @@ class RoutinesTest extends AbstractTestCase * * @return array */ - public function providerGetEditorForm3() + public function providerGetEditorForm3(): array { $data = [ 'item_name' => 'foo', @@ -827,12 +819,10 @@ class RoutinesTest extends AbstractTestCase * @param array $data Data for routine * @param array $matcher Matcher * - * @return void - * * @depends testGetParameterRowAjax * @dataProvider providerGetEditorForm4 */ - public function testGetEditorForm4($data, $matcher) + public function testGetEditorForm4($data, $matcher): void { $this->assertStringContainsString( $matcher, @@ -845,7 +835,7 @@ class RoutinesTest extends AbstractTestCase * * @return array */ - public function providerGetEditorForm4() + public function providerGetEditorForm4(): array { $data = [ 'item_name' => 'foo', @@ -887,11 +877,9 @@ class RoutinesTest extends AbstractTestCase * @param array $data Data for routine * @param array $matcher Matcher * - * @return void - * * @dataProvider providerGetExecuteForm1 */ - public function testGetExecuteForm1($data, $matcher) + public function testGetExecuteForm1($data, $matcher): void { $GLOBALS['cfg']['ShowFunctionFields'] = true; @@ -906,7 +894,7 @@ class RoutinesTest extends AbstractTestCase * * @return array */ - public function providerGetExecuteForm1() + public function providerGetExecuteForm1(): array { $data = [ 'item_name' => 'foo', @@ -1029,11 +1017,9 @@ class RoutinesTest extends AbstractTestCase * @param array $data Data for routine * @param array $matcher Matcher * - * @return void - * * @dataProvider providerGetExecuteForm2 */ - public function testGetExecuteForm2($data, $matcher) + public function testGetExecuteForm2($data, $matcher): void { Response::getInstance()->setAjax(true); $this->assertStringContainsString( @@ -1048,7 +1034,7 @@ class RoutinesTest extends AbstractTestCase * * @return array */ - public function providerGetExecuteForm2() + public function providerGetExecuteForm2(): array { $data = [ 'item_name' => 'foo', @@ -1208,7 +1194,7 @@ class RoutinesTest extends AbstractTestCase * * @return array */ - public function providerGetQueryFromRequest() + public function providerGetQueryFromRequest(): array { return [ // Testing success diff --git a/test/classes/Database/SearchTest.php b/test/classes/Database/SearchTest.php index af3699a0ce..30ad599400 100644 --- a/test/classes/Database/SearchTest.php +++ b/test/classes/Database/SearchTest.php @@ -98,7 +98,7 @@ class SearchTest extends AbstractTestCase * * @return array */ - public function searchTypes() + public function searchTypes(): array { return [ [ @@ -135,10 +135,8 @@ class SearchTest extends AbstractTestCase /** * Test for getSearchSqls - * - * @return void */ - public function testGetSearchSqls() + public function testGetSearchSqls(): void { $this->assertEquals( [ @@ -158,10 +156,8 @@ class SearchTest extends AbstractTestCase /** * Test for getSearchResults - * - * @return void */ - public function testGetSearchResults() + public function testGetSearchResults(): void { $this->assertStringContainsString( 'Search results for "" :', @@ -171,10 +167,8 @@ class SearchTest extends AbstractTestCase /** * Test for getSelectionForm - * - * @return void */ - public function testGetMainHtml() + public function testGetMainHtml(): void { $main = $this->object->getMainHtml(); diff --git a/test/classes/Database/TriggersTest.php b/test/classes/Database/TriggersTest.php index 21d170f1b0..457e37e815 100644 --- a/test/classes/Database/TriggersTest.php +++ b/test/classes/Database/TriggersTest.php @@ -63,7 +63,7 @@ class TriggersTest extends AbstractTestCase * * @return array */ - public function providerGetDataFromRequestEmpty() + public function providerGetDataFromRequestEmpty(): array { return [ [ @@ -132,7 +132,7 @@ class TriggersTest extends AbstractTestCase * * @return array */ - public function providerGetEditorFormAdd() + public function providerGetEditorFormAdd(): array { $data = [ 'item_name' => '', @@ -203,7 +203,7 @@ class TriggersTest extends AbstractTestCase * * @return array */ - public function providerGetEditorFormEdit() + public function providerGetEditorFormEdit(): array { $data = [ 'item_name' => 'foo', @@ -275,7 +275,7 @@ class TriggersTest extends AbstractTestCase * * @return array */ - public function providerGetEditorFormAjax() + public function providerGetEditorFormAjax(): array { $data = [ 'item_name' => 'foo', @@ -311,8 +311,6 @@ class TriggersTest extends AbstractTestCase * @param string $query Query * @param string $num_err Error number * - * @return void - * * @dataProvider providerGetQueryFromRequest */ public function testGetQueryFromRequest( @@ -324,7 +322,7 @@ class TriggersTest extends AbstractTestCase $definition, $query, $num_err - ) { + ): void { global $errors; $errors = []; @@ -346,7 +344,7 @@ class TriggersTest extends AbstractTestCase * * @return array */ - public function providerGetQueryFromRequest() + public function providerGetQueryFromRequest(): array { return [ [ diff --git a/test/classes/DatabaseInterfaceTest.php b/test/classes/DatabaseInterfaceTest.php index 1acc4e1aee..da86a6e607 100644 --- a/test/classes/DatabaseInterfaceTest.php +++ b/test/classes/DatabaseInterfaceTest.php @@ -71,7 +71,7 @@ class DatabaseInterfaceTest extends AbstractTestCase * * @return array */ - public function currentUserData() + public function currentUserData(): array { return [ [ @@ -104,11 +104,9 @@ class DatabaseInterfaceTest extends AbstractTestCase /** * Tests for DBI::getColumnMapFromSql() method. * - * @return void - * * @test */ - public function testPMAGetColumnMap() + public function testPMAGetColumnMap(): void { $extension = $this->getMockBuilder(DbiDummy::class) ->disableOriginalConstructor() @@ -171,11 +169,9 @@ class DatabaseInterfaceTest extends AbstractTestCase /** * Tests for DBI::getSystemDatabase() method. * - * @return void - * * @test */ - public function testGetSystemDatabase() + public function testGetSystemDatabase(): void { $sd = $this->_dbi->getSystemDatabase(); $this->assertInstanceOf(SystemDatabase::class, $sd); @@ -184,11 +180,9 @@ class DatabaseInterfaceTest extends AbstractTestCase /** * Tests for DBI::postConnectControl() method. * - * @return void - * * @test */ - public function testPostConnectControl() + public function testPostConnectControl(): void { $GLOBALS['db'] = ''; $GLOBALS['cfg']['Server']['only_db'] = []; @@ -199,11 +193,9 @@ class DatabaseInterfaceTest extends AbstractTestCase /** * Test for getDbCollation * - * @return void - * * @test */ - public function testGetDbCollation() + public function testGetDbCollation(): void { $GLOBALS['server'] = 1; // test case for system schema @@ -224,11 +216,9 @@ class DatabaseInterfaceTest extends AbstractTestCase /** * Test for getServerCollation * - * @return void - * * @test */ - public function testGetServerCollation() + public function testGetServerCollation(): void { $GLOBALS['server'] = 1; $GLOBALS['cfg']['DBG']['sql'] = true; @@ -255,7 +245,7 @@ class DatabaseInterfaceTest extends AbstractTestCase /** * @return array */ - public function errorData() + public function errorData(): array { return [ [ @@ -297,12 +287,10 @@ class DatabaseInterfaceTest extends AbstractTestCase * @param mixed $value value * @param mixed $expected expected result * - * @return void - * * @test * @dataProvider isAmazonRdsData */ - public function atestIsAmazonRdsData($value, $expected) + public function atestIsAmazonRdsData($value, $expected): void { Util::cacheUnset('is_amazon_rds'); @@ -322,7 +310,7 @@ class DatabaseInterfaceTest extends AbstractTestCase * * @return array */ - public function isAmazonRdsData() + public function isAmazonRdsData(): array { return [ [ @@ -365,7 +353,7 @@ class DatabaseInterfaceTest extends AbstractTestCase /** * @return array */ - public function versionData() + public function versionData(): array { return [ [ @@ -398,11 +386,9 @@ class DatabaseInterfaceTest extends AbstractTestCase /** * Tests for DBI::setCollationl() method. * - * @return void - * * @test */ - public function testSetCollation() + public function testSetCollation(): void { $extension = $this->getMockBuilder(DbiDummy::class) ->disableOriginalConstructor() @@ -438,11 +424,9 @@ class DatabaseInterfaceTest extends AbstractTestCase /** * Tests for DBI::getForeignKeyConstrains() method. * - * @return void - * * @test */ - public function testGetForeignKeyConstrains() + public function testGetForeignKeyConstrains(): void { $this->assertEquals([ [ diff --git a/test/classes/Dbal/DbiDummyTest.php b/test/classes/Dbal/DbiDummyTest.php index c133b5a94d..f17d3248a8 100644 --- a/test/classes/Dbal/DbiDummyTest.php +++ b/test/classes/Dbal/DbiDummyTest.php @@ -30,10 +30,8 @@ class DbiDummyTest extends AbstractTestCase * Simple test for basic query * * This relies on dummy driver internals - * - * @return void */ - public function testQuery() + public function testQuery(): void { $this->assertEquals(1000, $GLOBALS['dbi']->tryQuery('SELECT 1')); } @@ -42,10 +40,8 @@ class DbiDummyTest extends AbstractTestCase * Simple test for fetching results of query * * This relies on dummy driver internals - * - * @return void */ - public function testFetch() + public function testFetch(): void { $result = $GLOBALS['dbi']->tryQuery('SELECT 1'); $this->assertEquals(['1'], $GLOBALS['dbi']->fetchArray($result)); @@ -69,7 +65,7 @@ class DbiDummyTest extends AbstractTestCase * * @return array with test data */ - public function schemaData() + public function schemaData(): array { return [ [ @@ -106,7 +102,7 @@ class DbiDummyTest extends AbstractTestCase * * @return array with test data */ - public function errorData() + public function errorData(): array { return [ [ diff --git a/test/classes/Display/ChangePasswordTest.php b/test/classes/Display/ChangePasswordTest.php index 69ebb8ed31..782f389c08 100644 --- a/test/classes/Display/ChangePasswordTest.php +++ b/test/classes/Display/ChangePasswordTest.php @@ -47,10 +47,8 @@ class ChangePasswordTest extends AbstractTestCase /** * Test for ChangePassword::getHtml - * - * @return void */ - public function testGetHtml() + public function testGetHtml(): void { $username = 'pma_username'; $hostname = 'pma_hostname'; diff --git a/test/classes/Display/CreateTableTest.php b/test/classes/Display/CreateTableTest.php index 210bebe212..220cc02b41 100644 --- a/test/classes/Display/CreateTableTest.php +++ b/test/classes/Display/CreateTableTest.php @@ -46,10 +46,8 @@ class CreateTableTest extends AbstractTestCase /** * Test for CreateTable::getHtml - * - * @return void */ - public function testPMAGetHtmlForCreateTable() + public function testPMAGetHtmlForCreateTable(): void { $db = 'pma_db'; diff --git a/test/classes/Display/ExportTest.php b/test/classes/Display/ExportTest.php index bee491df29..0b16ef9fb3 100644 --- a/test/classes/Display/ExportTest.php +++ b/test/classes/Display/ExportTest.php @@ -58,10 +58,8 @@ class ExportTest extends AbstractTestCase /** * Test for Export::getHtmlForHiddenInputs - * - * @return void */ - public function testGetHtmlForHiddenInputs() + public function testGetHtmlForHiddenInputs(): void { $export_type = 'server'; $db = 'PMA'; @@ -97,10 +95,8 @@ class ExportTest extends AbstractTestCase /** * Test for Export::getHtmlForOptions - * - * @return void */ - public function testGetHtmlForOptions() + public function testGetHtmlForOptions(): void { global $cfg; $cfg['Export']['method'] = 'XML'; @@ -240,10 +236,8 @@ class ExportTest extends AbstractTestCase /** * Test for Export::getHtmlForAliasModalDialog - * - * @return void */ - public function testGetHtmlForAliasModalDialog() + public function testGetHtmlForAliasModalDialog(): void { $columns_info = [ 'test\'_db' => [ diff --git a/test/classes/Display/ResultsTest.php b/test/classes/Display/ResultsTest.php index 955ecc9735..438116ca36 100644 --- a/test/classes/Display/ResultsTest.php +++ b/test/classes/Display/ResultsTest.php @@ -73,10 +73,8 @@ class ResultsTest extends AbstractTestCase /** * Test for isSelect function - * - * @return void */ - public function testisSelect() + public function testisSelect(): void { $parser = new Parser('SELECT * FROM pma'); $this->assertTrue( @@ -102,8 +100,6 @@ class ResultsTest extends AbstractTestCase * @param int $pos position for next query * @param string $html_sql_query query ready for display * - * @return void - * * @dataProvider providerForTestGetTableNavigationButton */ public function testGetTableNavigationButton( @@ -111,7 +107,7 @@ class ResultsTest extends AbstractTestCase $title, $pos, $html_sql_query - ) { + ): void { $GLOBALS['cfg']['TableNavigationLinksMode'] = 'icons'; $_SESSION[' PMA_token '] = 'token'; @@ -155,7 +151,7 @@ class ResultsTest extends AbstractTestCase * * @return array array data for testGetTableNavigationButton */ - public function providerForTestGetTableNavigationButton() + public function providerForTestGetTableNavigationButton(): array { return [ [ @@ -172,7 +168,7 @@ class ResultsTest extends AbstractTestCase * * @return array data for testGetTableNavigation */ - public function providerForTestGetTableNavigation() + public function providerForTestGetTableNavigation(): array { return [ [ @@ -189,7 +185,7 @@ class ResultsTest extends AbstractTestCase * * @return array parameters and output */ - public function dataProviderForTestGetClassesForColumn() + public function dataProviderForTestGetClassesForColumn(): array { return [ [ @@ -213,8 +209,6 @@ class ResultsTest extends AbstractTestCase * @param string $field_type_class the class related to type of the field * @param string $output output of__getResettedClassForInlineEdit * - * @return void - * * @dataProvider dataProviderForTestGetClassesForColumn */ public function testGetClassesForColumn( @@ -224,7 +218,7 @@ class ResultsTest extends AbstractTestCase $hide_class, $field_type_class, $output - ) { + ): void { $GLOBALS['cfg']['BrowsePointerEnable'] = true; $GLOBALS['cfg']['BrowseMarkerEnable'] = true; @@ -247,10 +241,8 @@ class ResultsTest extends AbstractTestCase /** * Test for getClassForDateTimeRelatedFields - case 1 - * - * @return void */ - public function testGetClassForDateTimeRelatedFieldsCase1() + public function testGetClassForDateTimeRelatedFieldsCase1(): void { $this->assertEquals( 'datetimefield', @@ -265,10 +257,8 @@ class ResultsTest extends AbstractTestCase /** * Test for getClassForDateTimeRelatedFields - case 2 - * - * @return void */ - public function testGetClassForDateTimeRelatedFieldsCase2() + public function testGetClassForDateTimeRelatedFieldsCase2(): void { $this->assertEquals( 'datefield', @@ -283,10 +273,8 @@ class ResultsTest extends AbstractTestCase /** * Test for getClassForDateTimeRelatedFields - case 3 - * - * @return void */ - public function testGetClassForDateTimeRelatedFieldsCase3() + public function testGetClassForDateTimeRelatedFieldsCase3(): void { $this->assertEquals( 'text', @@ -301,10 +289,8 @@ class ResultsTest extends AbstractTestCase /** * Test for getOffsets - case 1 - * - * @return void */ - public function testGetOffsetsCase1() + public function testGetOffsetsCase1(): void { $_SESSION['tmpval']['max_rows'] = DisplayResults::ALL_ROWS; $this->assertEquals( @@ -323,10 +309,8 @@ class ResultsTest extends AbstractTestCase /** * Test for getOffsets - case 2 - * - * @return void */ - public function testGetOffsetsCase2() + public function testGetOffsetsCase2(): void { $_SESSION['tmpval']['max_rows'] = 5; $_SESSION['tmpval']['pos'] = 4; @@ -349,7 +333,7 @@ class ResultsTest extends AbstractTestCase * * @return array parameters and output */ - public function dataProviderForTestGetSpecialLinkUrl() + public function dataProviderForTestGetSpecialLinkUrl(): array { return [ [ @@ -404,8 +388,6 @@ class ResultsTest extends AbstractTestCase * @param string $field_name column name * @param bool $output output of getSpecialLinkUrl * - * @return void - * * @dataProvider dataProviderForTestGetSpecialLinkUrl */ public function testGetSpecialLinkUrl( @@ -415,7 +397,7 @@ class ResultsTest extends AbstractTestCase $row_info, $field_name, $output - ) { + ): void { $specialSchemaLinks = [ 'information_schema' => [ 'routines' => [ @@ -483,7 +465,7 @@ class ResultsTest extends AbstractTestCase * * @return array parameters and output */ - public function dataProviderForTestGetRowInfoForSpecialLinks() + public function dataProviderForTestGetRowInfoForSpecialLinks(): array { $column_names = [ 'host', @@ -534,8 +516,6 @@ class ResultsTest extends AbstractTestCase * @param array $col_order the column order * @param bool $output output of getRowInfoForSpecialLinks * - * @return void - * * @dataProvider dataProviderForTestGetRowInfoForSpecialLinks */ public function testGetRowInfoForSpecialLinks( @@ -544,7 +524,7 @@ class ResultsTest extends AbstractTestCase $row, $col_order, $output - ) { + ): void { $this->object->__set('fields_meta', $fields_meta); $this->object->__set('fields_cnt', $fields_count); @@ -567,7 +547,7 @@ class ResultsTest extends AbstractTestCase * * @return array parameters and output */ - public function dataProviderForTestSetHighlightedColumnGlobalField() + public function dataProviderForTestSetHighlightedColumnGlobalField(): array { $parser = new Parser( 'SELECT * FROM db_name WHERE `db_name`.`tbl`.id > 0 AND `id` < 10' @@ -613,7 +593,7 @@ class ResultsTest extends AbstractTestCase * * @return array parameters and output */ - public function dataProviderForTestGetPartialText() + public function dataProviderForTestGetPartialText(): array { return [ [ @@ -689,7 +669,7 @@ class ResultsTest extends AbstractTestCase * * @return array parameters and output */ - public function dataProviderForTestHandleNonPrintableContents() + public function dataProviderForTestHandleNonPrintableContents(): array { $transformation_plugin = new Text_Plain_Link(); $meta = new stdClass(); @@ -812,8 +792,6 @@ class ResultsTest extends AbstractTestCase * @param bool $is_truncated the result is truncated or not * @param string $output the output of this function * - * @return void - * * @dataProvider dataProviderForTestHandleNonPrintableContents */ public function testHandleNonPrintableContents( @@ -828,7 +806,7 @@ class ResultsTest extends AbstractTestCase $url_params, $is_truncated, $output - ) { + ): void { $_SESSION['tmpval']['display_binary'] = $display_binary; $_SESSION['tmpval']['display_blob'] = $display_blob; $GLOBALS['cfg']['LimitChars'] = 50; @@ -857,7 +835,7 @@ class ResultsTest extends AbstractTestCase * * @return array parameters and output */ - public function dataProviderForTestGetDataCellForNonNumericColumns() + public function dataProviderForTestGetDataCellForNonNumericColumns(): array { $transformation_plugin = new Text_Plain_Link(); $meta = new stdClass(); @@ -1005,8 +983,6 @@ class ResultsTest extends AbstractTestCase * @param int $col_index the column index * @param string $output the output of this function * - * @return void - * * @dataProvider dataProviderForTestGetDataCellForNonNumericColumns */ public function testGetDataCellForNonNumericColumns( @@ -1025,7 +1001,7 @@ class ResultsTest extends AbstractTestCase $dt_result, $col_index, $output - ) { + ): void { $_SESSION['tmpval']['display_binary'] = true; $_SESSION['tmpval']['display_blob'] = false; $_SESSION['tmpval']['relational_display'] = false; @@ -1061,10 +1037,8 @@ class ResultsTest extends AbstractTestCase * * It mocks data needed to display two transformations and asserts * they are rendered. - * - * @return void */ - public function testOutputTransformations() + public function testOutputTransformations(): void { // Fake relation settings $_SESSION['tmpval']['relational_display'] = 'K'; diff --git a/test/classes/EncodingTest.php b/test/classes/EncodingTest.php index b9a2b96487..f8702edbde 100644 --- a/test/classes/EncodingTest.php +++ b/test/classes/EncodingTest.php @@ -38,12 +38,10 @@ class EncodingTest extends AbstractTestCase /** * Test for Encoding::convertString * - * @return void - * * @test * @group medium */ - public function testNoConversion() + public function testNoConversion(): void { $this->assertEquals( 'test', @@ -51,10 +49,7 @@ class EncodingTest extends AbstractTestCase ); } - /** - * @return void - */ - public function testInvalidConversion() + public function testInvalidConversion(): void { // Invalid value to use default case Encoding::setEngine(-1); @@ -64,10 +59,7 @@ class EncodingTest extends AbstractTestCase ); } - /** - * @return void - */ - public function testRecode() + public function testRecode(): void { if (! function_exists('recode_string')) { $this->markTestSkipped('recode extension missing'); @@ -89,11 +81,9 @@ class EncodingTest extends AbstractTestCase * * @see https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=854821#27 * - * @return void - * * @group extension-iconv */ - public function testIconv() + public function testIconv(): void { if (! function_exists('iconv')) { $this->markTestSkipped('iconv extension missing'); @@ -126,10 +116,7 @@ class EncodingTest extends AbstractTestCase } } - /** - * @return void - */ - public function testMbstring() + public function testMbstring(): void { Encoding::setEngine(Encoding::ENGINE_MB); $this->assertEquals( @@ -145,11 +132,9 @@ class EncodingTest extends AbstractTestCase /** * Test for kanjiChangeOrder * - * @return void - * * @test */ - public function testChangeOrder() + public function testChangeOrder(): void { $this->assertEquals('ASCII,SJIS,EUC-JP,JIS', Encoding::getKanjiEncodings()); Encoding::kanjiChangeOrder(); @@ -161,11 +146,9 @@ class EncodingTest extends AbstractTestCase /** * Test for Encoding::kanjiStrConv * - * @return void - * * @test */ - public function testKanjiStrConv() + public function testKanjiStrConv(): void { $this->assertEquals( 'test', @@ -193,11 +176,9 @@ class EncodingTest extends AbstractTestCase /** * Test for Encoding::kanjiFileConv * - * @return void - * * @test */ - public function testFileConv() + public function testFileConv(): void { $file_str = '教育漢字常用漢字'; $filename = 'test.kanji'; @@ -219,11 +200,9 @@ class EncodingTest extends AbstractTestCase /** * Test for Encoding::kanjiEncodingForm * - * @return void - * * @test */ - public function testEncodingForm() + public function testEncodingForm(): void { $actual = Encoding::kanjiEncodingForm(); $this->assertStringContainsString( @@ -248,10 +227,7 @@ class EncodingTest extends AbstractTestCase ); } - /** - * @return void - */ - public function testListEncodings() + public function testListEncodings(): void { $GLOBALS['cfg']['AvailableCharsets'] = ['utf-8']; $result = Encoding::listEncodings(); diff --git a/test/classes/Engines/BdbTest.php b/test/classes/Engines/BdbTest.php index f5260ae70c..d8e1608a44 100644 --- a/test/classes/Engines/BdbTest.php +++ b/test/classes/Engines/BdbTest.php @@ -45,10 +45,8 @@ class BdbTest extends AbstractTestCase /** * Test for getVariables - * - * @return void */ - public function testGetVariables() + public function testGetVariables(): void { $this->assertEquals( $this->object->getVariables(), @@ -76,10 +74,8 @@ class BdbTest extends AbstractTestCase /** * Test for getVariablesLikePattern - * - * @return void */ - public function testGetVariablesLikePattern() + public function testGetVariablesLikePattern(): void { $this->assertEquals( $this->object->getVariablesLikePattern(), @@ -89,10 +85,8 @@ class BdbTest extends AbstractTestCase /** * Test for getMysqlHelpPage - * - * @return void */ - public function testGetMysqlHelpPage() + public function testGetMysqlHelpPage(): void { $this->assertEquals( $this->object->getMysqlHelpPage(), diff --git a/test/classes/Engines/BinlogTest.php b/test/classes/Engines/BinlogTest.php index bd3312efc3..24c5ebb6cf 100644 --- a/test/classes/Engines/BinlogTest.php +++ b/test/classes/Engines/BinlogTest.php @@ -45,10 +45,8 @@ class BinlogTest extends AbstractTestCase /** * Test for getMysqlHelpPage - * - * @return void */ - public function testGetMysqlHelpPage() + public function testGetMysqlHelpPage(): void { $this->assertEquals( $this->object->getMysqlHelpPage(), diff --git a/test/classes/Engines/InnodbTest.php b/test/classes/Engines/InnodbTest.php index c706fa80f8..fbdb25105a 100644 --- a/test/classes/Engines/InnodbTest.php +++ b/test/classes/Engines/InnodbTest.php @@ -45,10 +45,8 @@ class InnodbTest extends AbstractTestCase /** * Test for getVariables - * - * @return void */ - public function testGetVariables() + public function testGetVariables(): void { $this->assertEquals( [ @@ -111,10 +109,8 @@ class InnodbTest extends AbstractTestCase /** * Test for getVariablesLikePattern - * - * @return void */ - public function testGetVariablesLikePattern() + public function testGetVariablesLikePattern(): void { $this->assertEquals( 'innodb\\_%', @@ -124,10 +120,8 @@ class InnodbTest extends AbstractTestCase /** * Test for getInfoPages - * - * @return void */ - public function testGetInfoPages() + public function testGetInfoPages(): void { $this->assertEquals( [], @@ -145,10 +139,8 @@ class InnodbTest extends AbstractTestCase /** * Test for getPageBufferpool - * - * @return void */ - public function testGetPageBufferpool() + public function testGetPageBufferpool(): void { $this->assertEquals( '' . "\n" . @@ -231,10 +223,8 @@ class InnodbTest extends AbstractTestCase /** * Test for getPageStatus - * - * @return void */ - public function testGetPageStatus() + public function testGetPageStatus(): void { $this->assertEquals( '
' . "\n\n" . '
' . "\n", @@ -244,10 +234,8 @@ class InnodbTest extends AbstractTestCase /** * Test for getPage - * - * @return void */ - public function testGetPage() + public function testGetPage(): void { $this->assertEquals( '', @@ -262,10 +250,8 @@ class InnodbTest extends AbstractTestCase /** * Test for getMysqlHelpPage - * - * @return void */ - public function testGetMysqlHelpPage() + public function testGetMysqlHelpPage(): void { $this->assertEquals( 'innodb-storage-engine', @@ -275,10 +261,8 @@ class InnodbTest extends AbstractTestCase /** * Test for getInnodbPluginVersion - * - * @return void */ - public function testGetInnodbPluginVersion() + public function testGetInnodbPluginVersion(): void { $this->assertEquals( '1.1.8', @@ -288,10 +272,8 @@ class InnodbTest extends AbstractTestCase /** * Test for supportsFilePerTable - * - * @return void */ - public function testSupportsFilePerTable() + public function testSupportsFilePerTable(): void { $this->assertFalse( $this->object->supportsFilePerTable() @@ -300,10 +282,8 @@ class InnodbTest extends AbstractTestCase /** * Test for getInnodbFileFormat - * - * @return void */ - public function testGetInnodbFileFormat() + public function testGetInnodbFileFormat(): void { $this->assertEquals( 'Antelope', diff --git a/test/classes/Engines/MemoryTest.php b/test/classes/Engines/MemoryTest.php index d5a8b6cb22..3d811b509d 100644 --- a/test/classes/Engines/MemoryTest.php +++ b/test/classes/Engines/MemoryTest.php @@ -45,10 +45,8 @@ class MemoryTest extends AbstractTestCase /** * Test for getVariables - * - * @return void */ - public function testGetVariables() + public function testGetVariables(): void { $this->assertEquals( $this->object->getVariables(), diff --git a/test/classes/Engines/MrgMyisamTest.php b/test/classes/Engines/MrgMyisamTest.php index 3ff2259ffa..65f899bb70 100644 --- a/test/classes/Engines/MrgMyisamTest.php +++ b/test/classes/Engines/MrgMyisamTest.php @@ -45,10 +45,8 @@ class MrgMyisamTest extends AbstractTestCase /** * Test for getMysqlHelpPage - * - * @return void */ - public function testGetMysqlHelpPage() + public function testGetMysqlHelpPage(): void { $this->assertEquals( $this->object->getMysqlHelpPage(), diff --git a/test/classes/Engines/MyisamTest.php b/test/classes/Engines/MyisamTest.php index 1f1b9be2fa..6565f7e189 100644 --- a/test/classes/Engines/MyisamTest.php +++ b/test/classes/Engines/MyisamTest.php @@ -45,10 +45,8 @@ class MyisamTest extends AbstractTestCase /** * Test for getVariables - * - * @return void */ - public function testGetVariables() + public function testGetVariables(): void { $this->assertEquals( $this->object->getVariables(), diff --git a/test/classes/Engines/NdbclusterTest.php b/test/classes/Engines/NdbclusterTest.php index 07229775e6..a3ac988931 100644 --- a/test/classes/Engines/NdbclusterTest.php +++ b/test/classes/Engines/NdbclusterTest.php @@ -45,10 +45,8 @@ class NdbclusterTest extends AbstractTestCase /** * Test for getVariables - * - * @return void */ - public function testGetVariables() + public function testGetVariables(): void { $this->assertEquals( $this->object->getVariables(), @@ -60,10 +58,8 @@ class NdbclusterTest extends AbstractTestCase /** * Test for getVariablesLikePattern - * - * @return void */ - public function testGetVariablesLikePattern() + public function testGetVariablesLikePattern(): void { $this->assertEquals( $this->object->getVariablesLikePattern(), @@ -73,10 +69,8 @@ class NdbclusterTest extends AbstractTestCase /** * Test for getMysqlHelpPage - * - * @return void */ - public function testGetMysqlHelpPage() + public function testGetMysqlHelpPage(): void { $this->assertEquals( $this->object->getMysqlHelpPage(), diff --git a/test/classes/Engines/PbxtTest.php b/test/classes/Engines/PbxtTest.php index 755d9c0c79..0aada4b65d 100644 --- a/test/classes/Engines/PbxtTest.php +++ b/test/classes/Engines/PbxtTest.php @@ -49,10 +49,8 @@ class PbxtTest extends AbstractTestCase /** * Test for getVariables - * - * @return void */ - public function testGetVariables() + public function testGetVariables(): void { $this->assertEquals( $this->object->getVariables(), @@ -187,7 +185,7 @@ class PbxtTest extends AbstractTestCase * * @return array */ - public function providerFortTestResolveTypeSize() + public function providerFortTestResolveTypeSize(): array { return [ [ @@ -216,10 +214,8 @@ class PbxtTest extends AbstractTestCase /** * Test for getInfoPages - * - * @return void */ - public function testGetInfoPages() + public function testGetInfoPages(): void { $this->assertEquals( $this->object->getInfoPages(), @@ -229,10 +225,8 @@ class PbxtTest extends AbstractTestCase /** * Test for getPage - * - * @return void */ - public function testGetPage() + public function testGetPage(): void { $this->assertEquals( $this->object->getPage('Documentation'), diff --git a/test/classes/EnvironmentTest.php b/test/classes/EnvironmentTest.php index 8bf542b66a..4186e85873 100644 --- a/test/classes/EnvironmentTest.php +++ b/test/classes/EnvironmentTest.php @@ -17,10 +17,8 @@ class EnvironmentTest extends AbstractTestCase { /** * Tests PHP version - * - * @return void */ - public function testPhpVersion() + public function testPhpVersion(): void { $this->assertTrue( version_compare('7.1.3', PHP_VERSION, '<='), diff --git a/test/classes/ErrorHandlerTest.php b/test/classes/ErrorHandlerTest.php index c3399e0e05..5784467465 100644 --- a/test/classes/ErrorHandlerTest.php +++ b/test/classes/ErrorHandlerTest.php @@ -54,7 +54,7 @@ class ErrorHandlerTest extends AbstractTestCase * * @return array data for testHandleError */ - public function providerForTestHandleError() + public function providerForTestHandleError(): array { return [ [ @@ -88,8 +88,6 @@ class ErrorHandlerTest extends AbstractTestCase * @param string $output_hide expected output if showing of errors is * disabled and 'sendErrorReports' is set to 'never' * - * @return void - * * @dataProvider providerForTestHandleError */ public function testGetDispErrorsForDisplayFalse( @@ -99,7 +97,7 @@ class ErrorHandlerTest extends AbstractTestCase $errline, $output_show, $output_hide - ) { + ): void { // TODO: Add other test cases for all combination of 'sendErrorReports' $GLOBALS['cfg']['SendErrorReports'] = 'never'; @@ -126,8 +124,6 @@ class ErrorHandlerTest extends AbstractTestCase * @param string $output_hide expected output if showing of errors is * disabled * - * @return void - * * @dataProvider providerForTestHandleError */ public function testGetDispErrorsForDisplayTrue( @@ -137,7 +133,7 @@ class ErrorHandlerTest extends AbstractTestCase $errline, $output_show, $output_hide - ) { + ): void { $this->object->handleError($errno, $errstr, $errfile, $errline); $this->assertStringContainsString( @@ -148,10 +144,8 @@ class ErrorHandlerTest extends AbstractTestCase /** * Test for checkSavedErrors - * - * @return void */ - public function testCheckSavedErrors() + public function testCheckSavedErrors(): void { $this->callFunction( $this->object, @@ -165,11 +159,9 @@ class ErrorHandlerTest extends AbstractTestCase /** * Test for countErrors * - * @return void - * * @group medium */ - public function testCountErrors() + public function testCountErrors(): void { $this->object->addError( 'Compile Error', @@ -186,11 +178,9 @@ class ErrorHandlerTest extends AbstractTestCase /** * Test for sliceErrors * - * @return void - * * @group medium */ - public function testSliceErrors() + public function testSliceErrors(): void { $this->object->addError( 'Compile Error', @@ -222,10 +212,8 @@ class ErrorHandlerTest extends AbstractTestCase /** * Test for countUserErrors - * - * @return void */ - public function testCountUserErrors() + public function testCountUserErrors(): void { $this->object->addError( 'Compile Error', @@ -251,30 +239,24 @@ class ErrorHandlerTest extends AbstractTestCase /** * Test for hasUserErrors - * - * @return void */ - public function testHasUserErrors() + public function testHasUserErrors(): void { $this->assertFalse($this->object->hasUserErrors()); } /** * Test for hasErrors - * - * @return void */ - public function testHasErrors() + public function testHasErrors(): void { $this->assertFalse($this->object->hasErrors()); } /** * Test for countDisplayErrors - * - * @return void */ - public function testCountDisplayErrorsForDisplayTrue() + public function testCountDisplayErrorsForDisplayTrue(): void { $this->assertEquals( 0, @@ -284,10 +266,8 @@ class ErrorHandlerTest extends AbstractTestCase /** * Test for countDisplayErrors - * - * @return void */ - public function testCountDisplayErrorsForDisplayFalse() + public function testCountDisplayErrorsForDisplayFalse(): void { $this->assertEquals( 0, @@ -297,10 +277,8 @@ class ErrorHandlerTest extends AbstractTestCase /** * Test for hasDisplayErrors - * - * @return void */ - public function testHasDisplayErrors() + public function testHasDisplayErrors(): void { $this->assertFalse($this->object->hasDisplayErrors()); } diff --git a/test/classes/ErrorTest.php b/test/classes/ErrorTest.php index 34345b2a71..f975a78e05 100644 --- a/test/classes/ErrorTest.php +++ b/test/classes/ErrorTest.php @@ -48,10 +48,8 @@ class ErrorTest extends AbstractTestCase /** * Test for setBacktrace - * - * @return void */ - public function testSetBacktrace() + public function testSetBacktrace(): void { $bt = [ [ @@ -68,10 +66,8 @@ class ErrorTest extends AbstractTestCase /** * Test for setLine - * - * @return void */ - public function testSetLine() + public function testSetLine(): void { $this->object->setLine(15); $this->assertEquals(15, $this->object->getLine()); @@ -96,7 +92,7 @@ class ErrorTest extends AbstractTestCase * * @return array */ - public function filePathProvider() + public function filePathProvider(): array { return [ [ @@ -117,10 +113,8 @@ class ErrorTest extends AbstractTestCase /** * Test for getHash - * - * @return void */ - public function testGetHash() + public function testGetHash(): void { $this->assertEquals( 1, @@ -130,10 +124,8 @@ class ErrorTest extends AbstractTestCase /** * Test for getBacktraceDisplay - * - * @return void */ - public function testGetBacktraceDisplay() + public function testGetBacktraceDisplay(): void { $this->assertStringContainsString( 'PHPUnit\Framework\TestResult->run()
', @@ -143,10 +135,8 @@ class ErrorTest extends AbstractTestCase /** * Test for getDisplay - * - * @return void */ - public function testGetDisplay() + public function testGetDisplay(): void { $this->assertStringContainsString( '