Add colors to tests

Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
Julius Härtl 2018-01-08 16:50:03 +01:00
parent 9b668d01f5
commit 9bb0299c98
No known key found for this signature in database
GPG Key ID: 4C614C6ED2CDE6DF
1 changed files with 13 additions and 7 deletions

View File

@ -53,14 +53,20 @@ class UtilTest extends TestCase {
$this->util = new Util($this->config, $this->appManager, $this->appData); $this->util = new Util($this->config, $this->appManager, $this->appData);
} }
public function testInvertTextColorLight() { public function dataInvertTextColor() {
$invert = $this->util->invertTextColor('#ffffff'); return [
$this->assertEquals(true, $invert); ['#ffffff', true],
['#000000', false],
['#0082C9', false],
['#ffff00', true],
];
} }
/**
public function testInvertTextColorDark() { * @dataProvider dataInvertTextColor
$invert = $this->util->invertTextColor('#000000'); */
$this->assertEquals(false, $invert); public function testInvertTextColor($color, $expected) {
$invert = $this->util->invertTextColor($color);
$this->assertEquals($expected, $invert);
} }
public function testCalculateLuminanceLight() { public function testCalculateLuminanceLight() {