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
diff options
context:
space:
mode:
authorJulius Härtl <jus@bitgrid.net>2018-01-08 18:50:03 +0300
committerJulius Härtl <jus@bitgrid.net>2018-01-08 18:50:03 +0300
commit9bb0299c983c20cf150a88f70d44ab29140d0ce5 (patch)
treea8fd29b0ec68f5d1b6d520aef644938b458843bc /apps/theming/tests
parent9b668d01f5acb62ca893b39a448f36aecd6d6841 (diff)
Add colors to tests
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'apps/theming/tests')
-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() {