Skip to content

Commit 58b91df

Browse files
committed
Fix deprecations
1 parent 56c3b48 commit 58b91df

7 files changed

Lines changed: 25 additions & 28 deletions

File tree

phpunit.xml.dist

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,12 @@
22
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
33
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd"
44
backupGlobals="true"
5-
backupStaticAttributes="false"
65
colors="true"
7-
convertErrorsToExceptions="true"
8-
convertNoticesToExceptions="true"
9-
convertWarningsToExceptions="true"
106
processIsolation="false"
117
stopOnFailure="false"
128
cacheResult="false"
139
bootstrap="../../../../tests/bootstrap.php"
14-
>
15-
<coverage>
16-
<include>
17-
<directory suffix=".php">./</directory>
18-
</include>
19-
<exclude>
20-
<directory suffix=".php">./language/</directory>
21-
<directory suffix=".php">./migrations/</directory>
22-
<directory suffix=".php">./tests/</directory>
23-
</exclude>
24-
</coverage>
10+
backupStaticProperties="false">
2511
<testsuites>
2612
<testsuite name="Extension Test Suite">
2713
<directory suffix="_test.php">./tests</directory>
@@ -31,4 +17,14 @@
3117
<directory suffix="_test.php">./tests/functional/</directory>
3218
</testsuite>
3319
</testsuites>
20+
<source>
21+
<include>
22+
<directory suffix=".php">./</directory>
23+
</include>
24+
<exclude>
25+
<directory suffix=".php">./language/</directory>
26+
<directory suffix=".php">./migrations/</directory>
27+
<directory suffix=".php">./tests/</directory>
28+
</exclude>
29+
</source>
3430
</phpunit>

tests/unit/acp_module_test.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ public function test_module_info(): void
7979
);
8080
}
8181

82-
public function module_auth_test_data(): array
82+
public static function module_auth_test_data(): array
8383
{
8484
return [
8585
'invalid auth' => ['ext_foo/bar', false],
@@ -95,7 +95,7 @@ public function test_module_auth(string $module_auth, bool $expected): void
9595
$this->assertEquals($expected, p_master::module_auth($module_auth, 0));
9696
}
9797

98-
public function main_module_test_data(): array
98+
public static function main_module_test_data(): array
9999
{
100100
return [
101101
'valid mode' => ['settings'],

tests/unit/admin_controller_test.php

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ class admin_controller_test extends phpbb_database_test_case
4040
protected helper $helper;
4141
protected upload $upload;
4242
protected string $phpbb_root_path;
43+
protected admin_controller $admin_controller;
4344

4445
protected static function setup_extensions(): array
4546
{
@@ -110,7 +111,7 @@ protected function setUp(): void
110111
);
111112
}
112113

113-
public function module_access_test_data(): array
114+
public static function module_access_test_data(): array
114115
{
115116
return [
116117
'correct mode' => ['settings', true],
@@ -133,7 +134,7 @@ public function test_module_access($mode, $expected)
133134
$this->call_admin_controller($mode);
134135
}
135136

136-
public function form_checks_data(): array
137+
public static function form_checks_data(): array
137138
{
138139
return [
139140
'submit test' => ['submit'],
@@ -157,7 +158,7 @@ public function test_form_checks($action)
157158
$this->call_admin_controller();
158159
}
159160

160-
public function display_settings_test_data(): array
161+
public static function display_settings_test_data(): array
161162
{
162163
return [
163164
'site name and short name' => [
@@ -258,7 +259,7 @@ public function test_display_settings($configs, $expected)
258259
$this->call_admin_controller();
259260
}
260261

261-
public function submit_test_data(): array
262+
public static function submit_test_data(): array
262263
{
263264
return [
264265
'all good inputs' => [
@@ -441,7 +442,7 @@ public function test_resync()
441442
$this->call_admin_controller();
442443
}
443444

444-
public function delete_test_data(): array
445+
public static function delete_test_data(): array
445446
{
446447
return [
447448
'not confirmed' => [

tests/unit/event_listener_test.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ public function test_getSubscribedEvents()
8484
], $events);
8585
}
8686

87-
public function header_updates_test_data(): array
87+
public static function header_updates_test_data(): array
8888
{
8989
return [
9090
'valid hex colors' => [
@@ -182,7 +182,7 @@ public function test_header_updates($configs, $icons, $expected)
182182
$this->assertEquals($configs['pwa_bg_color'], $this->user->style['pwa_bg_color']);
183183
}
184184

185-
public function manifest_updates_test_data(): array
185+
public static function manifest_updates_test_data(): array
186186
{
187187
return [
188188
'root path, no color options' => [

tests/unit/ext_test.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ protected function setUp(): void
4747
*
4848
* @return array
4949
*/
50-
public function ext_test_data(): array
50+
public static function ext_test_data(): array
5151
{
5252
return [
5353
'current version' => [
@@ -93,7 +93,7 @@ public function test_ext($version, $expected)
9393
self::assertSame($expected, $ext->is_enableable());
9494
}
9595

96-
public function enable_test_data(): array
96+
public static function enable_test_data(): array
9797
{
9898
return [
9999
'dir exists' => [

tests/unit/helper_test.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ public function test_get_icons_empty()
176176
$this->assertCount(0, array_column($this->helper->get_icons(), 'src'));
177177
}
178178

179-
public function delete_icon_test_data(): array
179+
public static function delete_icon_test_data(): array
180180
{
181181
return [
182182
'empty icon name' => [

tests/unit/upload_test.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public function get_upload(): upload
4949
);
5050
}
5151

52-
public function upload_data(): array
52+
public static function upload_data(): array
5353
{
5454
return [
5555
'upload failed' => [false],

0 commit comments

Comments
 (0)