MDL-39702 generators: Adding MOODLE_INTERNAL

As discussed generators should include MOODLE_INTERNAL
as they make use of CFG and they don't make sense without
requiring config.php.
This commit is contained in:
David Monllao
2013-05-28 11:10:35 +08:00
committed by Damyon Wiese
parent 799dbbfbaa
commit a13cbfb3e7
6 changed files with 9 additions and 1 deletions
@@ -23,6 +23,7 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
/**
* Block generator base class.
@@ -23,6 +23,7 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
/**
* Component generator base class.
+1
View File
@@ -23,6 +23,7 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
/**
* Data generator class for unit tests and other tools that need to create fake test sites.
@@ -23,6 +23,7 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
/**
* Module generator base class.
@@ -23,6 +23,8 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
/**
* Repository data generator class
*
+3 -1
View File
@@ -26,7 +26,6 @@
// NOTE: no MOODLE_INTERNAL test here, this file may be required by behat before including /config.php.
require_once(__DIR__ . '/../../behat/behat_base.php');
require_once(__DIR__ . '/../../testing/generator/lib.php');
use Behat\Gherkin\Node\TableNode as TableNode;
use Behat\Behat\Exception\PendingException as PendingException;
@@ -127,6 +126,9 @@ class behat_data_generators extends behat_base {
*/
public function the_following_exists($elementname, TableNode $data) {
// Now that we need them require the data generators.
require_once(__DIR__ . '/../../testing/generator/lib.php');
if (empty(self::$elements[$elementname])) {
throw new PendingException($elementname . ' data generator is not implemented');
}