Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2019-02-22 15:07:26 +0300
committerJulius Härtl <jus@bitgrid.net>2019-03-01 22:56:59 +0300
commit01b4db62fbc4230cff953a2385d305b149744b86 (patch)
tree788b5edf5acba069bd6996466ab9b1b30a6804d4 /tests/lib/TagsTest.php
parent55ae7fa2a48ce38e2807a40632f282740c0e8117 (diff)
Add dispatcher events to User and Group objects
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'tests/lib/TagsTest.php')
-rw-r--r--tests/lib/TagsTest.php12
1 files changed, 10 insertions, 2 deletions
diff --git a/tests/lib/TagsTest.php b/tests/lib/TagsTest.php
index ce26f6b4807..268521bed51 100644
--- a/tests/lib/TagsTest.php
+++ b/tests/lib/TagsTest.php
@@ -21,6 +21,7 @@
*/
namespace Test;
+use OCP\IUser;
use OCP\IUserSession;
/**
@@ -49,7 +50,9 @@ class TagsTest extends \Test\TestCase {
$userId = $this->getUniqueID('user_');
\OC::$server->getUserManager()->createUser($userId, 'pass');
\OC_User::setUserId($userId);
- $this->user = new \OC\User\User($userId, null);
+ $this->user = $this->createMock(IUser::class);
+ $this->user->method('getUID')
+ ->willReturn($userId);
$this->userSession = $this->createMock(IUserSession::class);
$this->userSession
->expects($this->any())
@@ -292,14 +295,19 @@ class TagsTest extends \Test\TestCase {
$tagger = $this->tagMgr->load('test');
$tagger->tagAs(1, $testTag);
+
$otherUserId = $this->getUniqueID('user2_');
+ $otherUser = $this->createMock(IUser::class);
+ $otherUser->method('getUID')
+ ->willReturn($otherUserId);
+
\OC::$server->getUserManager()->createUser($otherUserId, 'pass');
\OC_User::setUserId($otherUserId);
$otherUserSession = $this->createMock(IUserSession::class);
$otherUserSession
->expects($this->any())
->method('getUser')
- ->will($this->returnValue(new \OC\User\User($otherUserId, null)));
+ ->willReturn($otherUser);
$otherTagMgr = new \OC\TagManager($this->tagMapper, $otherUserSession);
$otherTagger = $otherTagMgr->load('test');