Skip to content

Commit

Permalink
MDL-43770 core_behat: Pass additional params to enrol_user generator
Browse files Browse the repository at this point in the history
Include timestart, timeend and status.
  • Loading branch information
tonyjbutler committed Mar 20, 2015
1 parent 799770c commit 2f29dd6
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion lib/tests/behat/behat_data_generators.php
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,18 @@ protected function process_enrol_user($data) {
$data['enrol'] = 'manual';
}

if (!isset($data['timestart'])) {
$data['timestart'] = 0;
}

if (!isset($data['timeend'])) {
$data['timeend'] = 0;
}

if (!isset($data['status'])) {
$data['status'] = null;
}

// If the provided course shortname is the site shortname we consider it a system role assign.
if ($data['courseid'] == $SITE->id) {
// Frontpage course assign.
Expand All @@ -360,7 +372,8 @@ protected function process_enrol_user($data) {

} else {
// Course assign.
$this->datagenerator->enrol_user($data['userid'], $data['courseid'], $data['roleid'], $data['enrol']);
$this->datagenerator->enrol_user($data['userid'], $data['courseid'], $data['roleid'], $data['enrol'],
$data['timestart'], $data['timeend'], $data['status']);
}

}
Expand Down

0 comments on commit 2f29dd6

Please sign in to comment.