Skip to content

Commit

Permalink
MDL-37164 message - fix broken unit tests
Browse files Browse the repository at this point in the history
We have fixed the returning of the guest user now
  • Loading branch information
danpoltawski committed Feb 5, 2013
1 parent 4c5dc0e commit 61a73b4
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions message/tests/externallib_test.php
Expand Up @@ -351,12 +351,11 @@ public function test_search_contacts() {
$user5 = self::getDataGenerator()->create_user($user5); $user5 = self::getDataGenerator()->create_user($user5);
self::getDataGenerator()->enrol_user($user5->id, $course2->id); self::getDataGenerator()->enrol_user($user5->id, $course2->id);


// Searching for users, keep in mind that 'Admin User' and 'Guest user' can be returned for now.
// See MDL-37164 which should fix that. Once fixed, remove the +2's.
$this->setUser($user1); $this->setUser($user1);
$results = core_message_external::search_contacts('r'); $results = core_message_external::search_contacts('r');
$results = external_api::clean_returnvalue(core_message_external::search_contacts_returns(), $results); $results = external_api::clean_returnvalue(core_message_external::search_contacts_returns(), $results);
$this->assertCount(4 + 2, $results); // Should return the 4 users created above with the letter 'r' in name and the admin [admin useR].
$this->assertCount(4 + 1, $results);
$results = core_message_external::search_contacts('r', true); $results = core_message_external::search_contacts('r', true);
$results = external_api::clean_returnvalue(core_message_external::search_contacts_returns(), $results); $results = external_api::clean_returnvalue(core_message_external::search_contacts_returns(), $results);
$this->assertCount(2, $results); $this->assertCount(2, $results);
Expand Down

0 comments on commit 61a73b4

Please sign in to comment.