Skip to content

Commit 4bb2c79

Browse files
committed
Fix deprecations
1 parent afe7ba7 commit 4bb2c79

18 files changed

+35
-42
lines changed

controller/admin_controller.php

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -342,12 +342,9 @@ protected function get_forum_info($forum_id)
342342
*/
343343
protected function send_json_response(bool $content): void
344344
{
345-
if ($this->request->is_ajax())
346-
{
347-
$json_response = new json_response;
348-
$json_response->send([
349-
'success' => (bool) $content,
350-
]);
351-
}
345+
$json_response = new json_response;
346+
$json_response->send([
347+
'success' => (bool) $content,
348+
]);
352349
}
353350
}

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/acp/acp_module_test.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public function test_module_info()
6262
], $this->module_manager->get_module_infos('acp', 'acp_topic_prefixes_module'));
6363
}
6464

65-
public function module_auth_test_data()
65+
public static function module_auth_test_data()
6666
{
6767
return [
6868
// module_auth, expected result

tests/controller/add_prefix_test.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class add_prefix_test extends admin_controller_base
2323
*
2424
* @return array
2525
*/
26-
public function data_add_prefix()
26+
public static function data_add_prefix()
2727
{
2828
return [
2929
['', true, true],

tests/controller/delete_prefix_test.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class delete_prefix_test extends admin_controller_base
2323
*
2424
* @return array
2525
*/
26-
public function data_delete_prefix()
26+
public static function data_delete_prefix()
2727
{
2828
return array(
2929
array(1, false), // valid prefix, not confirmed

tests/controller/display_settings_test.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class display_settings_test extends admin_controller_base
2323
*
2424
* @return array
2525
*/
26-
public function data_display_settings()
26+
public static function data_display_settings()
2727
{
2828
return [
2929
[[], 1],

tests/controller/edit_prefix_test.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class edit_prefix_test extends admin_controller_base
2323
*
2424
* @return array
2525
*/
26-
public function data_edit_prefix()
26+
public static function data_edit_prefix()
2727
{
2828
return array(
2929
array(1, true, false), // valid prefix, valid form/hash, not ajax
@@ -77,7 +77,7 @@ public function test_edit_prefix($prefix_id, $valid_form, $is_ajax)
7777
$this->manager->expects(self::once())
7878
->method('update_prefix');
7979

80-
$this->request->expects(self::atMost(2))
80+
$this->request->expects(self::atMost(1))
8181
->method('is_ajax')
8282
->willReturn($is_ajax);
8383

tests/controller/main_test.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ protected function setUp(): void
4444
*
4545
* @return array
4646
*/
47-
public function data_main()
47+
public static function data_main()
4848
{
4949
return array(
5050
array('add', 'add_prefix'),

tests/controller/move_prefix_test.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class move_prefix_test extends admin_controller_base
2323
*
2424
* @return array
2525
*/
26-
public function data_move_prefix()
26+
public static function data_move_prefix()
2727
{
2828
return array(
2929
// prefix id, direction, valid form/hash, is ajax
@@ -72,7 +72,7 @@ public function test_move_prefix($prefix_id, $direction, $valid_form, $is_ajax)
7272
}
7373
else
7474
{
75-
$this->request->expects(static::atMost(2))
75+
$this->request->expects(static::once())
7676
->method('is_ajax')
7777
->willReturn($is_ajax);
7878

tests/dbal/manager_add_prefix_test.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class manager_add_prefix_test extends manager_base
1717
*
1818
* @return array
1919
*/
20-
public function data_add_prefix()
20+
public static function data_add_prefix()
2121
{
2222
return array(
2323
array('[TEST 1]', 2, 6),

0 commit comments

Comments
 (0)