Skip to content

Commit 5333e4f

Browse files
Sasha Anastasidanmarsden
authored andcommitted
make test data provider methods static
1 parent c170a01 commit 5333e4f

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

tests/auth_test.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -803,7 +803,7 @@ public function test_should_login_redirect($cfg, $config, $param, $multiidp, $se
803803
*
804804
* @return array of testcases
805805
*/
806-
public function provider_should_login_redirect(): array {
806+
public static function provider_should_login_redirect(): array {
807807
$midp = (new \moodle_url('/auth/saml2/selectidp.php'))->out();
808808
return [
809809
// Login normal, dual login on.
@@ -1019,7 +1019,7 @@ public function test_check_whitelisted_ip_redirect($saml, $remoteip, $whitelist,
10191019
*
10201020
* @return array
10211021
*/
1022-
public function provider_check_whitelisted_ip_redirect(): array {
1022+
public static function provider_check_whitelisted_ip_redirect(): array {
10231023
return [
10241024
'saml off, no ip, no redirect' => ['off', '1.2.3.4', '', false],
10251025
'saml not specified, junk, no redirect' => [null, '1.2.3.4', 'qwer1234!@#qwer', false],
@@ -1034,7 +1034,7 @@ public function provider_check_whitelisted_ip_redirect(): array {
10341034
*
10351035
* @return array
10361036
*/
1037-
public function provider_is_access_allowed(): array {
1037+
public static function provider_is_access_allowed(): array {
10381038
return [
10391039
'' => [[
10401040
['uid' => 'test'], // User don't have groups attribute.
@@ -1258,7 +1258,7 @@ public function test_update_custom_user_profile_fields($attributes): void {
12581258
*
12591259
* @return array of testcases
12601260
*/
1261-
public function provider_update_custom_user_profile_fields(): array {
1261+
public static function provider_update_custom_user_profile_fields(): array {
12621262
return [
12631263
[['testfield' => ['Test data']]],
12641264
[['secondfield' => ['A different string']]],
@@ -1305,7 +1305,7 @@ public function test_missing_user_custom_profile_fields($attributes): void {
13051305
*
13061306
* @return array of testcases
13071307
*/
1308-
public function provider_missing_user_custom_profile_fields(): array {
1308+
public static function provider_missing_user_custom_profile_fields(): array {
13091309
return [
13101310
[['missingfield' => ['Test data']]],
13111311
[['secondfield' => ['A different string']]],
@@ -1344,7 +1344,7 @@ public function test_invalid_map_user_profile_fields($mapping, $attributes): voi
13441344
*
13451345
* @return array of testcases
13461346
*/
1347-
public function provider_invalid_map_user_profile_fields(): array {
1347+
public static function provider_invalid_map_user_profile_fields(): array {
13481348
return [
13491349
[
13501350
['field' => 'userame', 'mapping' => 'invalid'],

tests/user_fields_test.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ public function test_get_supported_fields_with_profile_fields(): void {
121121
* Test data for self::test_is_custom_profile_field().
122122
* @return array
123123
*/
124-
public function is_custom_profile_field_data_provider(): array {
124+
public static function is_custom_profile_field_data_provider(): array {
125125
return [
126126
['profile_field_test', true],
127127
['profiletest', false],
@@ -150,7 +150,7 @@ public function test_is_custom_profile_field($value, bool $expected): void {
150150
* Test data for self::test_get_short_name().
151151
* @return array
152152
*/
153-
public function get_short_name_data_provider(): array {
153+
public static function get_short_name_data_provider(): array {
154154
return [
155155
['profile_field_test', 'test'],
156156
['profile_field_profile_field_test', 'profile_field_test'],

0 commit comments

Comments
 (0)