From fc5c0ad3e5cf8551c7003bdcf19968cffc75cb1e Mon Sep 17 00:00:00 2001 From: Simey Lameze Date: Thu, 9 Jan 2025 10:39:21 +0800 Subject: [PATCH] MDL-82866 behat: deprecate the old lp step and class --- .upgradenotes/MDL-82866-2025011411130254.yml | 7 +++++++ ..._generators.php => behat_tool_lp_deprecated.php} | 13 +++++++++++-- 2 files changed, 18 insertions(+), 2 deletions(-) create mode 100644 .upgradenotes/MDL-82866-2025011411130254.yml rename admin/tool/lp/tests/behat/{behat_tool_lp_data_generators.php => behat_tool_lp_deprecated.php} (95%) diff --git a/.upgradenotes/MDL-82866-2025011411130254.yml b/.upgradenotes/MDL-82866-2025011411130254.yml new file mode 100644 index 00000000000..721eff65a46 --- /dev/null +++ b/.upgradenotes/MDL-82866-2025011411130254.yml @@ -0,0 +1,7 @@ +issueNumber: MDL-82866 +notes: + tool_lp: + - message: >- + behat_tool_lp_data_generators::the_following_lp_exist is deprecated. Use + the following "core_competency > [competency|framework|plan...]" exist: + type: deprecated diff --git a/admin/tool/lp/tests/behat/behat_tool_lp_data_generators.php b/admin/tool/lp/tests/behat/behat_tool_lp_deprecated.php similarity index 95% rename from admin/tool/lp/tests/behat/behat_tool_lp_data_generators.php rename to admin/tool/lp/tests/behat/behat_tool_lp_deprecated.php index 1f30e9c5bfa..0ee66509f99 100644 --- a/admin/tool/lp/tests/behat/behat_tool_lp_data_generators.php +++ b/admin/tool/lp/tests/behat/behat_tool_lp_deprecated.php @@ -23,7 +23,7 @@ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ -require_once(__DIR__ . '/../../../../../lib/behat/behat_base.php'); +require_once(__DIR__ . '/../../../../../lib/behat/behat_deprecated_base.php'); use Behat\Gherkin\Node\TableNode as TableNode; use Behat\Behat\Tester\Exception\PendingException as PendingException; @@ -40,7 +40,7 @@ use core_competency\user_evidence; * @copyright 2016 Issam Taboubi * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ -class behat_tool_lp_data_generators extends behat_base { +class behat_tool_lp_deprecated extends behat_deprecated_base { /** * @var tool_lp data generator @@ -98,12 +98,21 @@ class behat_tool_lp_data_generators extends behat_base { * * @Given /^the following lp "(?P(?:[^"]|\\")*)" exist:$/ * + * @todo MDL-78077 This will be deleted in Moodle 6.0. + * @deprecated since 5.0 + * * @throws Exception * @throws PendingException * @param string $elementname The name of the entity to add * @param TableNode $data */ + #[\core\attribute\deprecated('behat_tool_lp_data_generators::the_following_lp_exist', since: '5.0')] public function the_following_lp_exist($elementname, TableNode $data) { + $this->deprecated_message([ + 'behat_tool_lp_data_generators::the_following_lp_exist is deprecated', + 'Use: the following "core_competency > [competency|framework|plan...]" exist:', + + ]); // Now that we need them require the data generators. require_once(__DIR__.'/../../../../../lib/phpunit/classes/util.php');