2012-08-03 20:21:32 +00:00
|
|
|
<?php
|
|
|
|
|
2016-08-31 17:18:12 +00:00
|
|
|
namespace PhpOffice\PhpSpreadsheetTests\Style;
|
2012-08-03 20:21:32 +00:00
|
|
|
|
2016-08-31 17:18:12 +00:00
|
|
|
use PhpOffice\PhpSpreadsheet\Style\Color;
|
2016-08-14 04:08:43 +00:00
|
|
|
|
2016-03-22 14:35:50 +00:00
|
|
|
class ColorTest extends \PHPUnit_Framework_TestCase
|
2012-08-03 20:21:32 +00:00
|
|
|
{
|
|
|
|
/**
|
|
|
|
* @dataProvider providerColorGetRed
|
|
|
|
*/
|
2015-05-17 13:00:02 +00:00
|
|
|
public function testGetRed()
|
|
|
|
{
|
|
|
|
$args = func_get_args();
|
|
|
|
$expectedResult = array_pop($args);
|
2016-08-16 15:33:57 +00:00
|
|
|
$result = call_user_func_array([Color::class, 'getRed'], $args);
|
2015-05-17 13:00:02 +00:00
|
|
|
$this->assertEquals($expectedResult, $result);
|
|
|
|
}
|
2012-08-03 20:21:32 +00:00
|
|
|
|
|
|
|
public function providerColorGetRed()
|
|
|
|
{
|
2016-08-16 12:00:19 +00:00
|
|
|
return require 'data/Style/ColorGetRed.php';
|
2015-05-17 13:00:02 +00:00
|
|
|
}
|
2012-08-03 20:21:32 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @dataProvider providerColorGetGreen
|
|
|
|
*/
|
2015-05-17 13:00:02 +00:00
|
|
|
public function testGetGreen()
|
|
|
|
{
|
|
|
|
$args = func_get_args();
|
|
|
|
$expectedResult = array_pop($args);
|
2016-08-16 15:33:57 +00:00
|
|
|
$result = call_user_func_array([Color::class, 'getGreen'], $args);
|
2015-05-17 13:00:02 +00:00
|
|
|
$this->assertEquals($expectedResult, $result);
|
|
|
|
}
|
2012-08-03 20:21:32 +00:00
|
|
|
|
|
|
|
public function providerColorGetGreen()
|
|
|
|
{
|
2016-08-16 12:00:19 +00:00
|
|
|
return require 'data/Style/ColorGetGreen.php';
|
2015-05-17 13:00:02 +00:00
|
|
|
}
|
2012-08-03 20:21:32 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @dataProvider providerColorGetBlue
|
|
|
|
*/
|
2015-05-17 13:00:02 +00:00
|
|
|
public function testGetBlue()
|
|
|
|
{
|
|
|
|
$args = func_get_args();
|
|
|
|
$expectedResult = array_pop($args);
|
2016-08-16 15:33:57 +00:00
|
|
|
$result = call_user_func_array([Color::class, 'getBlue'], $args);
|
2015-05-17 13:00:02 +00:00
|
|
|
$this->assertEquals($expectedResult, $result);
|
|
|
|
}
|
2012-08-03 20:21:32 +00:00
|
|
|
|
|
|
|
public function providerColorGetBlue()
|
|
|
|
{
|
2016-08-16 12:00:19 +00:00
|
|
|
return require 'data/Style/ColorGetBlue.php';
|
2015-05-17 13:00:02 +00:00
|
|
|
}
|
2012-08-03 20:21:32 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @dataProvider providerColorChangeBrightness
|
|
|
|
*/
|
2015-05-17 13:00:02 +00:00
|
|
|
public function testChangeBrightness()
|
|
|
|
{
|
2015-05-28 22:15:46 +00:00
|
|
|
list($args, $expectedResult) = func_get_args();
|
2016-08-16 15:33:57 +00:00
|
|
|
$result = call_user_func_array([Color::class, 'changeBrightness'], $args);
|
2015-05-17 13:00:02 +00:00
|
|
|
$this->assertEquals($expectedResult, $result);
|
|
|
|
}
|
2012-08-03 20:21:32 +00:00
|
|
|
|
|
|
|
public function providerColorChangeBrightness()
|
|
|
|
{
|
2016-08-16 12:00:19 +00:00
|
|
|
return require 'data/Style/ColorChangeBrightness.php';
|
2015-05-17 13:00:02 +00:00
|
|
|
}
|
2012-08-03 20:21:32 +00:00
|
|
|
}
|