Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorCarl Schwan <carl@carlschwan.eu>2022-06-23 12:42:14 +0300
committerCarl Schwan <carl@carlschwan.eu>2022-07-05 15:44:44 +0300
commitec5cbdeb7ffb87c0169c39e6f44846e819b41f14 (patch)
tree275f11c139076fbcb60cc39c8ce609dfd3f41f82 /tests
parent812016d62614ac3669a3fdf51fa2e07170e08c08 (diff)
Make Color class publiccleanup/avatar-code
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
Diffstat (limited to 'tests')
-rw-r--r--tests/lib/Avatar/AvatarManagerTest.php7
-rw-r--r--tests/lib/Avatar/UserAvatarTest.php14
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');