diff --git a/calendar/tests/behat/behat_calendar_deprecated.php b/calendar/tests/behat/behat_calendar_deprecated.php deleted file mode 100644 index 1693240b804..00000000000 --- a/calendar/tests/behat/behat_calendar_deprecated.php +++ /dev/null @@ -1,91 +0,0 @@ -. - -// NOTE: no MOODLE_INTERNAL test here, this file may be required by behat before including /config.php. - -require_once(__DIR__ . '/../../../lib/behat/behat_deprecated_base.php'); - -/** - * Steps definitions that are now deprecated and will be removed in the next releases. - * - * This file only contains the steps that previously were in the behat_*.php files in the SAME DIRECTORY. - * When deprecating steps from other components or plugins, create a behat_COMPONENT_deprecated.php - * file in the same directory where the steps were defined. - * - * @package core_calendar - * @category test - * @copyright 2022 Marina Glancy - * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later - */ -class behat_calendar_deprecated extends behat_deprecated_base { - - /** - * Hover over a specific day in the calendar. - * - * @Given /^I hover over day "(?P\d+)" of this month in the calendar$/ - * @param int $day The day of the current month - * - * @deprecated since 4.0 MDL-72810. This tested the three-month calendar pseudo block, which has been removed. - * @todo MDL-73117 This will be deleted in Moodle 4.4. - */ - public function i_hover_over_day_of_this_month_in_calendar($day) { - $this->deprecated_message('behat_calendar::i_hover_over_day_of_this_month_in_mini_calendar_block'); - - $summarytitle = userdate(time(), get_string('strftimemonthyear')); - // The current month table. - $currentmonth = "table[descendant::*[self::caption[contains(concat(' ', normalize-space(.), ' '), ' {$summarytitle} ')]]]"; - - // Strings for the class cell match. - $cellclasses = "contains(concat(' ', normalize-space(@class), ' '), ' day ')"; - $daycontains = "text()[contains(concat(' ', normalize-space(.), ' '), ' {$day} ')]"; - $daycell = "td[{$cellclasses}]"; - $dayofmonth = "a[{$daycontains}]"; - - $xpath = '//' . $currentmonth . '/descendant::' . $daycell . '/' . $dayofmonth; - $this->execute("behat_general::i_hover", [$xpath, "xpath_element"]); - } - - /** - * Click a specific day in the calendar. - * - * @Given /^I click day "(?P\d+)" of this month in the calendar$/ - * @param int $day The day of the current month - * - * @deprecated since 4.0 MDL-72810. This tested the three-month calendar pseudo block, which has been removed. - * @todo MDL-73117 This will be deleted in Moodle 4.4. - */ - public function i_click_day_of_this_month_in_calendar($day) { - $this->deprecated_message([ - 'behat_general::i_click_on', - 'behat_caendar::i_hover_over_day_of_this_month_in_full_calendar_page', - ]); - - $summarytitle = userdate(time(), get_string('strftimemonthyear')); - // The current month table. - $currentmonth = "table[descendant::*[self::caption[contains(concat(' ', normalize-space(.), ' '), ' {$summarytitle} ')]]]"; - - // Strings for the class cell match. - $cellclasses = "contains(concat(' ', normalize-space(@class), ' '), ' day ')"; - $daycontains = "text()[contains(concat(' ', normalize-space(.), ' '), ' {$day} ')]"; - $daycell = "td[{$cellclasses}]"; - $dayofmonth = "a[{$daycontains}]"; - - $xpath = '//' . $currentmonth . '/descendant::' . $daycell . '/' . $dayofmonth; - $this->execute("behat_general::wait_until_the_page_is_ready"); - $this->execute("behat_general::i_click_on", array($xpath, "xpath_element")); - $this->execute("behat_general::wait_until_the_page_is_ready"); - } -} diff --git a/enrol/tests/behat/behat_enrol_deprecated.php b/enrol/tests/behat/behat_enrol_deprecated.php deleted file mode 100644 index d0056f40f01..00000000000 --- a/enrol/tests/behat/behat_enrol_deprecated.php +++ /dev/null @@ -1,75 +0,0 @@ -. - -// NOTE: no MOODLE_INTERNAL test here, this file may be required by behat before including /config.php. - -use Behat\Gherkin\Node\TableNode; - -require_once(__DIR__ . '/../../../lib/behat/behat_deprecated_base.php'); - -/** - * Steps definitions that are now deprecated and will be removed in the next releases. - * - * This file only contains the steps that previously were in the behat_*.php files in the SAME DIRECTORY. - * When deprecating steps from other components or plugins, create a behat_COMPONENT_deprecated.php - * file in the same directory where the steps were defined. - * - * @package core_enrol - * @category test - * @copyright 2022 Marina Glancy - * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later - */ -class behat_enrol_deprecated extends behat_deprecated_base { - - /** - * Adds the specified enrolment method to the current course filling the form with the provided data. - * - * @Given /^I add "(?P(?:[^"]|\\")*)" enrolment method with:$/ - * @param string $enrolmethod - * @param TableNode $table - * - * @deprecated since 4.0 MDL-72090. We now need the course to enrol in. Please use i_add_enrolment_method_for_with() - * @todo MDL-71733 This will be deleted in Moodle 4.4. - */ - public function i_add_enrolment_method_with($enrolmethod, TableNode $table) { - $this->deprecated_message(['behat_enrol::i_add_enrolment_method_for_with']); - - // Navigate to enrolment method page. - $parentnodes = get_string('users', 'admin'); - $this->execute("behat_navigation::i_navigate_to_in_current_page_administration", - array($parentnodes .' > '. get_string('type_enrol_plural', 'plugin')) - ); - - // Select enrolment method. - $this->execute('behat_forms::i_select_from_the_singleselect', - array($this->escape($enrolmethod), get_string('addinstance', 'enrol')) - ); - - // Wait again, for page to reloaded. - $this->execute('behat_general::i_wait_to_be_redirected'); - - // Set form fields. - $this->execute("behat_forms::i_set_the_following_fields_to_these_values", $table); - - // Ensure we get button in focus, before pressing button. - if ($this->running_javascript()) { - $this->execute('behat_general::i_press_named_key', ['', 'tab']); - } - - // Save changes. - $this->execute("behat_forms::press_button", get_string('addinstance', 'enrol')); - } -} diff --git a/lib/tests/behat/behat_deprecated.php b/lib/tests/behat/behat_deprecated.php index aa17d875537..a8573b9165c 100644 --- a/lib/tests/behat/behat_deprecated.php +++ b/lib/tests/behat/behat_deprecated.php @@ -18,8 +18,6 @@ require_once(__DIR__ . '/../../../lib/behat/behat_deprecated_base.php'); -use Behat\Mink\Exception\ElementNotFoundException as ElementNotFoundException; - /** * Steps definitions that are now deprecated and will be removed in the next releases. * @@ -34,17 +32,4 @@ use Behat\Mink\Exception\ElementNotFoundException as ElementNotFoundException; */ class behat_deprecated extends behat_deprecated_base { - /** - * Clicks link with specified id|title|alt|text in the flat navigation drawer. - * - * @When /^I select "(?P(?:[^"]|\\")*)" from flat navigation drawer$/ - * @param string $link - * @deprecated Since Moodle 4.0 - */ - public function i_select_from_flat_navigation_drawer(string $link) { - $this->deprecated_message(['i_select_from_primary_navigation', 'i_select_from_secondary_navigation']); - - $this->execute('behat_navigation::i_open_flat_navigation_drawer'); - $this->execute('behat_general::i_click_on_in_the', [$link, 'link', '#nav-drawer', 'css_element']); - } } diff --git a/question/tests/behat/behat_question.php b/question/tests/behat/behat_question.php deleted file mode 100644 index 405a3e7fde9..00000000000 --- a/question/tests/behat/behat_question.php +++ /dev/null @@ -1,39 +0,0 @@ -. - -// NOTE: no MOODLE_INTERNAL test here, this file may be required by behat before including /config.php. - -require_once(__DIR__ . '/../../../lib/behat/behat_deprecated_base.php'); -require_once(__DIR__ . '/behat_question_base.php'); - -/** - * Deprecated class, only kept for backwards compatibility. - * - * @package core_question - * @category test - * @copyright 2022 The Open University - * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later - * @deprecated since Moodle 4.0. Use behat_core_question instead - * (if you need to refer to this class at all, which you probably don't). - */ -class behat_question extends behat_deprecated_base { - public function __call($name, $arguments) { - if (method_exists(behat_core_question::class, $name)) { - $this->deprecated_message('The behat_question class has been moved to behat_core_question.'); - $this->execute("behat_core_question::{$name}", $arguments); - } - } -}