diff options
author | Carl Schwan <carl@carlschwan.eu> | 2022-06-22 13:05:26 +0300 |
---|---|---|
committer | Carl Schwan <carl@carlschwan.eu> | 2022-06-22 17:11:42 +0300 |
commit | 812016d62614ac3669a3fdf51fa2e07170e08c08 (patch) | |
tree | 1d67fcb259fae084881e50741ea6d7a5beb3e648 /tests | |
parent | b282fe1e6f5587a6440d170df245ad5acb8dc976 (diff) |
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')
-rw-r--r-- | tests/lib/Avatar/AvatarManagerTest.php | 6 | ||||
-rw-r--r-- | tests/lib/Avatar/UserAvatarTest.php | 10 |
2 files changed, 8 insertions, 8 deletions
diff --git a/tests/lib/Avatar/AvatarManagerTest.php b/tests/lib/Avatar/AvatarManagerTest.php index ae9c0e1671f..ce9475a4600 100644 --- a/tests/lib/Avatar/AvatarManagerTest.php +++ b/tests/lib/Avatar/AvatarManagerTest.php @@ -101,7 +101,7 @@ class AvatarManagerTest extends \Test\TestCase { } public function testGetAvatarForSelf() { - $user = $this->createMock(IUser::class); + $user = $this->createMock(\OC\User\User::class); $user ->expects($this->any()) ->method('getUID') @@ -151,7 +151,7 @@ class AvatarManagerTest extends \Test\TestCase { } public function testGetAvatarValidUserDifferentCasing() { - $user = $this->createMock(IUser::class); + $user = $this->createMock(\OC\User\User::class); $this->userManager->expects($this->once()) ->method('get') ->with('vaLid-USER') @@ -225,7 +225,7 @@ class AvatarManagerTest extends \Test\TestCase { ->method('getUser') ->willReturn($requestingUser); - $user = $this->createMock(IUser::class); + $user = $this->createMock(\OC\User\User::class); $user ->expects($this->once()) ->method('getUID') 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()); |