summaryrefslogtreecommitdiffstats
path: root/apps/theming/tests/CapabilitiesTest.php
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2020-06-26 09:58:45 +0200
committerJoas Schilling <coding@schilljs.com>2020-06-26 09:58:45 +0200
commitbe5176076e08e73354ad44493b65d86aade2ad6e (patch)
treeaacce242f84b6a054674060d293effff105380df /apps/theming/tests/CapabilitiesTest.php
parented4afa55c1ccaef140ac310258ad837bf6af9557 (diff)
downloadnextcloud-server-be5176076e08e73354ad44493b65d86aade2ad6e.tar.gz
nextcloud-server-be5176076e08e73354ad44493b65d86aade2ad6e.zip
Precalculate the primary element color for dark mode too
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'apps/theming/tests/CapabilitiesTest.php')
-rw-r--r--apps/theming/tests/CapabilitiesTest.php14
1 files changed, 12 insertions, 2 deletions
diff --git a/apps/theming/tests/CapabilitiesTest.php b/apps/theming/tests/CapabilitiesTest.php
index 60cebb37cf1..216672a881e 100644
--- a/apps/theming/tests/CapabilitiesTest.php
+++ b/apps/theming/tests/CapabilitiesTest.php
@@ -78,6 +78,8 @@ class CapabilitiesTest extends TestCase {
'color' => '#FFFFFF',
'color-text' => '#000000',
'color-element' => '#aaaaaa',
+ 'color-element-bright' => '#aaaaaa',
+ 'color-element-dark' => '#FFFFFF',
'logo' => 'http://absolute/logo',
'background' => 'http://absolute/background',
'background-plain' => false,
@@ -92,6 +94,8 @@ class CapabilitiesTest extends TestCase {
'color' => '#01e4a0',
'color-text' => '#ffffff',
'color-element' => '#01e4a0',
+ 'color-element-bright' => '#01e4a0',
+ 'color-element-dark' => '#01e4a0',
'logo' => 'http://localhost/logo5',
'background' => 'http://localhost/background6',
'background-plain' => false,
@@ -106,6 +110,8 @@ class CapabilitiesTest extends TestCase {
'color' => '#000000',
'color-text' => '#ffffff',
'color-element' => '#000000',
+ 'color-element-bright' => '#000000',
+ 'color-element-dark' => '#555555',
'logo' => 'http://localhost/logo5',
'background' => '#000000',
'background-plain' => true,
@@ -120,6 +126,8 @@ class CapabilitiesTest extends TestCase {
'color' => '#000000',
'color-text' => '#ffffff',
'color-element' => '#000000',
+ 'color-element-bright' => '#000000',
+ 'color-element-dark' => '#555555',
'logo' => 'http://localhost/logo5',
'background' => '#000000',
'background-plain' => true,
@@ -167,10 +175,12 @@ class CapabilitiesTest extends TestCase {
->willReturn($textColor);
$util = new Util($this->config, $this->createMock(IAppManager::class), $this->createMock(IAppData::class));
- $this->util->expects($this->once())
+ $this->util->expects($this->exactly(3))
->method('elementColor')
->with($color)
- ->willReturn($util->elementColor($color));
+ ->willReturnCallback(static function(string $color, bool $brightBackground = true) use ($util) {
+ return $util->elementColor($color, $brightBackground);
+ });
$this->util->expects($this->once())
->method('isBackgroundThemed')