diff options
author | Morris Jobke <hey@morrisjobke.de> | 2020-09-09 17:35:13 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-09 17:35:13 +0200 |
commit | 22ff60e088379335734bc28f2d1af6e920e204e6 (patch) | |
tree | 1e3710747a216950d8ec41ba020f465a694d886a /tests | |
parent | 49415eea2c75a769a558667abc2ca7461cf8c8b0 (diff) | |
parent | c2bef528efe34c50425fe4415e826929b1f78530 (diff) | |
download | nextcloud-server-22ff60e088379335734bc28f2d1af6e920e204e6.tar.gz nextcloud-server-22ff60e088379335734bc28f2d1af6e920e204e6.zip |
Merge pull request #22564 from nextcloud/bugfix/noid/show-avatars-again
The privacy setting is only about syncing to other servers
Diffstat (limited to 'tests')
-rw-r--r-- | tests/Core/Controller/AvatarControllerTest.php | 43 |
1 files changed, 1 insertions, 42 deletions
diff --git a/tests/Core/Controller/AvatarControllerTest.php b/tests/Core/Controller/AvatarControllerTest.php index f070897e1b1..61f509b7428 100644 --- a/tests/Core/Controller/AvatarControllerTest.php +++ b/tests/Core/Controller/AvatarControllerTest.php @@ -33,9 +33,6 @@ namespace Tests\Core\Controller; use OC\AppFramework\Utility\TimeFactory; use OC\Core\Controller\AvatarController; -use OCP\Accounts\IAccount; -use OCP\Accounts\IAccountManager; -use OCP\Accounts\IAccountProperty; use OCP\AppFramework\Http; use OCP\Files\File; use OCP\Files\IRootFolder; @@ -49,7 +46,6 @@ use OCP\ILogger; use OCP\IRequest; use OCP\IUser; use OCP\IUserManager; -use PHPUnit\Framework\MockObject\MockObject; /** * Class AvatarControllerTest @@ -82,8 +78,6 @@ class AvatarControllerTest extends \Test\TestCase { private $request; /** @var TimeFactory|\PHPUnit\Framework\MockObject\MockObject */ private $timeFactory; - /** @var IAccountManager|MockObject */ - private $accountManager; protected function setUp(): void { parent::setUp(); @@ -98,7 +92,6 @@ class AvatarControllerTest extends \Test\TestCase { $this->rootFolder = $this->getMockBuilder('OCP\Files\IRootFolder')->getMock(); $this->logger = $this->getMockBuilder(ILogger::class)->getMock(); $this->timeFactory = $this->getMockBuilder('OC\AppFramework\Utility\TimeFactory')->getMock(); - $this->accountManager = $this->createMock(IAccountManager::class); $this->avatarMock = $this->getMockBuilder('OCP\IAvatar')->getMock(); $this->userMock = $this->getMockBuilder(IUser::class)->getMock(); @@ -113,8 +106,7 @@ class AvatarControllerTest extends \Test\TestCase { $this->rootFolder, $this->logger, 'userid', - $this->timeFactory, - $this->accountManager + $this->timeFactory ); // Configure userMock @@ -145,39 +137,6 @@ class AvatarControllerTest extends \Test\TestCase { $this->assertEquals(Http::STATUS_NOT_FOUND, $response->getStatus()); } - public function testAvatarNotPublic() { - $account = $this->createMock(IAccount::class); - $this->accountManager->method('getAccount') - ->with($this->userMock) - ->willReturn($account); - - $property = $this->createMock(IAccountProperty::class); - $account->method('getProperty') - ->with(IAccountManager::PROPERTY_AVATAR) - ->willReturn($property); - - $property->method('getScope') - ->willReturn(IAccountManager::VISIBILITY_PRIVATE); - - $controller = new AvatarController( - 'core', - $this->request, - $this->avatarManager, - $this->cache, - $this->l, - $this->userManager, - $this->rootFolder, - $this->logger, - null, - $this->timeFactory, - $this->accountManager - ); - - $result = $controller->getAvatar('userId', 128); - - $this->assertEquals(Http::STATUS_NOT_FOUND, $result->getStatus()); - } - /** * Fetch the user's avatar */ |