Revert "MDL-37164 core_message: prevent users from interacting with themself"

Was breaking unit tests.

This reverts commit 61a73b43c1 and 7bb19ee167.
This commit is contained in:
Dan Poltawski
2013-02-05 14:42:20 +08:00
parent 61a73b43c1
commit 751f00a0bb
3 changed files with 17 additions and 31 deletions
+3 -2
View File
@@ -351,11 +351,12 @@ 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);
// Should return the 4 users created above with the letter 'r' in name and the admin [admin useR].
$this->assertCount(4 + 1, $results);
$this->assertCount(4 + 2, $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);