mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 16:36:37 +02:00
Merge branch 'MDL-76760' of https://github.com/paulholden/moodle
This commit is contained in:
commit
6821897849
1 changed files with 6 additions and 2 deletions
|
@ -28,8 +28,6 @@ namespace tool_behat\external;
|
||||||
defined('MOODLE_INTERNAL') || die();
|
defined('MOODLE_INTERNAL') || die();
|
||||||
|
|
||||||
require_once($CFG->libdir . '/externallib.php');
|
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.
|
* External function for getting properties of entity generators.
|
||||||
|
@ -59,6 +57,12 @@ class get_entity_generator extends \external_api {
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
public static function execute(string $entitytype): 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]);
|
$params = self::validate_parameters(self::execute_parameters(), ['entitytype' => $entitytype]);
|
||||||
$context = \context_system::instance();
|
$context = \context_system::instance();
|
||||||
self::validate_context($context);
|
self::validate_context($context);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue