Skip to content

Commit be2a0b1

Browse files
committed
Fix deprecations
1 parent 6eb87b4 commit be2a0b1

26 files changed

+72
-74
lines changed

exception/base.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class base extends \Exception
3333
* @param \Exception|null $previous
3434
* @access public
3535
*/
36-
public function __construct($message = null, $code = 0, \Exception $previous = null)
36+
public function __construct($message = null, $code = 0, \Exception|null $previous = null)
3737
{
3838
parent::__construct();
3939

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/controller/page_main_controller_test.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ public function get_controller()
117117
*
118118
* @return array Array of test data
119119
*/
120-
public function display_data()
120+
public static function display_data()
121121
{
122122
return array(
123123
array('page_1', 200, 'pages_default.html', 2), // normal viewable page by member
@@ -146,7 +146,7 @@ public function test_display($route, $status_code, $page_content, $user_id)
146146
*
147147
* @return array Array of test data
148148
*/
149-
public function display_fails_data()
149+
public static function display_fails_data()
150150
{
151151
return array(
152152
array('page_4', 404, 'PAGE_NOT_AVAILABLE', 2), // disabled page, member sees page missing message

tests/entity/page_entity_base.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ protected function get_page_entity()
6969
*
7070
* @return array Data to send to import_data
7171
*/
72-
public function get_import_data()
72+
public static function get_import_data()
7373
{
7474
return array(
7575
1 => array(

tests/entity/page_entity_content_test.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ protected function setUp(): void
4545
*
4646
* @return array Array of test data
4747
*/
48-
public function content_test_data()
48+
public static function content_test_data()
4949
{
5050
return array(
5151
// sent to set_content()
@@ -166,7 +166,7 @@ protected function content_test_helper($content, $enable_bbcode, $enable_magic_u
166166
*
167167
* @return array Array of test data
168168
*/
169-
public function html_content_test_data()
169+
public static function html_content_test_data()
170170
{
171171
return array(
172172
// sent to set_content()

tests/entity/page_entity_description_test.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class page_entity_description_test extends page_entity_base
2020
*
2121
* @return array Array of test data
2222
*/
23-
public function description_test_data()
23+
public static function description_test_data()
2424
{
2525
return array(
2626
// sent to set_description(), expected from get_description()
@@ -61,7 +61,7 @@ public function test_description($description, $expected)
6161
*
6262
* @return array Array of test data
6363
*/
64-
public function description_fails_test_data()
64+
public static function description_fails_test_data()
6565
{
6666
return array(
6767
// description

tests/entity/page_entity_iconfont_test.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class page_entity_iconfont_test extends page_entity_base
2020
*
2121
* @return array Array of test data
2222
*/
23-
public function icon_font_test_data()
23+
public static function icon_font_test_data()
2424
{
2525
return array(
2626
// sent to set_icon_font(), expected from get_icon_font()
@@ -59,7 +59,7 @@ public function test_icon_font($input, $expected)
5959
*
6060
* @return array Array of test data
6161
*/
62-
public function icon_font_fails_test_data()
62+
public static function icon_font_fails_test_data()
6363
{
6464
return array(
6565
// Some invalid icon font names

tests/entity/page_entity_id_test.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ class page_entity_id_test extends page_entity_base
2020
*
2121
* @return array Array of test data
2222
*/
23-
public function id_test_data()
23+
public static function id_test_data()
2424
{
25-
$import_data = $this->get_import_data();
25+
$import_data = parent::get_import_data();
2626

2727
return array(
2828
array(

tests/entity/page_entity_import_test.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ class page_entity_import_test extends page_entity_base
2020
*
2121
* @return array Array of test data
2222
*/
23-
public function import_test_data()
23+
public static function import_test_data()
2424
{
25-
$import_data = $this->get_import_data();
25+
$import_data = parent::get_import_data();
2626

2727
return array(
2828
array($import_data[1]),
@@ -76,9 +76,9 @@ public function test_import($data)
7676
*
7777
* @return array Array of test data
7878
*/
79-
public function import_test_fail_data()
79+
public static function import_test_fail_data()
8080
{
81-
$import_data = $this->get_import_data();
81+
$import_data = parent::get_import_data();
8282

8383
$data = array();
8484

tests/entity/page_entity_load_test.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class page_entity_load_test extends page_entity_base
2020
*
2121
* @return array Array of test data
2222
*/
23-
public function load_test_data()
23+
public static function load_test_data()
2424
{
2525
return array(
2626
// id to search, data which should match
@@ -135,7 +135,7 @@ public function test_load($id, $route, $data)
135135
*
136136
* @return array Array of test data
137137
*/
138-
public function load_fails_test_data()
138+
public static function load_fails_test_data()
139139
{
140140
return array(
141141
// id to search

0 commit comments

Comments
 (0)