diff options
author | Carl Schwan <carl@carlschwan.eu> | 2022-06-23 11:42:14 +0200 |
---|---|---|
committer | Carl Schwan <carl@carlschwan.eu> | 2022-07-05 14:44:44 +0200 |
commit | ec5cbdeb7ffb87c0169c39e6f44846e819b41f14 (patch) | |
tree | 275f11c139076fbcb60cc39c8ce609dfd3f41f82 /tests/lib/Avatar | |
parent | 812016d62614ac3669a3fdf51fa2e07170e08c08 (diff) | |
download | nextcloud-server-ec5cbdeb7ffb87c0169c39e6f44846e819b41f14.tar.gz nextcloud-server-ec5cbdeb7ffb87c0169c39e6f44846e819b41f14.zip |
Make Color class public
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
Diffstat (limited to 'tests/lib/Avatar')
-rw-r--r-- | tests/lib/Avatar/AvatarManagerTest.php | 7 | ||||
-rw-r--r-- | tests/lib/Avatar/UserAvatarTest.php | 14 |
2 files changed, 11 insertions, 10 deletions
diff --git a/tests/lib/Avatar/AvatarManagerTest.php b/tests/lib/Avatar/AvatarManagerTest.php index ce9475a4600..06ff4086f72 100644 --- a/tests/lib/Avatar/AvatarManagerTest.php +++ b/tests/lib/Avatar/AvatarManagerTest.php @@ -37,6 +37,7 @@ use OCP\Files\SimpleFS\ISimpleFolder; use OCP\IConfig; use OCP\IL10N; use OCP\IUser; +use OC\User\User; use OCP\IUserSession; use Psr\Log\LoggerInterface; @@ -101,7 +102,7 @@ class AvatarManagerTest extends \Test\TestCase { } public function testGetAvatarForSelf() { - $user = $this->createMock(\OC\User\User::class); + $user = $this->createMock(User::class); $user ->expects($this->any()) ->method('getUID') @@ -151,7 +152,7 @@ class AvatarManagerTest extends \Test\TestCase { } public function testGetAvatarValidUserDifferentCasing() { - $user = $this->createMock(\OC\User\User::class); + $user = $this->createMock(User::class); $this->userManager->expects($this->once()) ->method('get') ->with('vaLid-USER') @@ -225,7 +226,7 @@ class AvatarManagerTest extends \Test\TestCase { ->method('getUser') ->willReturn($requestingUser); - $user = $this->createMock(\OC\User\User::class); + $user = $this->createMock(User::class); $user ->expects($this->once()) ->method('getUID') diff --git a/tests/lib/Avatar/UserAvatarTest.php b/tests/lib/Avatar/UserAvatarTest.php index bd45a819760..b2b4ebba343 100644 --- a/tests/lib/Avatar/UserAvatarTest.php +++ b/tests/lib/Avatar/UserAvatarTest.php @@ -258,17 +258,17 @@ class UserAvatarTest extends \Test\TestCase { } public function testMixPalette() { - $colorFrom = new \OC\Color(0, 0, 0); - $colorTo = new \OC\Color(6, 12, 18); + $colorFrom = new \OCP\Color(0, 0, 0); + $colorTo = new \OCP\Color(6, 12, 18); $steps = 6; - $palette = $this->invokePrivate($this->avatar, 'mixPalette', [$steps, $colorFrom, $colorTo]); + $palette = \OCP\Color::mixPalette($steps, $colorFrom, $colorTo); foreach ($palette as $j => $color) { // calc increment - $incR = $colorTo->r / $steps * $j; - $incG = $colorTo->g / $steps * $j; - $incB = $colorTo->b / $steps * $j; + $incR = $colorTo->red() / $steps * $j; + $incG = $colorTo->green() / $steps * $j; + $incB = $colorTo->blue() / $steps * $j; // ensure everything is equal - $this->assertEquals($color, new \OC\Color($incR, $incG, $incB)); + $this->assertEquals($color, new \OCP\Color($incR, $incG, $incB)); } $hashToInt = $this->invokePrivate($this->avatar, 'hashToInt', ['abcdef', 18]); $this->assertTrue(gettype($hashToInt) === 'integer'); |