mirror of
https://github.com/moodle/moodle.git
synced 2025-01-17 13:38:32 +01:00
MDL-77967 core_user: Coding style fixes in tests
This commit is contained in:
parent
b64dff686e
commit
64aedb9b24
@ -151,10 +151,10 @@ class profile_field_base {
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function display_name() {
|
||||
$options = new stdClass();
|
||||
$options->para = false;
|
||||
return format_text($this->field->name, FORMAT_MOODLE, $options);
|
||||
public function display_name(): string {
|
||||
return format_text($this->field->name, FORMAT_MOODLE, [
|
||||
'para' => false,
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -39,7 +39,13 @@ require_once($CFG->dirroot . '/webservice/tests/helpers.php');
|
||||
require_once($CFG->dirroot . '/user/externallib.php');
|
||||
require_once($CFG->dirroot . '/files/externallib.php');
|
||||
|
||||
class externallib_test extends externallib_advanced_testcase {
|
||||
/**
|
||||
* Tests for the user external functions.
|
||||
*
|
||||
* @package core_user
|
||||
* @covers \core_user_external
|
||||
*/
|
||||
final class externallib_test extends externallib_advanced_testcase {
|
||||
|
||||
/**
|
||||
* Test get_users
|
||||
@ -179,7 +185,7 @@ class externallib_test extends externallib_advanced_testcase {
|
||||
/**
|
||||
* Test get_users_by_field
|
||||
*/
|
||||
public function test_get_users_by_field() {
|
||||
public function test_get_users_by_field(): void {
|
||||
global $USER, $CFG;
|
||||
|
||||
$this->resetAfterTest(true);
|
||||
@ -351,9 +357,10 @@ class externallib_test extends externallib_advanced_testcase {
|
||||
$return = new \stdClass();
|
||||
|
||||
$generator = self::getDataGenerator();
|
||||
|
||||
// Create complex user profile field supporting multi-lang.
|
||||
filter_set_global_state('multilang', TEXTFILTER_ON);
|
||||
$name = '<span lang="en" class="multilang">Employment status</span>'.
|
||||
$name = '<span lang="en" class="multilang">Employment status</span>' .
|
||||
'<span lang="es" class="multilang">Estado de Empleo</span>';
|
||||
$statuses = 'UE\nSE\n<span lang="en" class="multilang">Other</span><span lang="es" class="multilang">Otro</span>';
|
||||
$generator->create_custom_profile_field(
|
||||
@ -361,7 +368,7 @@ class externallib_test extends externallib_advanced_testcase {
|
||||
'datatype' => 'menu',
|
||||
'shortname' => 'employmentstatus',
|
||||
'name' => $name,
|
||||
'param1' => $statuses
|
||||
'param1' => $statuses,
|
||||
]
|
||||
);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user