2012-08-03 20:21:32 +00:00
|
|
|
<?php
|
|
|
|
|
2016-08-13 17:22:11 +00:00
|
|
|
namespace PhpSpreadsheet\Tests\Style;
|
2012-08-03 20:21:32 +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);
|
2015-05-28 22:15:46 +00:00
|
|
|
$result = call_user_func_array(array('\\PHPExcel\\Style\\Color','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-13 17:22:11 +00:00
|
|
|
return new \PhpSpreadsheet\Tests\TestDataFileIterator('rawTestData/Style/ColorGetRed.data');
|
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);
|
2015-05-28 22:15:46 +00:00
|
|
|
$result = call_user_func_array(array('\\PHPExcel\\Style\\Color','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-13 17:22:11 +00:00
|
|
|
return new \PhpSpreadsheet\Tests\TestDataFileIterator('rawTestData/Style/ColorGetGreen.data');
|
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);
|
2015-05-28 22:15:46 +00:00
|
|
|
$result = call_user_func_array(array('\\PHPExcel\\Style\\Color','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-13 17:22:11 +00:00
|
|
|
return new \PhpSpreadsheet\Tests\TestDataFileIterator('rawTestData/Style/ColorGetBlue.data');
|
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();
|
|
|
|
$result = call_user_func_array(array('\\PHPExcel\\Style\\Color','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-13 17:22:11 +00:00
|
|
|
return new \PhpSpreadsheet\Tests\TestDataFileIteratorJson('rawTestData/Style/ColorChangeBrightness.json');
|
2015-05-17 13:00:02 +00:00
|
|
|
}
|
2012-08-03 20:21:32 +00:00
|
|
|
}
|