Skip to content

Commit

Permalink
Merge branch 'MDL-76760-400' of https://github.com/paulholden/moodle
Browse files Browse the repository at this point in the history
…into MOODLE_400_STABLE
  • Loading branch information
sarjona committed Jan 2, 2023
2 parents fcfc240 + 5e80881 commit d066f50
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions admin/tool/behat/classes/external/get_entity_generator.php
Expand Up @@ -28,8 +28,6 @@
defined('MOODLE_INTERNAL') || die();

require_once($CFG->libdir . '/externallib.php');
require_once($CFG->dirroot . '/vendor/autoload.php'); // Ensure we can load Behat and Facebook namespaces in behat libraries.
require_once($CFG->libdir . '/tests/behat/behat_data_generators.php');

/**
* External function for getting properties of entity generators.
Expand Down Expand Up @@ -59,6 +57,12 @@ public static function execute_parameters(): \external_function_parameters {
* @return array
*/
public static function execute(string $entitytype): array {
global $CFG;

// Ensure we can load Behat and Facebook namespaces in behat libraries.
require_once("{$CFG->dirroot}/vendor/autoload.php");
require_once("{$CFG->libdir}/tests/behat/behat_data_generators.php");

$params = self::validate_parameters(self::execute_parameters(), ['entitytype' => $entitytype]);
$context = \context_system::instance();
self::validate_context($context);
Expand Down

0 comments on commit d066f50

Please sign in to comment.