MDL-75153 grade: Deprecate select_in_gradebook_navigation_selector()

Deprecates the select_in_gradebook_navigation_selector() function in
behat_grade.php and removes all usages. The select menu field supports
the same functionality and this function can be simply replaced with
behat_forms::i_set_the_field_to().
This commit is contained in:
Mihail Geshoski 2022-09-13 14:11:41 +08:00
parent 0e1cdfde1d
commit af74a5534b
2 changed files with 8 additions and 2 deletions

View File

@ -279,12 +279,12 @@ class behat_grade extends behat_base {
/**
* Select the tab in the gradebook. We must be on one of the gradebook pages already.
*
* @deprecated since 4.0 - use select_in_gradebook_navigation_selector() instead.
* @deprecated since 4.0 - use behat_forms::i_set_the_field_to() instead.
* @param string $gradepath examples: "View > User report", "Letters > View", "Scales"
*/
protected function select_in_gradebook_tabs($gradepath) {
debugging('The function select_in_gradebook_tabs() is deprecated, please use ' .
'select_in_gradebook_navigation_selector() instead.', DEBUG_DEVELOPER);
'behat_forms::i_set_the_field_to() instead.', DEBUG_DEVELOPER);
$gradepath = preg_split('/\s*>\s*/', trim($gradepath));
if (count($gradepath) > 2) {
@ -371,6 +371,7 @@ class behat_grade extends behat_base {
* Select a given option from a navigation URL selector in the gradebook. We must be on one of the gradebook pages
* already.
*
* @deprecated since 4.1 - use behat_forms::i_set_the_field_to() instead.
* @param string $path The string path that is used to identify an item within the navigation selector. If the path
* has two items (ex. "More > Grade letters"), the first item ("More") will be used to identify
* an option group in the navigation selector, while the second ("Grade letters") will be used to
@ -379,6 +380,9 @@ class behat_grade extends behat_base {
* @param string $formid The ID of the form element which contains the navigation URL selector element.
*/
protected function select_in_gradebook_navigation_selector(string $path, string $formid) {
debugging('The function select_in_gradebook_navigation_selector() is deprecated, please use ' .
'behat_forms::i_set_the_field_to() instead.', DEBUG_DEVELOPER);
// Split the path string by ">".
$path = preg_split('/\s*>\s*/', trim($path));

View File

@ -4,6 +4,8 @@ Information provided here is intended especially for developers.
=== 4.1 ===
* The $importactiveurl parameter in the constructor of the core_grades\output\import_action_bar class has been deprecated and is not used anymore.
* The $exportactiveurl parameter in the constructor of the core_grades\output\export_action_bar class has been deprecated and is not used anymore.
* The select_in_gradebook_navigation_selector() function in behat_grade.php has been deprecated. Please use
behat_forms::i_set_the_field_to() instead.
=== 4.0 ===