Skip to content

Commit 82c85d2

Browse files
Clean up of tests (#19067)
* Fix wrong type hint Signed-off-by: Kamil Tekiela <tekiela246@gmail.com> * Use $this instead of parent Signed-off-by: Kamil Tekiela <tekiela246@gmail.com> * setUp should be a protected method Signed-off-by: Kamil Tekiela <tekiela246@gmail.com> * onNotSuccessfulTest should be protected Signed-off-by: Kamil Tekiela <tekiela246@gmail.com> * $command doesn't need to be a property Signed-off-by: Kamil Tekiela <tekiela246@gmail.com> * Give alertText() proper return type Signed-off-by: Kamil Tekiela <tekiela246@gmail.com> * Use null-safe operator Signed-off-by: Kamil Tekiela <tekiela246@gmail.com> * Call Message static constructors statically Signed-off-by: Kamil Tekiela <tekiela246@gmail.com> * Call StorageEngine methods statically Signed-off-by: Kamil Tekiela <tekiela246@gmail.com> * Add better type hints in PrivilegesController Signed-off-by: Kamil Tekiela <tekiela246@gmail.com> * Use packed (without keys) arrays in tests Signed-off-by: Kamil Tekiela <tekiela246@gmail.com> * Use type casts instead of function casts Signed-off-by: Kamil Tekiela <tekiela246@gmail.com> * Use const instead of private property Signed-off-by: Kamil Tekiela <tekiela246@gmail.com> * Use const instead of private property Signed-off-by: Kamil Tekiela <tekiela246@gmail.com> * Fix testAuthFailsTooLongPass() Signed-off-by: Kamil Tekiela <tekiela246@gmail.com> * Replace loop with array_shift Signed-off-by: Kamil Tekiela <tekiela246@gmail.com> * Use ob_get_clean Signed-off-by: Kamil Tekiela <tekiela246@gmail.com> * Remove duplicated code Signed-off-by: Kamil Tekiela <tekiela246@gmail.com> * Use assert instead of phpdoc Signed-off-by: Kamil Tekiela <tekiela246@gmail.com> --------- Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
1 parent 4edb264 commit 82c85d2

101 files changed

Lines changed: 293 additions & 508 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.

phpstan-baseline.neon

Lines changed: 0 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -3405,21 +3405,6 @@ parameters:
34053405
count: 1
34063406
path: src/Controllers/Server/PrivilegesController.php
34073407

3408-
-
3409-
message: "#^Parameter \\#1 \\$queries of method PhpMyAdmin\\\\Server\\\\Privileges\\:\\:getDataForDeleteUsers\\(\\) expects array, mixed given\\.$#"
3410-
count: 1
3411-
path: src/Controllers/Server/PrivilegesController.php
3412-
3413-
-
3414-
message: "#^Parameter \\#1 \\$queries of method PhpMyAdmin\\\\Server\\\\Privileges\\:\\:getDataForQueries\\(\\) expects array, mixed given\\.$#"
3415-
count: 1
3416-
path: src/Controllers/Server/PrivilegesController.php
3417-
3418-
-
3419-
message: "#^Parameter \\#1 \\$queries of method PhpMyAdmin\\\\Server\\\\Privileges\\:\\:getDbSpecificPrivsQueriesForChangeOrCopyUser\\(\\) expects array, mixed given\\.$#"
3420-
count: 1
3421-
path: src/Controllers/Server/PrivilegesController.php
3422-
34233408
-
34243409
message: "#^Parameter \\#1 \\$string of function urlencode expects string, \\(array\\<int, string\\>\\|string\\) given\\.$#"
34253410
count: 1
@@ -3485,11 +3470,6 @@ parameters:
34853470
count: 1
34863471
path: src/Controllers/Server/PrivilegesController.php
34873472

3488-
-
3489-
message: "#^Parameter \\#2 \\$queriesForDisplay of method PhpMyAdmin\\\\Server\\\\Privileges\\:\\:getDataForQueries\\(\\) expects array\\|null, mixed given\\.$#"
3490-
count: 1
3491-
path: src/Controllers/Server/PrivilegesController.php
3492-
34933473
-
34943474
message: "#^Parameter \\#2 \\$sqlQuery of method PhpMyAdmin\\\\Server\\\\Privileges\\:\\:getExtraDataForAjaxBehavior\\(\\) expects string, mixed given\\.$#"
34953475
count: 1
@@ -15295,11 +15275,6 @@ parameters:
1529515275
count: 2
1529615276
path: tests/unit/Command/TwigLintCommandTest.php
1529715277

15298-
-
15299-
message: "#^Class PhpMyAdmin\\\\Tests\\\\Command\\\\WriteGitRevisionCommandTest has an uninitialized property \\$command\\. Give it default value or assign it in the constructor\\.$#"
15300-
count: 1
15301-
path: tests/unit/Command/WriteGitRevisionCommandTest.php
15302-
1530315278
-
1530415279
message: "#^Cannot access offset 'port' on mixed\\.$#"
1530515280
count: 1
@@ -15475,11 +15450,6 @@ parameters:
1547515450
count: 1
1547615451
path: tests/unit/Config/SettingsTest.php
1547715452

15478-
-
15479-
message: "#^Property PhpMyAdmin\\\\Tests\\\\Config\\\\SettingsTest\\:\\:\\$defaultValues type has no value type specified in iterable type array\\.$#"
15480-
count: 1
15481-
path: tests/unit/Config/SettingsTest.php
15482-
1548315453
-
1548415454
message: "#^Variable property access on PhpMyAdmin\\\\Config\\\\Settings\\.$#"
1548515455
count: 1
@@ -16010,21 +15980,6 @@ parameters:
1601015980
count: 2
1601115981
path: tests/unit/InsertEditTest.php
1601215982

16013-
-
16014-
message: "#^Dynamic call to static method PhpMyAdmin\\\\Message\\:\\:getMessageForAffectedRows\\(\\)\\.$#"
16015-
count: 1
16016-
path: tests/unit/MessageTest.php
16017-
16018-
-
16019-
message: "#^Dynamic call to static method PhpMyAdmin\\\\Message\\:\\:getMessageForDeletedRows\\(\\)\\.$#"
16020-
count: 1
16021-
path: tests/unit/MessageTest.php
16022-
16023-
-
16024-
message: "#^Dynamic call to static method PhpMyAdmin\\\\Message\\:\\:getMessageForInsertedRows\\(\\)\\.$#"
16025-
count: 1
16026-
path: tests/unit/MessageTest.php
16027-
1602815983
-
1602915984
message: "#^Property PhpMyAdmin\\\\Config\\:\\:\\$selectedServer \\(array\\{host\\: string, port\\: string, socket\\: string, ssl\\: bool, ssl_key\\: string\\|null, ssl_cert\\: string\\|null, ssl_ca\\: string\\|null, ssl_ca_path\\: string\\|null, \\.\\.\\.\\}\\) does not accept array\\<'AllowDeny'\\|'AllowNoPassword'\\|'AllowRoot'\\|'auth_http_realm'\\|'auth_type'\\|'bookmarktable'\\|'central_columns'\\|'column_info'\\|'compress'\\|'control_compress'\\|'control_hide…'\\|'control_socket'\\|'control_ssl'\\|'control_ssl_ca'\\|'control_ssl_ca_path'\\|'control_ssl_cert'\\|'control_ssl_ciphers'\\|'control_ssl_key'\\|'control_ssl_verify'\\|'controlhost'\\|'controlpass'\\|'controlport'\\|'controluser'\\|'designer_settings'\\|'DisableIS'\\|'export_templates'\\|'favorite'\\|'history'\\|'host'\\|'LogoutURL'\\|'MaxTableUiprefs'\\|'navigationhiding'\\|'only_db'\\|'password'\\|'pdf_pages'\\|'pmadb'\\|'port'\\|'recent'\\|'relation'\\|'savedsearches'\\|'SessionTimeZone'\\|'SignonCookieParams'\\|'SignonScript'\\|'SignonSession'\\|'SignonURL'\\|'socket'\\|'ssl'\\|'ssl_ca'\\|'ssl_ca_path'\\|'ssl_cert'\\|'ssl_ciphers'\\|'ssl_key'\\|'ssl_verify'\\|'table_coords'\\|'table_info'\\|'table_uiprefs'\\|'tracking'\\|'user'\\|'userconfig'\\|'usergroups'\\|'users'\\|'verbose', array\\<array\\<string\\>\\|bool\\|int\\<0, max\\>\\|string\\>\\|bool\\|int\\<1, max\\>\\|string\\|null\\>\\.$#"
1603015985
count: 1
@@ -16420,11 +16375,6 @@ parameters:
1642016375
count: 1
1642116376
path: tests/unit/Server/PluginsTest.php
1642216377

16423-
-
16424-
message: "#^Cannot call method getMessage\\(\\) on mixed\\.$#"
16425-
count: 2
16426-
path: tests/unit/Server/PrivilegesTest.php
16427-
1642816378
-
1642916379
message: "#^PHPDoc tag @var for variable \\$actual has no value type specified in iterable type array\\.$#"
1643016380
count: 1
@@ -16510,21 +16460,6 @@ parameters:
1651016460
count: 4
1651116461
path: tests/unit/SqlTest.php
1651216462

16513-
-
16514-
message: "#^Dynamic call to static method PhpMyAdmin\\\\StorageEngine\\:\\:getArray\\(\\)\\.$#"
16515-
count: 1
16516-
path: tests/unit/StorageEngineTest.php
16517-
16518-
-
16519-
message: "#^Dynamic call to static method PhpMyAdmin\\\\StorageEngine\\:\\:getStorageEngines\\(\\)\\.$#"
16520-
count: 1
16521-
path: tests/unit/StorageEngineTest.php
16522-
16523-
-
16524-
message: "#^Dynamic call to static method PhpMyAdmin\\\\StorageEngine\\:\\:isValid\\(\\)\\.$#"
16525-
count: 4
16526-
path: tests/unit/StorageEngineTest.php
16527-
1652816463
-
1652916464
message: "#^Method PhpMyAdmin\\\\Tests\\\\Stubs\\\\DbiDummy\\:\\:affectedRows\\(\\) should return int\\|numeric\\-string but returns mixed\\.$#"
1653016465
count: 1
@@ -16615,11 +16550,6 @@ parameters:
1661516550
count: 1
1661616551
path: tests/unit/TypesByDatabaseVersionTest.php
1661716552

16618-
-
16619-
message: "#^Method PhpMyAdmin\\\\Tests\\\\UserPasswordTest\\:\\:providerSetChangePasswordMsg\\(\\) should return array\\<array\\{bool, PhpMyAdmin\\\\Message, string, string, string\\}\\> but returns array\\{array\\{false, PhpMyAdmin\\\\Message, true, '', ''\\}, array\\{true, PhpMyAdmin\\\\Message, false, '', ''\\}, array\\{true, PhpMyAdmin\\\\Message, false, 'a', ''\\}, array\\{true, PhpMyAdmin\\\\Message, false, '', 'a'\\}, array\\{true, PhpMyAdmin\\\\Message, false, 'a', 'b'\\}, array\\{true, PhpMyAdmin\\\\Message, false, literal\\-string&non\\-falsy\\-string, literal\\-string&non\\-falsy\\-string\\}, array\\{false, PhpMyAdmin\\\\Message, false, literal\\-string&non\\-falsy\\-string, literal\\-string&non\\-falsy\\-string\\}\\}\\.$#"
16620-
count: 1
16621-
path: tests/unit/UserPasswordTest.php
16622-
1662316553
-
1662416554
message: "#^Cannot access offset 'db' on mixed\\.$#"
1662516555
count: 2
@@ -16675,11 +16605,6 @@ parameters:
1667516605
count: 1
1667616606
path: tests/unit/UtilTest.php
1667716607

16678-
-
16679-
message: "#^Method PhpMyAdmin\\\\Tests\\\\UtilTest\\:\\:providerForTestGetMySQLDocuURL\\(\\) should return array\\<int, array\\{string, string, int, string\\}\\> but returns array\\{array\\{'ALTER_TABLE', 'alter\\-table\\-index', '8\\.0\\.0', 'index\\.php\\?route\\=…'\\}, array\\{'ALTER_TABLE', 'alter\\-table\\-index', '5\\.7\\.0', 'index\\.php\\?route\\=…'\\}, array\\{'', 'alter\\-table\\-index', '5\\.6\\.0', 'index\\.php\\?route\\=…'\\}, array\\{'ALTER_TABLE', '', '5\\.5\\.0', 'index\\.php\\?route\\=…'\\}, array\\{'', '', '5\\.7\\.0', 'index\\.php\\?route\\=…'\\}\\}\\.$#"
16680-
count: 1
16681-
path: tests/unit/UtilTest.php
16682-
1668316608
-
1668416609
message: "#^Parameter \\#2 \\$array of static method PHPUnit\\\\Framework\\\\Assert\\:\\:assertArrayNotHasKey\\(\\) expects array\\|ArrayAccess, mixed given\\.$#"
1668516610
count: 2

psalm-baseline.xml

Lines changed: 4 additions & 107 deletions
Original file line numberDiff line numberDiff line change
@@ -2594,12 +2594,7 @@
25942594
<code><![CDATA[$GLOBALS['sql_query'][$key]]]></code>
25952595
</InvalidArrayOffset>
25962596
<MixedArgument>
2597-
<code><![CDATA[$GLOBALS['message']]]></code>
25982597
<code><![CDATA[$dbName ?? '']]></code>
2599-
<code><![CDATA[$queries]]></code>
2600-
<code><![CDATA[$queries]]></code>
2601-
<code><![CDATA[$queries]]></code>
2602-
<code><![CDATA[$queriesForDisplay]]></code>
26032598
<code><![CDATA[$request->getParsedBodyParam('old_hostname')]]></code>
26042599
<code><![CDATA[$request->getParsedBodyParam('old_hostname', '')]]></code>
26052600
<code><![CDATA[$request->getParsedBodyParam('old_username')]]></code>
@@ -2615,15 +2610,15 @@
26152610
<MixedAssignment>
26162611
<code><![CDATA[$GLOBALS['dbname']]]></code>
26172612
<code><![CDATA[$GLOBALS['errorUrl']]]></code>
2618-
<code><![CDATA[$GLOBALS['message']]]></code>
26192613
<code><![CDATA[$dbName]]></code>
26202614
</MixedAssignment>
26212615
<PossiblyInvalidArgument>
26222616
<code><![CDATA[$GLOBALS['sql_query']]]></code>
26232617
</PossiblyInvalidArgument>
2618+
<RedundantConditionGivenDocblockType>
2619+
<code><![CDATA[! empty($GLOBALS['message']) && $GLOBALS['message'] instanceof Message]]></code>
2620+
</RedundantConditionGivenDocblockType>
26242621
<RiskyTruthyFalsyComparison>
2625-
<code><![CDATA[empty($GLOBALS['message'])]]></code>
2626-
<code><![CDATA[empty($GLOBALS['message'])]]></code>
26272622
<code><![CDATA[empty($_REQUEST['ajax_page_request'])]]></code>
26282623
<code><![CDATA[empty($routinename)]]></code>
26292624
<code><![CDATA[empty($routinename)]]></code>
@@ -12041,16 +12036,6 @@
1204112036
<DeprecatedMethod>
1204212037
<code><![CDATA[Config::getInstance()]]></code>
1204312038
</DeprecatedMethod>
12044-
<InvalidReturnStatement>
12045-
<code><![CDATA[[
12046-
[User\UserFormList::class, User\ExportForm::class],
12047-
[Page\PageFormList::class, Page\ExportForm::class],
12048-
[Setup\SetupFormList::class, Setup\ExportForm::class],
12049-
]]]></code>
12050-
</InvalidReturnStatement>
12051-
<InvalidReturnType>
12052-
<code><![CDATA[array{array{class-string<BaseFormList>, class-string<BaseForm>}}]]></code>
12053-
</InvalidReturnType>
1205412039
<PossiblyUnusedMethod>
1205512040
<code><![CDATA[formObjects]]></code>
1205612041
</PossiblyUnusedMethod>
@@ -13143,7 +13128,7 @@
1314313128
$this->centralColumns,
1314413129
CentralColumns::class,
1314513130
'getHtmlForEditTableRow',
13146-
[$this->modifiedColumnData[0], 0],
13131+
[self::MODIFIED_COLUMN_DATA[0], 0],
1314713132
)]]></code>
1314813133
</MixedArgument>
1314913134
</file>
@@ -14347,28 +14332,6 @@
1434714332
<code><![CDATA[Config::getInstance()]]></code>
1434814333
<code><![CDATA[DatabaseInterface::getInstance()]]></code>
1434914334
</DeprecatedMethod>
14350-
<InvalidReturnStatement>
14351-
<code><![CDATA[[
14352-
['xml', 'xml', null, 'Export', 'format', null],
14353-
['xml', 'sql', 'xml', 'Export', 'format', null],
14354-
['xml', null, 'xml', 'Export', 'format', null],
14355-
['', null, null, 'Export', 'format', null],
14356-
[
14357-
'Structure of table @TABLE@ strTest (continued)',
14358-
'strLatexStructure strTest strLatexContinued',
14359-
null,
14360-
'Export',
14361-
'latex_structure_continued_caption',
14362-
null,
14363-
],
14364-
['xml', 'sql', 'xml', 'Export', 'format', true],
14365-
['sql', 'sql', 'xml', 'Export', 'format', false],
14366-
['30', 30, null, 'Import', 'skip_queries', null],
14367-
]]]></code>
14368-
</InvalidReturnStatement>
14369-
<InvalidReturnType>
14370-
<code><![CDATA[array{array{string, string|int|null, string|null, 'Export'|'Import'|'Schema', string, bool|null}}]]></code>
14371-
</InvalidReturnType>
1437214335
<PossiblyUnusedMethod>
1437314336
<code><![CDATA[providerForTestGetDefault]]></code>
1437414337
</PossiblyUnusedMethod>
@@ -14439,10 +14402,6 @@
1443914402
<code><![CDATA[Config::getInstance()]]></code>
1444014403
<code><![CDATA[Config::getInstance()]]></code>
1444114404
</DeprecatedMethod>
14442-
<MixedMethodCall>
14443-
<code><![CDATA[getMessage]]></code>
14444-
<code><![CDATA[getMessage]]></code>
14445-
</MixedMethodCall>
1444614405
<PossiblyUnusedMethod>
1444714406
<code><![CDATA[providerUnEscapeMysqlWildcards]]></code>
1444814407
</PossiblyUnusedMethod>
@@ -14772,26 +14731,6 @@
1477214731
</PossiblyUnusedMethod>
1477314732
</file>
1477414733
<file src="tests/unit/UserPasswordTest.php">
14775-
<InvalidReturnStatement>
14776-
<code><![CDATA[[
14777-
[false, Message::success('The profile has been updated.'), true, '', ''],
14778-
[true, Message::error('The password is empty!'), false, '', ''],
14779-
[true, Message::error('The password is empty!'), false, 'a', ''],
14780-
[true, Message::error('The password is empty!'), false, '', 'a'],
14781-
[true, Message::error('The passwords aren\'t the same!'), false, 'a', 'b'],
14782-
[true, Message::error('Password is too long!'), false, str_repeat('a', 257), str_repeat('a', 257)],
14783-
[
14784-
false,
14785-
Message::success('The profile has been updated.'),
14786-
false,
14787-
str_repeat('a', 256),
14788-
str_repeat('a', 256),
14789-
],
14790-
]]]></code>
14791-
</InvalidReturnStatement>
14792-
<InvalidReturnType>
14793-
<code><![CDATA[array{0: bool, 1: Message, 2: string, 3: string, 4: string}[]]]></code>
14794-
</InvalidReturnType>
1479514734
<PossiblyUnusedMethod>
1479614735
<code><![CDATA[providerSetChangePasswordMsg]]></code>
1479714736
</PossiblyUnusedMethod>
@@ -14843,48 +14782,6 @@
1484314782
<InvalidPropertyAssignmentValue>
1484414783
<code><![CDATA[Config::getInstance()->selectedServer]]></code>
1484514784
</InvalidPropertyAssignmentValue>
14846-
<InvalidReturnStatement>
14847-
<code><![CDATA[[
14848-
[
14849-
'ALTER_TABLE',
14850-
'alter-table-index',
14851-
'8.0.0',
14852-
'index.php?route=/url&url='
14853-
. 'https%3A%2F%2Fdev.mysql.com%2Fdoc%2Frefman%2F8.0%2Fen%2Falter-table.html%23alter-table-index',
14854-
],
14855-
[
14856-
'ALTER_TABLE',
14857-
'alter-table-index',
14858-
'5.7.0',
14859-
'index.php?route=/url&url='
14860-
. 'https%3A%2F%2Fdev.mysql.com%2Fdoc%2Frefman%2F5.7%2Fen%2Falter-table.html%23alter-table-index',
14861-
],
14862-
[
14863-
'',
14864-
'alter-table-index',
14865-
'5.6.0',
14866-
'index.php?route=/url&url='
14867-
. 'https%3A%2F%2Fdev.mysql.com%2Fdoc%2Frefman%2F5.6%2Fen%2Findex.html%23alter-table-index',
14868-
],
14869-
[
14870-
'ALTER_TABLE',
14871-
'',
14872-
'5.5.0',
14873-
'index.php?route=/url&url='
14874-
. 'https%3A%2F%2Fdev.mysql.com%2Fdoc%2Frefman%2F5.5%2Fen%2Falter-table.html',
14875-
],
14876-
[
14877-
'',
14878-
'',
14879-
'5.7.0',
14880-
'index.php?route=/url&url='
14881-
. 'https%3A%2F%2Fdev.mysql.com%2Fdoc%2Frefman%2F5.7%2Fen%2Findex.html',
14882-
],
14883-
]]]></code>
14884-
</InvalidReturnStatement>
14885-
<InvalidReturnType>
14886-
<code><![CDATA[array<int, array{string, string, int, string}>]]></code>
14887-
</InvalidReturnType>
1488814785
<MixedArgument>
1488914786
<code><![CDATA[$_SESSION['cache']['server_2']]]></code>
1489014787
<code><![CDATA[$_SESSION['cache']['server_2']]]></code>

src/Server/Privileges.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2219,7 +2219,7 @@ public function getDataForQueries(array $queries, array|null $queriesForDisplay)
22192219
* @param string|null $password password
22202220
* @param bool $isMenuwork is_menuwork set?
22212221
*
2222-
* @return mixed[]
2222+
* @return array{Message|null, string[], string[]|null, string|null, bool}
22232223
*/
22242224
public function addUser(
22252225
string|array|null $dbname,
@@ -2881,7 +2881,7 @@ public function getDbSpecificPrivsQueriesForChangeOrCopyUser(
28812881
* @param string $alterRealSqlQuery SQL query for ALTER USER
28822882
* @param string $alterSqlQuery SQL query for ALTER USER to be displayed
28832883
*
2884-
* @return array<int,string|Message>
2884+
* @return array{string, Message}
28852885
*/
28862886
public function addUserAndCreateDatabase(
28872887
bool $error,

tests/end-to-end/TestBase.php

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -646,17 +646,13 @@ public function dbQuery(string $query, Closure|null $onResults = null, Closure|n
646646
$this->typeInTextArea($query);
647647
$this->scrollIntoView('button_submit_query');
648648
$this->byId('button_submit_query')->click();
649-
if ($afterSubmit !== null) {
650-
$afterSubmit->call($this);
651-
}
649+
$afterSubmit?->call($this);
652650

653651
$this->waitAjax();
654652
$this->waitForElement('className', 'result_query');
655653
// If present then
656654
$didSucceed = $this->isElementPresent('xpath', '//*[@class="result_query"]//*[contains(., "success")]');
657-
if ($onResults !== null) {
658-
$onResults->call($this);
659-
}
655+
$onResults?->call($this);
660656
}
661657

662658
reset($handles);
@@ -875,7 +871,7 @@ public function moveto(RemoteWebElement $element): void
875871
* Wrapper around alertText method to not use it on not supported
876872
* browsers.
877873
*/
878-
public function alertText(): mixed
874+
public function alertText(): string
879875
{
880876
/**
881877
* Not supported in Safari Webdriver, see
@@ -1182,7 +1178,7 @@ private function getErrorVideoUrl(): void
11821178
/**
11831179
* Mark unsuccessful tests as 'Failures' on Browerstack
11841180
*/
1185-
public function onNotSuccessfulTest(Throwable $t): never
1181+
protected function onNotSuccessfulTest(Throwable $t): never
11861182
{
11871183
$this->markTestAs('failed', $t->getMessage());
11881184
$this->takeScrenshot('test_failed');

tests/unit/Advisory/AdvisorTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ protected function setUp(): void
2020
{
2121
parent::setUp();
2222

23-
parent::setGlobalConfig();
23+
$this->setGlobalConfig();
2424

2525
DatabaseInterface::$instance = $this->createDatabaseInterface();
2626
}
@@ -62,7 +62,7 @@ public static function advisorTimes(): array
6262
#[DataProvider('rulesProvider')]
6363
public function testAddRule(array $rule, array $expected, string|null $error): void
6464
{
65-
parent::setLanguage();
65+
$this->setLanguage();
6666

6767
$advisor = new Advisor(DatabaseInterface::getInstance(), new ExpressionLanguage());
6868
$advisor->setVariable('value', 0);

tests/unit/CacheTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
#[CoversClass(Cache::class)]
1313
class CacheTest extends AbstractTestCase
1414
{
15-
public function setUp(): void
15+
protected function setUp(): void
1616
{
1717
Cache::purge();
1818
}

0 commit comments

Comments
 (0)