From af74a5534b8cb9089ed11ce4e78056399dc75a04 Mon Sep 17 00:00:00 2001 From: Mihail Geshoski Date: Tue, 13 Sep 2022 14:11:41 +0800 Subject: [PATCH] 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(). --- grade/tests/behat/behat_grade.php | 8 ++++++-- grade/upgrade.txt | 2 ++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/grade/tests/behat/behat_grade.php b/grade/tests/behat/behat_grade.php index 2aa101a9405..b19f5189938 100644 --- a/grade/tests/behat/behat_grade.php +++ b/grade/tests/behat/behat_grade.php @@ -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)); diff --git a/grade/upgrade.txt b/grade/upgrade.txt index ca1cc74209c..c51175a4936 100644 --- a/grade/upgrade.txt +++ b/grade/upgrade.txt @@ -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 ===