mirror of
https://github.com/moodle/moodle.git
synced 2025-08-09 02:46:40 +02:00
MDL-67707 core_h5p: add public H5P player methods
This commit is contained in:
parent
1e7e255d72
commit
f3c7e00f13
4 changed files with 69 additions and 8 deletions
|
@ -41,14 +41,14 @@ class helper_testcase extends \advanced_testcase {
|
|||
/**
|
||||
* Test the behaviour of get_display_options().
|
||||
*
|
||||
* @dataProvider get_display_options_provider
|
||||
* @dataProvider display_options_provider
|
||||
* @param bool $frame Whether the frame should be displayed or not
|
||||
* @param bool $export Whether the export action button should be displayed or not
|
||||
* @param bool $embed Whether the embed action button should be displayed or not
|
||||
* @param bool $copyright Whether the copyright action button should be displayed or not
|
||||
* @param int $expected The expectation with the displayoptions value
|
||||
*/
|
||||
public function test_get_display_options(bool $frame, bool $export, bool $embed, bool $copyright, int $expected): void {
|
||||
public function test_display_options(bool $frame, bool $export, bool $embed, bool $copyright, int $expected): void {
|
||||
$this->setRunTestInSeparateProcess(true);
|
||||
$this->resetAfterTest();
|
||||
|
||||
|
@ -60,9 +60,16 @@ class helper_testcase extends \advanced_testcase {
|
|||
'embed' => $embed,
|
||||
'copyright' => $copyright,
|
||||
];
|
||||
$displayoptions = helper::get_display_options($core, $config);
|
||||
|
||||
// Test getting display options.
|
||||
$displayoptions = helper::get_display_options($core, $config);
|
||||
$this->assertEquals($expected, $displayoptions);
|
||||
|
||||
// Test decoding display options.
|
||||
$decoded = helper::decode_display_options($core, $expected);
|
||||
$this->assertEquals($decoded->export, $config->export);
|
||||
$this->assertEquals($decoded->embed, $config->embed);
|
||||
$this->assertEquals($decoded->copyright, $config->copyright);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -70,7 +77,7 @@ class helper_testcase extends \advanced_testcase {
|
|||
*
|
||||
* @return array
|
||||
*/
|
||||
public function get_display_options_provider(): array {
|
||||
public function display_options_provider(): array {
|
||||
return [
|
||||
'All display options disabled' => [
|
||||
false,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue