forked from moodle/moodle
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MDL-80790 mod_bigbluebuttonbn: Trigger callback when guest added
- Loading branch information
1 parent
3d30372
commit 57f1fed
Showing
4 changed files
with
85 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
mod/bigbluebuttonbn/tests/fixtures/extension/simple/lib.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<?php | ||
// This file is part of Moodle - http://moodle.org/ | ||
// | ||
// Moodle is free software: you can redistribute it and/or modify | ||
// it under the terms of the GNU General Public License as published by | ||
// the Free Software Foundation, either version 3 of the License, or | ||
// (at your option) any later version. | ||
// | ||
// Moodle is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
// GNU General Public License for more details. | ||
// | ||
// You should have received a copy of the GNU General Public License | ||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
/** | ||
* Library calls for the simple extension. | ||
* | ||
* @package mod_bigbluebuttonbn | ||
* @copyright 2023 onwards, Blindside Networks Inc | ||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later | ||
* @author Laurent David (laurent [at] call-learning [dt] fr) | ||
*/ | ||
|
||
/** | ||
* Get the list of emails to add to the meeting | ||
* | ||
* This is a dummy callback used to demonstrate how to add a new setting to the BigBlueButtonBN settings page. | ||
* | ||
* @param array $emails | ||
* @param int $instanceid | ||
* @return void | ||
*/ | ||
function bbbext_simple_meeting_add_guests(array $emails, int $instanceid): void { | ||
set_config('bbbext_simple_meeting_add_guests', join(",", $emails), 'bbbext_simple'); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -297,4 +297,17 @@ private function enable_plugins(bool $bbbenabled) { | |
set_config('disabled', 'disabled', $plugin); | ||
} | ||
} | ||
|
||
/** | ||
* Test that extension has been notified that a guest has been added | ||
* @covers \mod_bigbluebuttonbn\instance::add_guests | ||
*/ | ||
public function test_extension_guest_emails_callback(): void { | ||
$this->resetAfterTest(); | ||
list($bbactivitycontext, $bbactivitycm, $bbactivity) = $this->create_instance(); | ||
$instance = instance::get_from_instanceid($bbactivity->id); | ||
$emails = ['[email protected]', '[email protected]']; | ||
$instance->add_guests($emails); | ||
$this->assertEquals(join(',', $emails), get_config('bbbext_simple', 'bbbext_simple_meeting_add_guests')); | ||
} | ||
} |