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);
}
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() {