Visitar URL original
Fix PHPUnit 11 deprecations (#19057) · phpmyadmin/phpmyadmin@8754b9b · GitHub
Skip to content

Commit 8754b9b

Browse files
Fix PHPUnit 11 deprecations (#19057)
* Metadata in doc-comments is deprecated Signed-off-by: Kamil Tekiela <tekiela246@gmail.com> * Fix deprecated Group('medium') on classes Signed-off-by: Kamil Tekiela <tekiela246@gmail.com> * Fix #[Group('large')] Signed-off-by: Kamil Tekiela <tekiela246@gmail.com> * Fix some #[Group('medium')] Signed-off-by: Kamil Tekiela <tekiela246@gmail.com> * Replace getMockForAbstractClass in NodeDatabaseChildTest Signed-off-by: Kamil Tekiela <tekiela246@gmail.com> * Replace getMockForAbstractClass in PropertyItemTest Signed-off-by: Kamil Tekiela <tekiela246@gmail.com> * Replace getMockForAbstractClass in OptionsPropertyGroupTest Signed-off-by: Kamil Tekiela <tekiela246@gmail.com> * Replace getMockForAbstractClass in PluginPropertyItemTest Signed-off-by: Kamil Tekiela <tekiela246@gmail.com> * Replace getMockForAbstractClass in GisGeometryTest Signed-off-by: Kamil Tekiela <tekiela246@gmail.com> * Remove getMockForAbstractClass from StorageEngineTest Signed-off-by: Kamil Tekiela <tekiela246@gmail.com> * Replace getMockForAbstractClass in OptionsPropertyOneItemTest Signed-off-by: Kamil Tekiela <tekiela246@gmail.com> * Replace getMockForAbstractClass in OptionsPropertyItemTest Signed-off-by: Kamil Tekiela <tekiela246@gmail.com> * Update psalm-baseline.xml Signed-off-by: Kamil Tekiela <tekiela246@gmail.com> --------- Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
1 parent 82ea815 commit 8754b9b

67 files changed

Lines changed: 149 additions & 244 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎psalm-baseline.xml‎

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -13483,9 +13483,6 @@
1348313483
</PossiblyUnusedMethod>
1348413484
</file>
1348513485
<file src="tests/unit/Gis/GisGeometryTest.php">
13486-
<DeprecatedMethod>
13487-
<code><![CDATA[getMockForAbstractClass]]></code>
13488-
</DeprecatedMethod>
1348913486
<MixedAssignment>
1349013487
<code><![CDATA[$extent]]></code>
1349113488
<code><![CDATA[$points]]></code>
@@ -13892,7 +13889,6 @@
1389213889
<DeprecatedMethod>
1389313890
<code><![CDATA[Config::getInstance()]]></code>
1389413891
<code><![CDATA[Config::getInstance()]]></code>
13895-
<code><![CDATA[getMockForAbstractClass]]></code>
1389613892
</DeprecatedMethod>
1389713893
</file>
1389813894
<file src="tests/unit/Navigation/Nodes/NodeDatabaseTest.php">
@@ -14392,31 +14388,6 @@
1439214388
<code><![CDATA[assertIsArray]]></code>
1439314389
</RedundantCondition>
1439414390
</file>
14395-
<file src="tests/unit/Properties/Options/OptionsPropertyGroupTest.php">
14396-
<DeprecatedMethod>
14397-
<code><![CDATA[getMockForAbstractClass]]></code>
14398-
</DeprecatedMethod>
14399-
</file>
14400-
<file src="tests/unit/Properties/Options/OptionsPropertyItemTest.php">
14401-
<DeprecatedMethod>
14402-
<code><![CDATA[getMockForAbstractClass]]></code>
14403-
</DeprecatedMethod>
14404-
</file>
14405-
<file src="tests/unit/Properties/Options/OptionsPropertyOneItemTest.php">
14406-
<DeprecatedMethod>
14407-
<code><![CDATA[getMockForAbstractClass]]></code>
14408-
</DeprecatedMethod>
14409-
</file>
14410-
<file src="tests/unit/Properties/Plugins/PluginPropertyItemTest.php">
14411-
<DeprecatedMethod>
14412-
<code><![CDATA[getMockForAbstractClass]]></code>
14413-
</DeprecatedMethod>
14414-
</file>
14415-
<file src="tests/unit/Properties/PropertyItemTest.php">
14416-
<DeprecatedMethod>
14417-
<code><![CDATA[getMockForAbstractClass]]></code>
14418-
</DeprecatedMethod>
14419-
</file>
1442014391
<file src="tests/unit/Query/CompatibilityTest.php">
1442114392
<PossiblyUnusedMethod>
1442214393
<code><![CDATA[providerForTestHasAccountLocking]]></code>
@@ -14587,9 +14558,6 @@
1458714558
</PossiblyUnusedMethod>
1458814559
</file>
1458914560
<file src="tests/unit/StorageEngineTest.php">
14590-
<DeprecatedMethod>
14591-
<code><![CDATA[getMockForAbstractClass]]></code>
14592-
</DeprecatedMethod>
1459314561
<PossiblyUnusedMethod>
1459414562
<code><![CDATA[providerGetEngine]]></code>
1459514563
</PossiblyUnusedMethod>

‎tests/end-to-end/ChangePasswordTest.php‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,12 @@
55
namespace PhpMyAdmin\Tests\Selenium;
66

77
use PHPUnit\Framework\Attributes\CoversNothing;
8-
use PHPUnit\Framework\Attributes\Group;
8+
use PHPUnit\Framework\Attributes\Large;
99

1010
use function trim;
1111

1212
#[CoversNothing]
13+
#[Large]
1314
class ChangePasswordTest extends TestBase
1415
{
1516
/**
@@ -20,7 +21,6 @@ class ChangePasswordTest extends TestBase
2021
/**
2122
* Tests the changing of the password
2223
*/
23-
#[Group('large')]
2424
public function testChangePassword(): void
2525
{
2626
$this->login();

‎tests/end-to-end/CreateDropDatabaseTest.php‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,10 @@
55
namespace PhpMyAdmin\Tests\Selenium;
66

77
use PHPUnit\Framework\Attributes\CoversNothing;
8-
use PHPUnit\Framework\Attributes\Group;
8+
use PHPUnit\Framework\Attributes\Large;
99

1010
#[CoversNothing]
11+
#[Large]
1112
class CreateDropDatabaseTest extends TestBase
1213
{
1314
/**
@@ -25,7 +26,6 @@ protected function setUp(): void
2526
/**
2627
* Creates a database and drops it
2728
*/
28-
#[Group('large')]
2929
public function testCreateDropDatabase(): void
3030
{
3131
$this->dbQuery('DROP DATABASE IF EXISTS `' . $this->databaseName . '`;');

‎tests/end-to-end/CreateRemoveUserTest.php‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,13 @@
55
namespace PhpMyAdmin\Tests\Selenium;
66

77
use PHPUnit\Framework\Attributes\CoversNothing;
8-
use PHPUnit\Framework\Attributes\Group;
8+
use PHPUnit\Framework\Attributes\Large;
99

1010
use function bin2hex;
1111
use function random_bytes;
1212

1313
#[CoversNothing]
14+
#[Large]
1415
class CreateRemoveUserTest extends TestBase
1516
{
1617
/**
@@ -44,7 +45,6 @@ protected function setUp(): void
4445
/**
4546
* Creates and removes a user
4647
*/
47-
#[Group('large')]
4848
public function testCreateRemoveUser(): void
4949
{
5050
$this->waitForElement('partialLinkText', 'User accounts')->click();

‎tests/end-to-end/Database/EventsTest.php‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,14 @@
77
use PhpMyAdmin\Tests\Selenium\TestBase;
88
use PHPUnit\Framework\Attributes\CoversNothing;
99
use PHPUnit\Framework\Attributes\Depends;
10-
use PHPUnit\Framework\Attributes\Group;
10+
use PHPUnit\Framework\Attributes\Large;
1111

1212
use function date;
1313
use function sleep;
1414
use function strtotime;
1515

1616
#[CoversNothing]
17+
#[Large]
1718
class EventsTest extends TestBase
1819
{
1920
/**
@@ -76,7 +77,6 @@ function (): void {
7677
/**
7778
* Create an event
7879
*/
79-
#[Group('large')]
8080
public function testAddEvent(): void
8181
{
8282
$this->waitForElement('partialLinkText', 'Events')->click();
@@ -158,7 +158,6 @@ function (): void {
158158
* Test for editing events
159159
*/
160160
#[Depends('testAddEvent')]
161-
#[Group('large')]
162161
public function testEditEvents(): void
163162
{
164163
$this->eventSQL();
@@ -193,7 +192,6 @@ function (): void {
193192
* Test for dropping event
194193
*/
195194
#[Depends('testAddEvent')]
196-
#[Group('large')]
197195
public function testDropEvent(): void
198196
{
199197
$this->eventSQL();

‎tests/end-to-end/Database/OperationsTest.php‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,10 @@
66

77
use PhpMyAdmin\Tests\Selenium\TestBase;
88
use PHPUnit\Framework\Attributes\CoversNothing;
9-
use PHPUnit\Framework\Attributes\Group;
9+
use PHPUnit\Framework\Attributes\Large;
1010

1111
#[CoversNothing]
12+
#[Large]
1213
class OperationsTest extends TestBase
1314
{
1415
/**
@@ -34,7 +35,6 @@ private function getToDBOperations(): void
3435
/**
3536
* Test for adding database comment
3637
*/
37-
#[Group('large')]
3838
public function testDbComment(): void
3939
{
4040
$this->skipIfNotPMADB();
@@ -54,7 +54,6 @@ public function testDbComment(): void
5454
/**
5555
* Test for renaming database
5656
*/
57-
#[Group('large')]
5857
public function testRenameDB(): void
5958
{
6059
$this->getToDBOperations();
@@ -93,7 +92,6 @@ function (): void {
9392
/**
9493
* Test for copying database
9594
*/
96-
#[Group('large')]
9795
public function testCopyDb(): void
9896
{
9997
$this->getToDBOperations();

‎tests/end-to-end/Database/ProceduresTest.php‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,13 @@
66

77
use PhpMyAdmin\Tests\Selenium\TestBase;
88
use PHPUnit\Framework\Attributes\CoversNothing;
9-
use PHPUnit\Framework\Attributes\Group;
9+
use PHPUnit\Framework\Attributes\Large;
1010

1111
use function sleep;
1212
use function str_replace;
1313

1414
#[CoversNothing]
15+
#[Large]
1516
class ProceduresTest extends TestBase
1617
{
1718
/**
@@ -108,7 +109,6 @@ private function procedureSQL(): void
108109
/**
109110
* Create a procedure
110111
*/
111-
#[Group('large')]
112112
public function testAddProcedure(): void
113113
{
114114
$this->waitForElement('partialLinkText', 'Routines')->click();
@@ -172,7 +172,6 @@ function (): void {
172172
/**
173173
* Test for editing procedure
174174
*/
175-
#[Group('large')]
176175
public function testEditProcedure(): void
177176
{
178177
$this->procedureSQL();
@@ -197,7 +196,6 @@ public function testEditProcedure(): void
197196
/**
198197
* Test for dropping procedure
199198
*/
200-
#[Group('large')]
201199
public function testDropProcedure(): void
202200
{
203201
$this->procedureSQL();

‎tests/end-to-end/Database/StructureTest.php‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,10 @@
66

77
use PhpMyAdmin\Tests\Selenium\TestBase;
88
use PHPUnit\Framework\Attributes\CoversNothing;
9-
use PHPUnit\Framework\Attributes\Group;
9+
use PHPUnit\Framework\Attributes\Large;
1010

1111
#[CoversNothing]
12+
#[Large]
1213
class StructureTest extends TestBase
1314
{
1415
/**
@@ -44,7 +45,6 @@ protected function setUp(): void
4445
/**
4546
* Test for truncating a table
4647
*/
47-
#[Group('large')]
4848
public function testTruncateTable(): void
4949
{
5050
$this->byXPath("(//a[contains(., 'Empty')])[1]")->click();
@@ -67,7 +67,6 @@ function (): void {
6767
/**
6868
* Tests for dropping multiple tables
6969
*/
70-
#[Group('large')]
7170
public function testDropMultipleTables(): void
7271
{
7372
$this->byCssSelector("label[for='tablesForm_checkall']")->click();

‎tests/end-to-end/ExportTest.php‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,12 @@
66

77
use PHPUnit\Framework\Attributes\CoversNothing;
88
use PHPUnit\Framework\Attributes\DataProvider;
9-
use PHPUnit\Framework\Attributes\Group;
9+
use PHPUnit\Framework\Attributes\Large;
1010

1111
use function strtolower;
1212

1313
#[CoversNothing]
14+
#[Large]
1415
class ExportTest extends TestBase
1516
{
1617
/**
@@ -40,7 +41,6 @@ protected function setUp(): void
4041
* @param string[] $expected Array of expected strings
4142
*/
4243
#[DataProvider('exportDataProvider')]
43-
#[Group('large')]
4444
public function testServerExport(string $plugin, array $expected): void
4545
{
4646
$text = $this->doExport('server', $plugin);
@@ -57,7 +57,6 @@ public function testServerExport(string $plugin, array $expected): void
5757
* @param string[] $expected Array of expected strings
5858
*/
5959
#[DataProvider('exportDataProvider')]
60-
#[Group('large')]
6160
public function testDbExport(string $plugin, array $expected): void
6261
{
6362
$this->navigateDatabase($this->databaseName);
@@ -76,7 +75,6 @@ public function testDbExport(string $plugin, array $expected): void
7675
* @param string[] $expected Array of expected strings
7776
*/
7877
#[DataProvider('exportDataProvider')]
79-
#[Group('large')]
8078
public function testTableExport(string $plugin, array $expected): void
8179
{
8280
$this->dbQuery('INSERT INTO `' . $this->databaseName . '`.`test_table` (val) VALUES (3);');

‎tests/end-to-end/ImportTest.php‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,10 @@
55
namespace PhpMyAdmin\Tests\Selenium;
66

77
use PHPUnit\Framework\Attributes\CoversNothing;
8-
use PHPUnit\Framework\Attributes\Group;
8+
use PHPUnit\Framework\Attributes\Large;
99

1010
#[CoversNothing]
11+
#[Large]
1112
class ImportTest extends TestBase
1213
{
1314
/**
@@ -23,7 +24,6 @@ protected function setUp(): void
2324
/**
2425
* Test for server level import
2526
*/
26-
#[Group('large')]
2727
public function testServerImport(): void
2828
{
2929
$this->doImport('server');
@@ -42,7 +42,6 @@ function (): void {
4242
/**
4343
* Test for db level import
4444
*/
45-
#[Group('large')]
4645
public function testDbImport(): void
4746
{
4847
$this->dbQuery('CREATE DATABASE IF NOT EXISTS `' . $this->databaseName . '`');
@@ -63,7 +62,6 @@ function (): void {
6362
/**
6463
* Test for table level import
6564
*/
66-
#[Group('large')]
6765
public function testTableImport(): void
6866
{
6967
// setup the db

0 commit comments

Comments
 (0)