Skip to content

Commit

Permalink
Merge branch 'MDL-77461-311' of https://github.com/andrewnicols/moodle
Browse files Browse the repository at this point in the history
…into MOODLE_311_STABLE
  • Loading branch information
snake committed Mar 2, 2023
2 parents 430b3e7 + bc41f92 commit 51dae0b
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions lib/tests/behat/behat_navigation.php
Expand Up @@ -734,8 +734,6 @@ protected function resolve_core_page_url(string $name): moodle_url {
* @throws Exception with a meaningful error message if the specified page cannot be found.
*/
protected function resolve_core_page_instance_url(string $type, string $identifier): moodle_url {
global $DB;

$type = strtolower($type);

switch ($type) {
Expand Down Expand Up @@ -819,9 +817,8 @@ protected function resolve_core_page_instance_url(string $type, string $identifi
* @return void
*/
public function i_am_on_course_homepage($coursefullname) {
global $DB;
$course = $DB->get_record("course", array("fullname" => $coursefullname), 'id', MUST_EXIST);
$url = new moodle_url('/course/view.php', ['id' => $course->id]);
$courseid = $this->get_course_id($coursefullname);
$url = new moodle_url('/course/view.php', ['id' => $courseid]);
$this->execute('behat_general::i_visit', [$url]);
}

Expand All @@ -834,10 +831,8 @@ public function i_am_on_course_homepage($coursefullname) {
* @return void
*/
public function i_am_on_course_homepage_with_editing_mode_on($coursefullname) {
global $DB;

$course = $DB->get_record("course", array("fullname" => $coursefullname), 'id', MUST_EXIST);
$url = new moodle_url('/course/view.php', ['id' => $course->id]);
$courseid = $this->get_course_id($coursefullname);
$url = new moodle_url('/course/view.php', ['id' => $courseid]);

if ($this->running_javascript() && $sesskey = $this->get_sesskey()) {
// Javascript is running so it is possible to grab the session ket and jump straight to editing mode.
Expand Down

0 comments on commit 51dae0b

Please sign in to comment.