Skip to content

Commit

Permalink
Merge branch 'MDL-79291' of https://github.com/paulholden/moodle
Browse files Browse the repository at this point in the history
  • Loading branch information
junpataleta authored and ilyatregubov committed Sep 15, 2023
2 parents fb56acd + c7d08f8 commit ced2753
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions h5p/tests/generator/lib.php
Expand Up @@ -400,19 +400,24 @@ public function create_library_dependency_record(int $libid, int $requiredlibid,
* @param array $typestonotinstall H5P content types that should not be installed
* @param core $core h5p_test_core instance required to use the exttests URL
* @return array Data of the content types not installed.
*
* @throws invalid_response_exception If request to get the latest content types fails (usually due to a transient error)
*/
public function create_content_types(array $typestonotinstall, core $core): array {
global $DB;

autoloader::register();

// Get info of latest content types versions.
$contenttypes = $core->get_latest_content_types()->contentTypes;
$response = $core->get_latest_content_types();
if (!empty($response->error)) {
throw new invalid_response_exception($response->error);
}

$installedtypes = 0;

// Fake installation of all other H5P content types.
foreach ($contenttypes as $contenttype) {
foreach ($response->contentTypes as $contenttype) {
// Don't install pending content types.
if (in_array($contenttype->id, $typestonotinstall)) {
continue;
Expand Down

0 comments on commit ced2753

Please sign in to comment.