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
path: root/tests
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2015-02-25 19:20:26 +0300
committerVincent Petry <pvince81@owncloud.com>2015-02-25 22:54:40 +0300
commitb63a6a4fc4bdd0df7118f6478768cc3c3e552668 (patch)
tree64697960da72ad60c8d9beb8ad561bb8b9e7f230 /tests
parentbc1418156339d4e61fe81bd1474f91555432ca00 (diff)
Return null when requesting tags for null user
The TagManager->load() now returns null if the user is not authenticated instead of failing with an error. Backport of 9ee37169a6615e06c397e3b623ca55805aebcea3 from master
Diffstat (limited to 'tests')
-rw-r--r--tests/lib/tags.php10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/lib/tags.php b/tests/lib/tags.php
index 547cd302d5d..a50855c88f3 100644
--- a/tests/lib/tags.php
+++ b/tests/lib/tags.php
@@ -62,6 +62,16 @@ class Test_Tags extends \Test\TestCase {
parent::tearDown();
}
+ public function testTagManagerWithoutUserReturnsNull() {
+ $this->userSession = $this->getMock('\OCP\IUserSession');
+ $this->userSession
+ ->expects($this->any())
+ ->method('getUser')
+ ->will($this->returnValue(null));
+ $this->tagMgr = new OC\TagManager($this->tagMapper, $this->userSession);
+ $this->assertNull($this->tagMgr->load($this->objectType));
+ }
+
public function testInstantiateWithDefaults() {
$defaultTags = array('Friends', 'Family', 'Work', 'Other');