Skip to content

Commit

Permalink
MDL-41191 add more test data to trigger duplicate course records
Browse files Browse the repository at this point in the history
  • Loading branch information
danpoltawski committed Aug 21, 2013
1 parent a101c7f commit 72c2c0b
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion mod/forum/tests/lib_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,13 +99,25 @@ public function test_forum_get_courses_user_posted_in() {
$record->course = $course3->id;
$forum3 = $this->getDataGenerator()->create_module('forum', $record);

// Add discussions to course 1 and 2 started by user1.
// Add a second forum in course 1.
$record = new stdClass();
$record->course = $course1->id;
$forum4 = $this->getDataGenerator()->create_module('forum', $record);

// Add discussions to course 1 started by user1.
$record = new stdClass();
$record->course = $course1->id;
$record->userid = $user1->id;
$record->forum = $forum1->id;
$this->getDataGenerator()->get_plugin_generator('mod_forum')->create_discussion($record);

$record = new stdClass();
$record->course = $course1->id;
$record->userid = $user1->id;
$record->forum = $forum4->id;
$this->getDataGenerator()->get_plugin_generator('mod_forum')->create_discussion($record);

// Add discussions to course2 started by user1.
$record = new stdClass();
$record->course = $course2->id;
$record->userid = $user1->id;
Expand Down

0 comments on commit 72c2c0b

Please sign in to comment.