MDL-65965 behat: Do not fetch grouping IDs for empty grouping idnumbers
This commit is contained in:
@@ -806,6 +806,11 @@ class behat_data_generators extends behat_base {
|
||||
protected function get_grouping_id($idnumber) {
|
||||
global $DB;
|
||||
|
||||
// Do not fetch grouping ID for empty grouping idnumber.
|
||||
if (empty($idnumber)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (!$id = $DB->get_field('groupings', 'id', array('idnumber' => $idnumber))) {
|
||||
throw new Exception('The specified grouping with idnumber "' . $idnumber . '" does not exist');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user