mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 00:46:50 +02:00
MDL-58265 core_test: add I am on course page behat step
Part of MDL-55611 epic.
This commit is contained in:
parent
99f38abb40
commit
95f11fde64
1 changed files with 16 additions and 0 deletions
|
@ -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()));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue