Skip to content

Commit 0804fe1

Browse files
committed
code cleaning
1 parent d6ac16a commit 0804fe1

File tree

1 file changed

+16
-14
lines changed

1 file changed

+16
-14
lines changed

tests/behat/behat_mod_moodleoverflow.php

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -120,20 +120,21 @@ public function i_add_a_moodleoverflow_discussion_with_posts_from_different_user
120120
/**
121121
* Logs in as a user and navigates in a course to dedicated moodleoverflow discussion.
122122
*
123-
* @Given /^I navigate as "(?P<username>[^"]*)" to "(?P<coursefullname>[^"]*)" "(?P<moodleoverflowname>[^"]*)" "(?P<discussionname>[^"]*)"$/
124-
* @param string $username The username to log in as
125-
* @param string $coursefullname The full name of the course
126-
* @param string $moodleoverflowname The name of the moodleoverflow activity
127-
* @param string $discussionname The name of the discussion
123+
* @Given /^I navigate as "(?P<user>[^"]*)" to "(?P<course>[^"]*)" "(?P<moodleoverflow>[^"]*)" "(?P<discussion>[^"]*)"$/
124+
*
125+
* @param string $user The username to log in as
126+
* @param string $course The full name of the course
127+
* @param string $moodleoverflow The name of the moodleoverflow activity
128+
* @param string $discussion The name of the discussion
128129
* @return void
129130
* @throws Exception
130131
*/
131-
public function i_navigate_as_user_to_the_discussion(string $username, string $coursefullname, string $moodleoverflowname,
132-
string $discussionname): void {
133-
$this->execute('behat_auth::i_log_in_as', $username);
134-
$this->execute('behat_navigation::i_am_on_course_homepage', $coursefullname);
135-
$this->execute('behat_general::click_link', $this->escape($moodleoverflowname));
136-
$this->execute('behat_general::click_link', $this->escape($discussionname));
132+
public function i_navigate_as_user_to_the_discussion(string $user, string $course, string $moodleoverflow,
133+
string $discussion): void {
134+
$this->execute('behat_auth::i_log_in_as', $user);
135+
$this->execute('behat_navigation::i_am_on_course_homepage', $course);
136+
$this->execute('behat_general::click_link', $this->escape($moodleoverflow));
137+
$this->execute('behat_general::click_link', $this->escape($discussion));
137138
}
138139

139140
/**
@@ -148,7 +149,7 @@ public function i_try_to_delete_moodleoverflow_post(string $postmessage): void {
148149
// Find the div containing the post message and click the delete link within it.
149150
$this->execute('behat_general::i_click_on', [
150151
"//div[contains(@class, 'moodleoverflowpost')][contains(., '" . $this->escape($postmessage) . "')]//a[text()='Delete']",
151-
"xpath_element"
152+
"xpath_element",
152153
]);
153154
$this->execute('behat_general::i_click_on', ['Continue', 'button']);
154155
}
@@ -164,8 +165,9 @@ public function i_try_to_delete_moodleoverflow_post(string $postmessage): void {
164165
*/
165166
public function i_comment_moodleoverflow_post_with_message(string $postmessage, string $replymessage): void {
166167
$this->execute('behat_general::i_click_on', [
167-
"//div[contains(@class, 'moodleoverflowpost')][contains(., '" . $this->escape($postmessage) . "')]//a[text()='Comment']",
168-
"xpath_element"
168+
"//div[contains(@class, 'moodleoverflowpost')][contains(., '" . $this->escape($postmessage) .
169+
"')]//a[text()='Comment']",
170+
"xpath_element",
169171
]);
170172
$table = new TableNode([
171173
['Message', $replymessage],

0 commit comments

Comments
 (0)