Merge branch 'MDL-67995-38' of git://github.com/cescobedo/moodle into MOODLE_38_STABLE
This commit is contained in:
@@ -154,9 +154,9 @@ class format_singleactivity extends format_base {
|
||||
|
||||
if ($fetchtypes) {
|
||||
$availabletypes = $this->get_supported_activities();
|
||||
if ($this->course) {
|
||||
if ($this->courseid) {
|
||||
// The course exists. Test against the course.
|
||||
$testcontext = context_course::instance($this->course->id);
|
||||
$testcontext = context_course::instance($this->courseid);
|
||||
} else if ($this->categoryid) {
|
||||
// The course does not exist yet, but we have a category ID that we can test against.
|
||||
$testcontext = context_coursecat::instance($this->categoryid);
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
@format @format_singleactivity
|
||||
Feature: Edit format course to Single Activity format
|
||||
In order to set the format course to single activity course
|
||||
As a teacher
|
||||
I need to edit the course settings and see the dropdown type activity
|
||||
|
||||
Scenario: Edit a format course as a teacher
|
||||
Given the following "users" exist:
|
||||
| username | firstname | lastname | email |
|
||||
| teacher1 | Teacher | 1 | teacher1@example.com |
|
||||
And the following "courses" exist:
|
||||
| fullname | shortname | summary | format |
|
||||
| Course 1 | C1 | <p>Course summary</p> | topics |
|
||||
And the following "course enrolments" exist:
|
||||
| user | course | role |
|
||||
| teacher1 | C1 | editingteacher |
|
||||
And I log in as "teacher1"
|
||||
And I am on "Course 1" course homepage
|
||||
When I navigate to "Edit settings" in current page administration
|
||||
And I set the following fields to these values:
|
||||
| Course full name | My first course |
|
||||
| Course short name | myfirstcourse |
|
||||
| Format | Single activity format |
|
||||
And I press "Update format"
|
||||
Then I should see "Forum" in the "Type of activity" "field"
|
||||
And I press "Save and display"
|
||||
And I should see "Adding a new Forum"
|
||||
Reference in New Issue
Block a user