MDL-58265 core_test: add I am on course page behat step

Part of MDL-55611 epic.
This commit is contained in:
Simey Lameze 2017-03-14 12:44:23 +08:00 committed by Damyon Wiese
parent 99f38abb40
commit 95f11fde64

View file

@ -574,4 +574,20 @@ class behat_navigation extends behat_base {
$USER = $globuser;
}
/**
* Opens the course page.
*
* @Given /^I am on course page "(?P<coursefullname_string>(?:[^"]|\\")*)"$/
* @throws coding_exception
* @param $coursefullname string The full name of the course.
* @return void
*/
public function i_am_on_course_page($coursefullname) {
global $DB;
$course = $DB->get_record("course", array("fullname" => $coursefullname), 'id', MUST_EXIST);
$url = new moodle_url('/course/view.php', ['id' => $course->id]);
$this->getSession()->visit($this->locate_path($url->out_as_local_url()));
}
}