Skip to content

Commit 7a0858f

Browse files
committed
Fix deprecations
1 parent fb647cb commit 7a0858f

22 files changed

+74
-77
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: 20 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2,33 +2,29 @@
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>
25-
<testsuites>
26-
<testsuite name="Extension Test Suite">
27-
<directory suffix="_test.php">./tests</directory>
28-
<exclude>./tests/functional</exclude>
29-
</testsuite>
30-
<testsuite name="Extension Functional Tests">
31-
<directory suffix="_test.php">./tests/functional/</directory>
32-
</testsuite>
33-
</testsuites>
10+
backupStaticProperties="false">
11+
<testsuites>
12+
<testsuite name="Extension Test Suite">
13+
<directory suffix="_test.php">./tests</directory>
14+
<exclude>./tests/functional</exclude>
15+
</testsuite>
16+
<testsuite name="Extension Functional Tests">
17+
<directory suffix="_test.php">./tests/functional/</directory>
18+
</testsuite>
19+
</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/entity/rule_entity_anchor_test.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class rule_entity_anchor_test extends rule_entity_base
2020
*
2121
* @return array Array of test data
2222
*/
23-
public function anchor_test_data()
23+
public static function anchor_test_data()
2424
{
2525
return array(
2626
// sent to set_anchor(), expected from get_anchor()
@@ -63,7 +63,7 @@ public function test_anchor($anchor, $expected)
6363
*
6464
* @return array Array of test data
6565
*/
66-
public function anchor_fails_test_data()
66+
public static function anchor_fails_test_data()
6767
{
6868
return array(
6969
// Starts with illegal characters
@@ -135,7 +135,7 @@ public function test_anchor_fails($anchor)
135135
*
136136
* @return array Array of test data
137137
*/
138-
public function unique_anchor_test_data()
138+
public static function unique_anchor_test_data()
139139
{
140140
return array(
141141
// id // language // sent to set_anchor(), expected from get_anchor()
@@ -184,7 +184,7 @@ public function test_unique_anchor($id, $language, $anchor, $expected)
184184
*
185185
* @return array Array of test data
186186
*/
187-
public function unique_anchor_test_fails_data()
187+
public static function unique_anchor_test_fails_data()
188188
{
189189
return array(
190190
// id // language // sent to set_anchor()

tests/entity/rule_entity_base.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ protected function get_rule_entity()
6060
*
6161
* @return array Data to send to import_data
6262
*/
63-
public function get_import_data()
63+
public static function get_import_data()
6464
{
6565
return array(
6666
1 => array(

tests/entity/rule_entity_id_test.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ class rule_entity_id_test extends rule_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/rule_entity_import_test.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ class rule_entity_import_test extends rule_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]),
@@ -72,9 +72,9 @@ public function test_import($data)
7272
*
7373
* @return array Array of test data
7474
*/
75-
public function import_test_fail_data()
75+
public static function import_test_fail_data()
7676
{
77-
$import_data = $this->get_import_data();
77+
$import_data = parent::get_import_data();
7878

7979
$data = array();
8080

tests/entity/rule_entity_language_test.php

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

2727
// Set some data to test other than en from our import data
2828
$import_data[3]['rule_language'] = 'foo';

tests/entity/rule_entity_left_id_test.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ class rule_entity_left_id_test extends rule_entity_base
2020
*
2121
* @return array Array of test data
2222
*/
23-
public function left_id_test_data()
23+
public static function left_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/rule_entity_load_test.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class rule_entity_load_test extends rule_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
@@ -107,7 +107,7 @@ public function test_load($id, $data)
107107
*
108108
* @return array Array of test data
109109
*/
110-
public function load_fails_test_data()
110+
public static function load_fails_test_data()
111111
{
112112
return array(
113113
// id to search

tests/entity/rule_entity_message_test.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ protected function setUp(): void
4848
*
4949
* @return array Array of test data
5050
*/
51-
public function message_test_data()
51+
public static function message_test_data()
5252
{
5353
return array(
5454
// sent to set_message()

0 commit comments

Comments
 (0)