Skip to content

Commit 30b773d

Browse files
committed
Fix deprecations
1 parent 5a903db commit 30b773d

22 files changed

+45
-48
lines changed

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/conditions/base_test.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public function get_condition()
3737
/**
3838
* Data for test_get_group_rules
3939
*/
40-
public function get_group_rules_test_data()
40+
public static function get_group_rules_test_data()
4141
{
4242
return array(
4343
array(
@@ -109,7 +109,7 @@ public function test_get_group_rules($type, $expected)
109109
/**
110110
* Data for test_add_users_to_group
111111
*/
112-
public function add_users_to_group_test_data()
112+
public static function add_users_to_group_test_data()
113113
{
114114
return array(
115115
array(
@@ -187,7 +187,7 @@ public function test_add_users_to_group($user_id_ary, $group_id, $default, $expe
187187
/**
188188
* Data for test_remove_users_from_group
189189
*/
190-
public function remove_users_from_group_test_data()
190+
public static function remove_users_from_group_test_data()
191191
{
192192
return array(
193193
array(

tests/conditions/birthdays_test.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public function get_condition()
4242
*
4343
* @return array Array of test data
4444
*/
45-
public function check_condition_test_data()
45+
public static function check_condition_test_data()
4646
{
4747
return array(
4848
array(

tests/conditions/helper_test.php

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class helper_test extends base
2020
/**
2121
* Data for test_get_users_groups
2222
*/
23-
public function get_users_groups_test_data()
23+
public static function get_users_groups_test_data()
2424
{
2525
return array(
2626
array(
@@ -80,7 +80,7 @@ public function test_get_default_exempt_users()
8080
/**
8181
* Data for test_prepare_users_for_query
8282
*/
83-
public function prepare_users_for_query_test_data()
83+
public static function prepare_users_for_query_test_data()
8484
{
8585
return array(
8686
array(1, array(1)),
@@ -105,10 +105,8 @@ public function test_prepare_users_for_query($user_ids, $expected)
105105
/**
106106
* Data for test_send_notifications
107107
*/
108-
public function send_notifications_data()
108+
public static function send_notifications_data()
109109
{
110-
$language = $this->get_lang();
111-
112110
return array(
113111
array(
114112
'posts',
@@ -131,7 +129,7 @@ public function send_notifications_data()
131129
array(
132130
'user_ids' => array(),
133131
'group_id' => 4,
134-
'group_name' => $language->lang('G_GLOBAL_MODERATORS'),
132+
'group_name' => 'Global moderators',
135133
),
136134
),
137135
);

tests/conditions/lastvisit_test.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public function get_condition()
4343
*
4444
* @return array Array of test data
4545
*/
46-
public function check_condition_test_data()
46+
public static function check_condition_test_data()
4747
{
4848
return array(
4949
array(

tests/conditions/membership_test.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public function get_condition()
4343
*
4444
* @return array Array of test data
4545
*/
46-
public function check_condition_test_data()
46+
public static function check_condition_test_data()
4747
{
4848
return array(
4949
array(

tests/conditions/posts_test.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public function get_condition()
4242
*
4343
* @return array Array of test data
4444
*/
45-
public function check_condition_test_data()
45+
public static function check_condition_test_data()
4646
{
4747
return array(
4848
array(
@@ -191,7 +191,7 @@ public function check_condition_test_data()
191191
*
192192
* @return array Array of test data
193193
*/
194-
public function check_no_options_test_data()
194+
public static function check_no_options_test_data()
195195
{
196196
return array(
197197
array(1, 10, array(1, 5)),

tests/conditions/warnings_test.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public function get_condition()
4343
*
4444
* @return array Array of test data
4545
*/
46-
public function check_condition_test_data()
46+
public static function check_condition_test_data()
4747
{
4848
return array(
4949
array(

tests/controller/delete_autogroup_rule_test.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class delete_autogroup_rule_test extends admin_controller_base
1919
*
2020
* @return array Array of test data
2121
*/
22-
public function delete_autogroup_rule_data()
22+
public static function delete_autogroup_rule_data()
2323
{
2424
return array(
2525
// id, exists in db

tests/controller/resync_autogroup_rule_test.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class resync_autogroup_rule_test extends admin_controller_base
1919
*
2020
* @return array Array of test data
2121
*/
22-
public function resync_autogroup_rule_data()
22+
public static function resync_autogroup_rule_data()
2323
{
2424
return array(
2525
array(0),

0 commit comments

Comments
 (0)