Skip to content

Commit

Permalink
modify behat steps
Browse files Browse the repository at this point in the history
  • Loading branch information
irinahpe committed Jun 3, 2024
1 parent 980a5fd commit 3179a02
Showing 1 changed file with 5 additions and 15 deletions.
20 changes: 5 additions & 15 deletions tests/behat/behat_mod_ratingallocate.php
Original file line number Diff line number Diff line change
Expand Up @@ -602,20 +602,11 @@ public function i_add_a_ratingallocate_to_course_section_and_fill_form($coursesh
);
} else {
// This is the code from the deprecated behat function "i_add_to_section_and_i_fill_the_form_with".
// Add activity to section.
// Add activity to section and fill form.
$this->execute(
"behat_course::i_add_to_section",
[$this->escape('ratingallocate'), $this->escape($sectionnumber)]
"behat_course::i_add_to_section_and_i_fill_the_form_with",
[$this->escape('ratingallocate'), $this->escape($sectionnumber), $data]
);

// Wait to be redirected.
$this->execute('behat_general::wait_until_the_page_is_ready');

// Set form fields.
$this->execute("behat_forms::i_set_the_following_fields_to_these_values", $data);

// Save course settings.
$this->execute("behat_forms::press_button", get_string('savechangesandreturntocourse'));
}
}

Expand All @@ -625,16 +616,15 @@ public function i_add_a_ratingallocate_to_course_section_and_fill_form($coursesh
* @Given I add a ratingallocate to course :coursefullname section :sectionnum
* @param $courseshortname
* @param $sectionnumber
* @param $data
* @return void
*/
public function i_add_a_ratingallocate_to_course_section($courseshortname, $sectionnumber, TableNode $data) {
public function i_add_a_ratingallocate_to_course_section($courseshortname, $sectionnumber) {
global $CFG;

if ($CFG->branch >= 404) {
$this->execute(
"behat_course::i_add_to_course_section",
[$this->escape('ratingallocate'), $this->escape($courseshortname), $this->escape($sectionnumber), $data]
[$this->escape('ratingallocate'), $this->escape($courseshortname), $this->escape($sectionnumber)]
);
} else {
// This is the code from the deprecated behat function "i_add_to_section".
Expand Down

0 comments on commit 3179a02

Please sign in to comment.