summaryrefslogtreecommitdiffstats
path: root/tests/lib/AvatarManagerTest.php
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2016-10-04 12:28:41 +0200
committerLukas Reschke <lukas@statuscode.ch>2016-11-02 22:21:46 +0100
commitf737426eca338dbc65db6210a09f3034d372701b (patch)
tree10fbeb022517900955aff8a69e571652ee48d073 /tests/lib/AvatarManagerTest.php
parentc1feae1684934bb52b1edaa67d33d01b377b875a (diff)
downloadnextcloud-server-f737426eca338dbc65db6210a09f3034d372701b.tar.gz
nextcloud-server-f737426eca338dbc65db6210a09f3034d372701b.zip
Add using casing check/fix for initMountPoints
Diffstat (limited to 'tests/lib/AvatarManagerTest.php')
-rw-r--r--tests/lib/AvatarManagerTest.php26
1 files changed, 24 insertions, 2 deletions
diff --git a/tests/lib/AvatarManagerTest.php b/tests/lib/AvatarManagerTest.php
index 8ccc51d12e0..83a5cfd9b30 100644
--- a/tests/lib/AvatarManagerTest.php
+++ b/tests/lib/AvatarManagerTest.php
@@ -26,6 +26,7 @@ namespace Test;
use OC\Avatar;
use OC\AvatarManager;
+use OC\Files\AppData\AppData;
use OCP\Files\IAppData;
use OCP\Files\SimpleFS\ISimpleFolder;
use OCP\IConfig;
@@ -48,7 +49,7 @@ class AvatarManagerTest extends \Test\TestCase {
private $logger;
/** @var IConfig|\PHPUnit_Framework_MockObject_MockObject */
private $config;
- /** @var AvatarManager */
+ /** @var AvatarManager | \PHPUnit_Framework_MockObject_MockObject */
private $avatarManager;
public function setUp() {
@@ -101,8 +102,29 @@ class AvatarManagerTest extends \Test\TestCase {
->with('valid-user')
->willReturn($folder);
- $expected = new Avatar($folder, $this->l10n, $user, $this->logger, $this->config);;
+ $expected = new Avatar($folder, $this->l10n, $user, $this->logger, $this->config);
$this->assertEquals($expected, $this->avatarManager->getAvatar('valid-user'));
}
+ public function testGetAvatarValidUserDifferentCasing() {
+ $user = $this->createMock(IUser::class);
+ $this->userManager->expects($this->once())
+ ->method('get')
+ ->with('vaLid-USER')
+ ->willReturn($user);
+
+ $user->expects($this->once())
+ ->method('getUID')
+ ->willReturn('valid-user');
+
+ $folder = $this->createMock(ISimpleFolder::class);
+ $this->appData
+ ->expects($this->once())
+ ->method('getFolder')
+ ->with('valid-user')
+ ->willReturn($folder);
+
+ $expected = new Avatar($folder, $this->l10n, $user, $this->logger, $this->config);
+ $this->assertEquals($expected, $this->avatarManager->getAvatar('vaLid-USER'));
+ }
}