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 89% 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..a953a338824 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. @@ -51,6 +52,8 @@ class behat_admin_presets extends behat_base { * The range includes the endpoints. That is, a 10 byte file in considered to * be between "5" and "10" bytes, and between "10" and "20" bytes. * + * @deprecated since 5.0 + * * @Then /^following "(?P[^"]*)" "(?P[^"]*)" in the "(?P(?:[^"]|\\")*)" "(?P[^"]*)" should download between "(?P\d+)" and "(?P\d+)" bytes$/ * @param string $link the text of the link. * @param string $selectortype The type of what we look for @@ -61,8 +64,13 @@ class behat_admin_presets extends behat_base { * @return void * @throws ExpectationException */ + #[\core\attribute\deprecated('behat_admin_presets::following_in_the_should_download_between_and_bytes', 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];