aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJulius Härtl <jus@bitgrid.net>2018-01-08 16:50:03 +0100
committerJulius Härtl <jus@bitgrid.net>2018-01-08 16:50:03 +0100
commit9bb0299c983c20cf150a88f70d44ab29140d0ce5 (patch)
treea8fd29b0ec68f5d1b6d520aef644938b458843bc
parent9b668d01f5acb62ca893b39a448f36aecd6d6841 (diff)
downloadnextcloud-server-9bb0299c983c20cf150a88f70d44ab29140d0ce5.tar.gz
nextcloud-server-9bb0299c983c20cf150a88f70d44ab29140d0ce5.zip
Add colors to tests
Signed-off-by: Julius Härtl <jus@bitgrid.net>
-rw-r--r--apps/theming/tests/UtilTest.php20
1 files changed, 13 insertions, 7 deletions
diff --git a/apps/theming/tests/UtilTest.php b/apps/theming/tests/UtilTest.php
index 94e4c9cbcc8..1ad77be72d5 100644
--- a/apps/theming/tests/UtilTest.php
+++ b/apps/theming/tests/UtilTest.php
@@ -53,14 +53,20 @@ class UtilTest extends TestCase {
$this->util = new Util($this->config, $this->appManager, $this->appData);
}
- public function testInvertTextColorLight() {
- $invert = $this->util->invertTextColor('#ffffff');
- $this->assertEquals(true, $invert);
+ public function dataInvertTextColor() {
+ return [
+ ['#ffffff', true],
+ ['#000000', false],
+ ['#0082C9', false],
+ ['#ffff00', true],
+ ];
}
-
- public function testInvertTextColorDark() {
- $invert = $this->util->invertTextColor('#000000');
- $this->assertEquals(false, $invert);
+ /**
+ * @dataProvider dataInvertTextColor
+ */
+ public function testInvertTextColor($color, $expected) {
+ $invert = $this->util->invertTextColor($color);
+ $this->assertEquals($expected, $invert);
}
public function testCalculateLuminanceLight() {