diff options
-rw-r--r-- | apps/theming/tests/UtilTest.php | 20 |
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() { |