summaryrefslogtreecommitdiffstats
path: root/tests/lib/Avatar/UserAvatarTest.php
diff options
context:
space:
mode:
authorCarl Schwan <carl@carlschwan.eu>2022-06-22 12:05:26 +0200
committerCarl Schwan <carl@carlschwan.eu>2022-06-22 16:11:42 +0200
commit812016d62614ac3669a3fdf51fa2e07170e08c08 (patch)
tree1d67fcb259fae084881e50741ea6d7a5beb3e648 /tests/lib/Avatar/UserAvatarTest.php
parentb282fe1e6f5587a6440d170df245ad5acb8dc976 (diff)
downloadnextcloud-server-812016d62614ac3669a3fdf51fa2e07170e08c08.tar.gz
nextcloud-server-812016d62614ac3669a3fdf51fa2e07170e08c08.zip
Cleanup avatar related code
- Move event listener to new event handling - Add typing almost everywhere - Fix inconsistent interface parameter Signed-off-by: Carl Schwan <carl@carlschwan.eu>
Diffstat (limited to 'tests/lib/Avatar/UserAvatarTest.php')
-rw-r--r--tests/lib/Avatar/UserAvatarTest.php10
1 files changed, 5 insertions, 5 deletions
diff --git a/tests/lib/Avatar/UserAvatarTest.php b/tests/lib/Avatar/UserAvatarTest.php
index dd5f25163f2..bd45a819760 100644
--- a/tests/lib/Avatar/UserAvatarTest.php
+++ b/tests/lib/Avatar/UserAvatarTest.php
@@ -57,7 +57,7 @@ class UserAvatarTest extends \Test\TestCase {
->willReturn($file);
$this->folder->method('getFile')
- ->willReturnCallback(function ($path) {
+ ->willReturnCallback(function (string $path) {
if ($path === 'avatar.64.png') {
throw new NotFoundException();
}
@@ -96,7 +96,7 @@ class UserAvatarTest extends \Test\TestCase {
$expected = new \OC_Image();
$expected->loadFromFile(\OC::$SERVERROOT . '/tests/data/testavatar.png');
- $file = $this->createMock(File::class);
+ $file = $this->createMock(ISimpleFile::class);
$file->method('getContent')->willReturn($expected->data());
$this->folder->method('getFile')->with('avatar.128.jpg')->willReturn($file);
@@ -112,7 +112,7 @@ class UserAvatarTest extends \Test\TestCase {
$expected = new \OC_Image();
$expected->loadFromFile(\OC::$SERVERROOT . '/tests/data/testavatar.png');
- $file = $this->createMock(File::class);
+ $file = $this->createMock(ISimpleFile::class);
$file->method('getContent')->willReturn($expected->data());
$this->folder->method('getFile')->with('avatar.jpg')->willReturn($file);
@@ -132,7 +132,7 @@ class UserAvatarTest extends \Test\TestCase {
$expected2->loadFromFile(\OC::$SERVERROOT . '/tests/data/testavatar.png');
$expected2->resize(32);
- $file = $this->createMock(File::class);
+ $file = $this->createMock(ISimpleFile::class);
$file->method('getContent')->willReturn($expected->data());
$this->folder->method('getFile')
@@ -146,7 +146,7 @@ class UserAvatarTest extends \Test\TestCase {
}
);
- $newFile = $this->createMock(File::class);
+ $newFile = $this->createMock(ISimpleFile::class);
$newFile->expects($this->once())
->method('putContent')
->with($expected2->data());