MDL-37164 message - fix broken unit tests
authorDan Poltawski <dan@moodle.com>
Tue, 5 Feb 2013 06:26:19 +0000 (14:26 +0800)
committerDan Poltawski <dan@moodle.com>
Tue, 5 Feb 2013 06:27:20 +0000 (14:27 +0800)
We have fixed the returning of the guest user now

message/tests/externallib_test.php

index 9834769..a1c0264 100644 (file)
@@ -351,12 +351,11 @@ class core_message_external_testcase extends externallib_advanced_testcase {
         $user5 = self::getDataGenerator()->create_user($user5);
         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);
         $results = core_message_external::search_contacts('r');
         $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 = external_api::clean_returnvalue(core_message_external::search_contacts_returns(), $results);
         $this->assertCount(2, $results);