Skip to content

Commit

Permalink
MSFTMPP-647: Fix unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesmcq committed Oct 31, 2017
1 parent af91017 commit 6f1865c
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion local/o365/tests/coursegroups_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ public function test_resync_group_membership() {
$this->getDataGenerator()->create_user(),
];

// Create tokens for users.
// Create tokens and objects for users.
foreach ($users as $i => $user) {
$tokenrec = [
'oidcuniqid' => 'user'.$i,
Expand All @@ -172,6 +172,16 @@ public function test_resync_group_membership() {
'expiry' => time() + 9999,
];
$tokenrec['id'] = $DB->insert_record('auth_oidc_token', (object)$tokenrec);

$objectrec = [
'moodleid' => $user->id,
'type' => 'user',
'objectid' => 'user'.$i,
'o365name' => 'testuser'.$i.'@example.onmicrosoft.com',
'timecreated' => time(),
'timemodified' => time(),
];
$objectrec['id'] = $DB->insert_record('local_o365_objects', (object)$objectrec);
}

// Enrol users.
Expand Down

0 comments on commit 6f1865c

Please sign in to comment.