From c7b706186c938fe33f5e0f2a9c201304a3f96862 Mon Sep 17 00:00:00 2001 From: Laurent David Date: Thu, 6 Jan 2022 20:13:41 +0100 Subject: [PATCH] MDL-73511 mod_bigbluebuttonbn: exception raised when editing activity * When editing an activity and the voicebridge_editable is set, there is an exception raised --- mod/bigbluebuttonbn/mod_form.php | 4 +-- .../tests/behat/edit_instance.feature | 30 +++++++++++++++++++ 2 files changed, 32 insertions(+), 2 deletions(-) create mode 100644 mod/bigbluebuttonbn/tests/behat/edit_instance.feature diff --git a/mod/bigbluebuttonbn/mod_form.php b/mod/bigbluebuttonbn/mod_form.php index a3210b7ae773c..86445265444dd 100644 --- a/mod/bigbluebuttonbn/mod_form.php +++ b/mod/bigbluebuttonbn/mod_form.php @@ -667,12 +667,12 @@ private function bigbluebuttonbn_mform_add_block_schedule(MoodleQuickForm &$mfor * @param string|null $descriptionkey * @param mixed|null $defaultvalue * @param array|null $options - * @param string|null $rule + * @param array|null $rule * @return void * @throws coding_exception */ private function bigbluebuttonbn_mform_add_element(MoodleQuickForm &$mform, string $type, string $name, ?string $datatype, - ?string $descriptionkey = "", $defaultvalue = null, ?array $options = null, ?string $rule = null): void { + ?string $descriptionkey = "", $defaultvalue = null, ?array $options = null, ?array $rule = null): void { $datatype = $datatype ?? 'hidden'; if ($type === 'hidden' || $type === 'static') { $mform->addElement($type, $name, $defaultvalue); diff --git a/mod/bigbluebuttonbn/tests/behat/edit_instance.feature b/mod/bigbluebuttonbn/tests/behat/edit_instance.feature new file mode 100644 index 0000000000000..f2a577fcd2f11 --- /dev/null +++ b/mod/bigbluebuttonbn/tests/behat/edit_instance.feature @@ -0,0 +1,30 @@ +@mod @mod_bigbluebuttonbn @javascript +Feature: I can edit a bigbluebutton instance +When a bibluebutton instance has been created I can edit it + + Background: Make sure that a course is created + Given a BigBlueButton mock server is configured + And the following config values are set as admin: + | bigbluebuttonbn_voicebridge_editable | 1 | + And the following "courses" exist: + | fullname | shortname | category | + | Test course | Test course | 0 | + + Scenario Outline: Add a mod_bigbluebuttonbn instance with Room/Activity with recordings + Then I log in as "admin" + And I am on "Test course" course homepage with editing mode on + When I add a "BigBlueButton" to section "1" and I fill the form with: + | name | | + | Instance type | | + | Virtual classroom name | | + Given I am on the "" "bigbluebuttonbn activity" page logged in as admin + And I click on "Settings" "link" + And the field "Instance type" matches value "" + And I "Role assigned during live session" + And I expand all fieldsets + And I "Session can be recorded" + Examples: + | activityname | instancetype | shouldseerole | shouldseesession | + | Activity with recording | Room/Activity with recordings | should see | should see | + | Activity only | Room/Activity only | should see | should see | + | Recordings only | Recordings only | should not see | should not see |