Forum-related steps definitions.
More...
|
| getSession ($name=null) |
| Returns the Mink session.
|
|
| i_add_a_forum_discussion_to_forum_inline_with ($forumname, TableNode $table) |
| Adds a discussion to the forum specified by it's name with the provided table data (usually Subject and Message).
|
|
| i_add_a_forum_discussion_to_forum_with ($forumname, TableNode $table) |
| Adds a discussion to the forum specified by it's name with the provided table data (usually Subject and Message).
|
|
| i_add_a_new_question_to_forum_with ($forumname, TableNode $table) |
| Adds a Q&A discussion to the Q&A-type forum specified by it's name with the provided table data.
|
|
| i_add_a_new_topic_to_forum_with ($forumname, TableNode $table) |
| Adds a topic to the forum specified by it's name.
|
|
| i_can_subscribe_to_this_forum () |
| Checks if the user can subscribe to the forum.
|
|
| i_can_unsubscribe_from_this_forum () |
| Checks if the user can unsubscribe from the forum.
|
|
| i_click_on_action_menu ($discussion) |
| Opens up the action menu for the discussion.
|
|
| i_navigate_to_post_in_forum ($postsubject, $forumname) |
| Navigates to a particular discussion page.
|
|
| i_reply_post_from_forum_using_an_inpage_reply_with ($postsubject, $forumname, TableNode $table) |
| Inpage Reply - adds a reply to the specified post of the specified forum.
|
|
| i_reply_post_from_forum_with ($postsubject, $forumname, TableNode $table) |
| Adds a reply to the specified post of the specified forum.
|
|
| i_subscribe_to_this_forum () |
| Subscribes to the forum.
|
|
| i_unsubscribe_from_this_forum () |
| Unsubscribes from the forum.
|
|
| reset_forum_caches () |
| Reset forum caches between tests.
|
|
| the_following_forum_discussions_exist (string $coursename, TableNode $discussionsdata) |
| Creates new discussions within forums of a given course.
|
|
| the_following_forum_replies_exist (string $coursename, TableNode $repliesdata) |
| Creates replies to discussions within forums of a given course.
|
|
|
| add_new_discussion ($forumname, TableNode $table, $buttonstr) |
| Returns the steps list to add a new discussion to a forum.
|
|
| add_new_discussion_inline ($forumname, TableNode $table, $buttonstr) |
| Returns the steps list to add a new discussion to a forum inline.
|
|
| create_post_attachments (int $postid, int $userid, array $attachmentnames, stdClass $cm, string $filearea) |
| Create one or more attached or inline attachments to a forum post.
|
|
| fill_new_discussion_form (TableNode $table) |
| Fill in the forum's post form and submit.
|
|
| get_base_discussion (int $forumid, string $name) |
| Fetch discussion ID and first post ID by discussion name.
|
|
| get_course_id (string $coursename) |
| Fetch course ID using course name.
|
|
| get_forum_id (int $courseid, string $forumname) |
| Fetch forum ID using forum name.
|
|
| get_group_id (int $courseid, string $groupname) |
| Fetch Group ID using group name.
|
|
| get_user_id ($username) |
| Fetch user ID from its username.
|
|
| goto_main_post_reply ($postsubject) |
| Go to the default reply to post page.
|
|
Forum-related steps definitions.
- Copyright
- 2013 David MonllaĆ³
- License
- http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
◆ add_new_discussion()
behat_mod_forum::add_new_discussion |
( |
| $forumname, |
|
|
TableNode | $table, |
|
|
| $buttonstr ) |
|
protected |
Returns the steps list to add a new discussion to a forum.
Abstracts add a new topic and add a new discussion, as depending on the forum type the button string changes.
- Parameters
-
string | $forumname | |
TableNode | $table | |
string | $buttonstr | |
◆ add_new_discussion_inline()
behat_mod_forum::add_new_discussion_inline |
( |
| $forumname, |
|
|
TableNode | $table, |
|
|
| $buttonstr ) |
|
protected |
Returns the steps list to add a new discussion to a forum inline.
Abstracts add a new topic and add a new discussion, as depending on the forum type the button string changes.
- Parameters
-
string | $forumname | |
TableNode | $table | |
string | $buttonstr | |
◆ create_post_attachments()
behat_mod_forum::create_post_attachments |
( |
int | $postid, |
|
|
int | $userid, |
|
|
array | $attachmentnames, |
|
|
stdClass | $cm, |
|
|
string | $filearea ) |
|
protected |
Create one or more attached or inline attachments to a forum post.
- Parameters
-
int | $postid | The ID of the forum post. |
int | $userid | The user ID creating the attachment. |
array | $attachmentnames | Names of all attachments to be created. |
stdClass | $cm | The context module of the forum. |
string | $filearea | The file area being written to, eg 'attachment' or 'post' (inline). |
◆ fill_new_discussion_form()
behat_mod_forum::fill_new_discussion_form |
( |
TableNode | $table | ) |
|
|
protected |
Fill in the forum's post form and submit.
It assumes you've already navigated and enabled the form for view.
- Parameters
-
- Exceptions
-
◆ get_base_discussion()
behat_mod_forum::get_base_discussion |
( |
int | $forumid, |
|
|
string | $name ) |
|
protected |
Fetch discussion ID and first post ID by discussion name.
- Parameters
-
int | $forumid | The forum ID where the discussion resides. |
string | $name | The name of the discussion. |
- Return values
-
array | The discussion ID and first post ID. |
- Exceptions
-
dml_exception | If the discussion name is not unique within the forum (or doesn't exist). |
◆ get_course_id()
behat_mod_forum::get_course_id |
( |
string | $coursename | ) |
|
|
protected |
Fetch course ID using course name.
- Parameters
-
string | $coursename | The name of the course. |
- Return values
-
- Exceptions
-
◆ get_forum_id()
behat_mod_forum::get_forum_id |
( |
int | $courseid, |
|
|
string | $forumname ) |
|
protected |
Fetch forum ID using forum name.
- Parameters
-
int | $courseid | The course ID the forum exists within. |
string | $forumname | The name of the forum. |
- Return values
-
- Exceptions
-
◆ get_group_id()
behat_mod_forum::get_group_id |
( |
int | $courseid, |
|
|
string | $groupname ) |
|
protected |
Fetch Group ID using group name.
- Parameters
-
int | $courseid | The course ID the forum exists within. |
string | $groupname | The short name of the group. |
- Return values
-
- Exceptions
-
◆ get_user_id()
behat_mod_forum::get_user_id |
( |
| $username | ) |
|
|
protected |
Fetch user ID from its username.
- Parameters
-
string | $username | The username. |
- Return values
-
- Exceptions
-
◆ getSession()
behat_session_interface::getSession |
( |
| $name = null | ) |
|
|
inherited |
Returns the Mink session.
- Parameters
-
string | null | $name | name of the session OR active session will be used |
- Return values
-
Implemented in behat_form_field.
◆ goto_main_post_reply()
behat_mod_forum::goto_main_post_reply |
( |
| $postsubject | ) |
|
|
protected |
Go to the default reply to post page.
This is used instead of navigating through 4-5 different steps and to solve issues where JS would be required to click on the advanced button
- Parameters
-
- Exceptions
-
◆ i_add_a_forum_discussion_to_forum_inline_with()
behat_mod_forum::i_add_a_forum_discussion_to_forum_inline_with |
( |
| $forumname, |
|
|
TableNode | $table ) |
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.
@Given /^I add a new discussion to "(?P<forum_name_string>(?:[^"]|::")*)" forum inline with:$/
- Parameters
-
string | $forumname | |
TableNode | $table | |
◆ i_add_a_forum_discussion_to_forum_with()
behat_mod_forum::i_add_a_forum_discussion_to_forum_with |
( |
| $forumname, |
|
|
TableNode | $table ) |
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.
@Given /^I add a new discussion to "(?P<forum_name_string>(?:[^"]|::")*)" forum with:$/
- Parameters
-
string | $forumname | |
TableNode | $table | |
◆ i_add_a_new_question_to_forum_with()
behat_mod_forum::i_add_a_new_question_to_forum_with |
( |
| $forumname, |
|
|
TableNode | $table ) |
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_name_string>(?:[^"]|::")*)" forum with:$/
- Parameters
-
string | $forumname | |
TableNode | $table | |
◆ i_add_a_new_topic_to_forum_with()
behat_mod_forum::i_add_a_new_topic_to_forum_with |
( |
| $forumname, |
|
|
TableNode | $table ) |
Adds a topic to the forum specified by it's name.
Useful for the Announcements and blog-style forums.
@Given /^I add a new topic to "(?P<forum_name_string>(?:[^"]|::")*)" forum with:$/
- Parameters
-
string | $forumname | |
TableNode | $table | |
◆ i_can_subscribe_to_this_forum()
behat_mod_forum::i_can_subscribe_to_this_forum |
( |
| ) |
|
Checks if the user can subscribe to the forum.
@Given /^I can subscribe to this forum$/
◆ i_can_unsubscribe_from_this_forum()
behat_mod_forum::i_can_unsubscribe_from_this_forum |
( |
| ) |
|
Checks if the user can unsubscribe from the forum.
@Given /^I can unsubscribe from this forum$/
◆ i_click_on_action_menu()
behat_mod_forum::i_click_on_action_menu |
( |
| $discussion | ) |
|
Opens up the action menu for the discussion.
@Given /^I click on "(?P<post_subject_string>(?:[^"]|::")*)" action menu$/
- Parameters
-
string | $discussion | The subject of the discussion |
◆ i_navigate_to_post_in_forum()
behat_mod_forum::i_navigate_to_post_in_forum |
( |
| $postsubject, |
|
|
| $forumname ) |
Navigates to a particular discussion page.
@Given /^I navigate to post "(?P<post_subject_string>(?:[^"]|::")*)" in "(?P<forum_name_string>(?:[^"]|")*)" forum$/
- Parameters
-
string | $postsubject | The subject of the post |
string | $forumname | The forum name |
◆ i_reply_post_from_forum_using_an_inpage_reply_with()
behat_mod_forum::i_reply_post_from_forum_using_an_inpage_reply_with |
( |
| $postsubject, |
|
|
| $forumname, |
|
|
TableNode | $table ) |
Inpage Reply - adds a reply to the specified post of the specified forum.
The step begins from the forum's page or from the forum's course page.
@Given /^I reply "(?P<post_subject_string>(?:[^"]|::")*)" post from "(?P<forum_name_string>(?:[^"]|")*)" forum using an inpage reply with:$/
- Parameters
-
string | $postsubject | The subject of the post |
string | $forumname | The forum name |
TableNode | $table | |
◆ i_reply_post_from_forum_with()
behat_mod_forum::i_reply_post_from_forum_with |
( |
| $postsubject, |
|
|
| $forumname, |
|
|
TableNode | $table ) |
Adds a reply to the specified post of the specified forum.
The step begins from the forum's page or from the forum's course page.
@Given /^I reply "(?P<post_subject_string>(?:[^"]|::")*)" post from "(?P<forum_name_string>(?:[^"]|")*)" forum with:$/
- Parameters
-
string | $postname | The subject of the post |
string | $forumname | The forum name |
TableNode | $table | |
◆ i_subscribe_to_this_forum()
behat_mod_forum::i_subscribe_to_this_forum |
( |
| ) |
|
Subscribes to the forum.
@Given /^I subscribe to this forum$/
◆ i_unsubscribe_from_this_forum()
behat_mod_forum::i_unsubscribe_from_this_forum |
( |
| ) |
|
Unsubscribes from the forum.
@Given /^I unsubscribe from this forum$/
◆ reset_forum_caches()
behat_mod_forum::reset_forum_caches |
( |
| ) |
|
Reset forum caches between tests.
@BeforeScenario @mod_forum
◆ the_following_forum_discussions_exist()
behat_mod_forum::the_following_forum_discussions_exist |
( |
string | $coursename, |
|
|
TableNode | $discussionsdata ) |
Creates new discussions within forums of a given course.
@Given the following forum discussions exist in course :coursename:
- Parameters
-
string | $coursename | The full name of the course where the forums exist. |
TableNode | $discussionsdata | The discussion posts to be created. |
◆ the_following_forum_replies_exist()
behat_mod_forum::the_following_forum_replies_exist |
( |
string | $coursename, |
|
|
TableNode | $repliesdata ) |
Creates replies to discussions within forums of a given course.
@Given the following forum replies exist in course :coursename:
- Parameters
-
string | $coursename | The full name of the course where the forums exist. |
TableNode | $repliesdata | The reply posts to be created. |
◆ PAGE_READY_JS
const behat_session_interface::PAGE_READY_JS |
|
inherited |
Initial value:= "document.readyState === 'complete' && " .
"(typeof M !== 'object' || typeof M.util !== 'object' || " .
"typeof M.util.pending_js === 'undefined' || M.util.pending_js.length === 0)"
The JS code to check that the page is ready.
The document must be complete and either M.util.pending_js must be empty, or it must not be defined at all.
The documentation for this class was generated from the following file:
- mod/forum/tests/behat/behat_mod_forum.php