From 08ca9693239ba44dfa2de5cc83891ef091084b42 Mon Sep 17 00:00:00 2001 From: Daniel Ziegenberg Date: Wed, 20 Nov 2024 11:48:09 +0100 Subject: [PATCH] MDL-83035 behat: deprecate admin presets behat steps Signed-off-by: Daniel Ziegenberg --- .upgradenotes/MDL-83035-2025012010463894.yml | 7 +++++++ ...s.php => behat_admin_presets_deprecated.php} | 17 ++++++++++++++--- 2 files changed, 21 insertions(+), 3 deletions(-) create mode 100644 .upgradenotes/MDL-83035-2025012010463894.yml rename admin/tool/admin_presets/tests/behat/{behat_admin_presets.php => behat_admin_presets_deprecated.php} (88%) diff --git a/.upgradenotes/MDL-83035-2025012010463894.yml b/.upgradenotes/MDL-83035-2025012010463894.yml new file mode 100644 index 00000000000..72d80fabf19 --- /dev/null +++ b/.upgradenotes/MDL-83035-2025012010463894.yml @@ -0,0 +1,7 @@ +issueNumber: MDL-83035 +notes: + tool_admin_presets: + - message: >- + behat_admin_presets::following_in_the_should_download_between_and_bytes + is deprecated. Use: the following element should download a file that: + type: deprecated diff --git a/admin/tool/admin_presets/tests/behat/behat_admin_presets.php b/admin/tool/admin_presets/tests/behat/behat_admin_presets_deprecated.php similarity index 88% rename from admin/tool/admin_presets/tests/behat/behat_admin_presets.php rename to admin/tool/admin_presets/tests/behat/behat_admin_presets_deprecated.php index 23b8f9ff31a..3910183ad6e 100644 --- a/admin/tool/admin_presets/tests/behat/behat_admin_presets.php +++ b/admin/tool/admin_presets/tests/behat/behat_admin_presets_deprecated.php @@ -26,21 +26,22 @@ // NOTE: no MOODLE_INTERNAL test here, this file may be required by behat before including /config.php. -require_once(__DIR__ . '/../../../../../lib/behat/behat_base.php'); +require_once(__DIR__ . '/../../../../../lib/behat/behat_deprecated_base.php'); require_once(__DIR__ . '/../../../../../lib/behat/behat_field_manager.php'); use Behat\Mink\Exception\ExpectationException as ExpectationException; /** - * Steps definitions related with admin presets. + * Steps definitions that are now deprecated and will be removed in the next releases. * * @package tool_admin_presets * @category test * @copyright 2021 Pimenko * @author Sylvain Revenu | Pimenko * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + * @todo MDL-78077 This will be deleted in Moodle 6.0. */ -class behat_admin_presets extends behat_base { +class behat_admin_presets_deprecated extends behat_deprecated_base { /** * Downloads the file from a specific link on the page and checks the size is in a given range. @@ -60,9 +61,14 @@ class behat_admin_presets extends behat_base { * @param int $maxexpectedsize the maximum expected file size in bytes. * @return void * @throws ExpectationException + * @deprecated since 5.0 */ final public function following_in_the_should_download_between_and_bytes(string $link, string $selectortype, string $nodeelement, string $nodeselectortype, int $minexpectedsize, int $maxexpectedsize): void { + + $this->deprecated_message("behat_admin_presets::following_in_the_should_download_between_and_bytes + is deprecated. Use: the following element should download a file that:"); + // If the minimum is greater than the maximum then swap the values. if ((int) $minexpectedsize > (int) $maxexpectedsize) { list($minexpectedsize, $maxexpectedsize) = [$maxexpectedsize, $minexpectedsize]; @@ -105,9 +111,14 @@ class behat_admin_presets extends behat_base { * @param string $nodeselectortype The type of selector where we look in * @param string $nodeelement Element we look in * @return string the content of the downloaded file. + * @deprecated since 5.0 */ final public function download_file_from_link_within_node(string $selectortype, string $link, string $nodeselectortype, string $nodeelement): string { + + $this->deprecated_message("behat_admin_presets::following_in_the_should_download_between_and_bytes + is deprecated. Use: the following element should download a file that:"); + // Find the link from ur specific node. $linknode = $this->get_node_in_container($selectortype, $link, $nodeselectortype, $nodeelement); $this->ensure_node_is_visible($linknode);