This commit is contained in:
Sara Arjona 2024-01-08 09:35:21 +01:00
commit 7d2c498211
No known key found for this signature in database
4 changed files with 0 additions and 220 deletions

View File

@ -1,91 +0,0 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
// 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<dayofmonth>\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<dayofmonth>\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");
}
}

View File

@ -1,75 +0,0 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
// 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_name_string>(?:[^"]|\\")*)" 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'));
}
}

View File

@ -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<link_string>(?:[^"]|\\")*)" 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']);
}
}

View File

@ -1,39 +0,0 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
// 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);
}
}
}