Skip to content

Commit

Permalink
Merge branch 'MDL-79148-402' of https://github.com/ssj365/moodle into…
Browse files Browse the repository at this point in the history
… MOODLE_402_STABLE
  • Loading branch information
junpataleta committed Nov 29, 2023
2 parents 95981fe + 0240b8f commit b8f71fe
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 4 deletions.
4 changes: 0 additions & 4 deletions mod/bigbluebuttonbn/classes/output/recording_row_playback.php
Expand Up @@ -108,10 +108,6 @@ protected function should_be_included(array $playback): bool {
return true;
}

// Exclude imported recordings.
if ($this->recording->get('imported')) {
return false;
}
$canmanagerecordings = roles::has_capability_in_course(
$this->recording->get('courseid'), 'mod/bigbluebuttonbn:managerecordings');
$canviewallformats = roles::has_capability_in_course(
Expand Down
35 changes: 35 additions & 0 deletions mod/bigbluebuttonbn/tests/output/recording_row_playback_test.php
Expand Up @@ -148,4 +148,39 @@ public function should_be_included_data_provider() {

];
}

/**
* Test recording link is rendered for imported recordings.
*
* @return void
* @covers \recording_row_playback::should_be_included
*/
public function test_show_recording_links(): void {
global $PAGE;
$this->resetAfterTest();
set_config('bigbluebuttonbn_importrecordings_enabled', 1);
$plugingenerator = $this->getDataGenerator()->get_plugin_generator('mod_bigbluebuttonbn');
['recordings' => $recordingsdata, 'activity' => $activity] = $this->create_activity_with_recordings(
$this->get_course(),
instance::TYPE_ALL,
self::RECORDING_DATA
);
$recording = new recording(0, $recordingsdata[0]);
$instance = instance::get_from_instanceid($activity->id);
// Now create a new activity and import the recording.
$newactivity = $plugingenerator->create_instance([
'course' => $instance->get_course_id(),
'type' => instance::TYPE_ALL,
'name' => 'Example 2',
]);
$plugingenerator->create_meeting([
'instanceid' => $newactivity->id,
]);
$newinstance = instance::get_from_instanceid($newactivity->id);
// Import recording into new instance.
$importedrecording = $recording->create_imported_recording($newinstance);
$importedrowplayback = new recording_row_playback($importedrecording, $newinstance);
$importedrowinfo = $importedrowplayback->export_for_template($PAGE->get_renderer('mod_bigbluebuttonbn'));
$this->assertNotEmpty($importedrowinfo->playbacks);
}
}

0 comments on commit b8f71fe

Please sign in to comment.