mirror of
https://github.com/moodle/moodle.git
synced 2025-03-14 12:40:01 +01:00
MDL-59801 users: Behat fixes
Firstly - the list of roles to filter needs to be a combination of the assignable roles and the existing roles in the course. Secondly - the auto-complete behat step needs to search for entire strings, not substrings.
This commit is contained in:
parent
4bd649d31a
commit
d29be32000
@ -532,7 +532,7 @@ class behat_forms extends behat_base {
|
||||
* @param string $item
|
||||
*/
|
||||
public function i_click_on_item_in_the_autocomplete_list($item) {
|
||||
$xpathtarget = "//ul[@class='form-autocomplete-suggestions']//*[contains(.,'" . $item . "')]";
|
||||
$xpathtarget = "//ul[@class='form-autocomplete-suggestions']//*[contains(concat('|', string(.), '|'),'|" . $item . "|')]";
|
||||
|
||||
$this->execute('behat_general::i_click_on', [$xpathtarget, 'xpath_element']);
|
||||
|
||||
|
@ -282,11 +282,9 @@ class core_user_renderer extends plugin_renderer_base {
|
||||
|
||||
// Filter options for role.
|
||||
$roleseditable = has_capability('moodle/role:assign', $context);
|
||||
$roles = [];
|
||||
$roles = role_fix_names(get_profile_roles($context), $context, ROLENAME_ALIAS, true);
|
||||
if ($roleseditable) {
|
||||
$roles = get_assignable_roles($context, ROLENAME_ALIAS);
|
||||
} else {
|
||||
$roles = role_fix_names(get_profile_roles($context), $context, ROLENAME_ALIAS, true);
|
||||
$roles += get_assignable_roles($context, ROLENAME_ALIAS);
|
||||
}
|
||||
$criteria = get_string('role');
|
||||
$roleoptions = [];
|
||||
|
Loading…
x
Reference in New Issue
Block a user