Skip to content

Commit

Permalink
Merge branch 'MDL-49954-master' of git://github.com/jleyva/moodle
Browse files Browse the repository at this point in the history
  • Loading branch information
David Monllao committed May 4, 2015
2 parents 9787c4c + 9a3f7a4 commit 119ff65
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions mod/forum/tests/externallib_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ public function test_mod_forum_get_forum_discussions() {

// Create what we expect to be returned when querying the forums.
$expecteddiscussions = array();
$expecteddiscussions[$discussion1->id] = array(
$expecteddiscussions[] = array(
'id' => $discussion1->id,
'course' => $discussion1->course,
'forum' => $discussion1->forum,
Expand All @@ -305,7 +305,7 @@ public function test_mod_forum_get_forum_discussions() {
'lastuserpicture' => $user4->picture,
'lastuseremail' => $user4->email
);
$expecteddiscussions[$discussion2->id] = array(
$expecteddiscussions[] = array(
'id' => $discussion2->id,
'course' => $discussion2->course,
'forum' => $discussion2->forum,
Expand Down Expand Up @@ -335,7 +335,7 @@ public function test_mod_forum_get_forum_discussions() {

// Call the external function passing forum ids.
$discussions = mod_forum_external::get_forum_discussions(array($forum1->id, $forum2->id));
external_api::clean_returnvalue(mod_forum_external::get_forum_discussions_returns(), $discussions);
$discussions = external_api::clean_returnvalue(mod_forum_external::get_forum_discussions_returns(), $discussions);
$this->assertEquals($expecteddiscussions, $discussions);
// Some debugging is going to be produced, this is because we switch PAGE contexts in the get_forum_discussions function,
// the switch happens when the validate_context function is called inside a foreach loop.
Expand Down

0 comments on commit 119ff65

Please sign in to comment.