From b92880fd4acf4af7bb8a07b2793a67f68e0fb341 Mon Sep 17 00:00:00 2001 From: Jun Pataleta Date: Thu, 16 Jan 2020 00:11:24 +0800 Subject: [PATCH] MDL-51225 mod_forum: New behat step for creating question discussion --- mod/forum/tests/behat/behat_mod_forum.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/mod/forum/tests/behat/behat_mod_forum.php b/mod/forum/tests/behat/behat_mod_forum.php index 6dfdb7e6be2..78c3e6713fb 100644 --- a/mod/forum/tests/behat/behat_mod_forum.php +++ b/mod/forum/tests/behat/behat_mod_forum.php @@ -49,6 +49,17 @@ class behat_mod_forum extends behat_base { $this->add_new_discussion($forumname, $table, get_string('addanewtopic', 'forum')); } + /** + * Adds a Q&A discussion to the Q&A-type forum specified by it's name with the provided table data. + * + * @Given /^I add a new question to "(?P(?:[^"]|\\")*)" forum with:$/ + * @param string $forumname + * @param TableNode $table + */ + public function i_add_a_new_question_to_forum_with($forumname, TableNode $table) { + $this->add_new_discussion($forumname, $table, get_string('addanewquestion', 'forum')); + } + /** * Adds a discussion to the forum specified by it's name with the provided table data (usually Subject and Message). The step begins from the forum's course page. *