mirror of
https://github.com/moodle/moodle.git
synced 2025-08-10 03:16:42 +02:00
MDL-82260 course: add behat section settings page url
This commit is contained in:
parent
1a33da6637
commit
c87e52f577
1 changed files with 5 additions and 1 deletions
|
@ -178,7 +178,11 @@ class behat_course extends behat_base {
|
||||||
*/
|
*/
|
||||||
protected function resolve_page_instance_url(string $type, string $identifier): moodle_url {
|
protected function resolve_page_instance_url(string $type, string $identifier): moodle_url {
|
||||||
$type = strtolower($type);
|
$type = strtolower($type);
|
||||||
|
|
||||||
|
$sectionpage = 'section.php';
|
||||||
switch ($type) {
|
switch ($type) {
|
||||||
|
case 'section settings':
|
||||||
|
$sectionpage = 'editsection.php';
|
||||||
case 'section':
|
case 'section':
|
||||||
$identifiers = explode('>', $identifier);
|
$identifiers = explode('>', $identifier);
|
||||||
$identifiers = array_map('trim', $identifiers);
|
$identifiers = array_map('trim', $identifiers);
|
||||||
|
@ -196,7 +200,7 @@ class behat_course extends behat_base {
|
||||||
if (!$section) {
|
if (!$section) {
|
||||||
throw new Exception("The specified section $identifier does not exist.");
|
throw new Exception("The specified section $identifier does not exist.");
|
||||||
}
|
}
|
||||||
return new moodle_url('/course/section.php', ['id' => $section->id]);
|
return new moodle_url('/course/' . $sectionpage, ['id' => $section->id]);
|
||||||
}
|
}
|
||||||
throw new Exception('Unrecognised core page type "' . $type . '."');
|
throw new Exception('Unrecognised core page type "' . $type . '."');
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue