72 lines
1.8 KiB
PHP
72 lines
1.8 KiB
PHP
|
<?php
|
||
|
|
||
|
namespace PhpSpreadsheetTests\Style;
|
||
|
|
||
|
use PhpSpreadsheet\Style\Color;
|
||
|
|
||
|
class ColorTest extends \PHPUnit_Framework_TestCase
|
||
|
{
|
||
|
/**
|
||
|
* @dataProvider providerColorGetRed
|
||
|
*/
|
||
|
public function testGetRed()
|
||
|
{
|
||
|
$args = func_get_args();
|
||
|
$expectedResult = array_pop($args);
|
||
|
$result = call_user_func_array([Color::class, 'getRed'], $args);
|
||
|
$this->assertEquals($expectedResult, $result);
|
||
|
}
|
||
|
|
||
|
public function providerColorGetRed()
|
||
|
{
|
||
|
return require 'data/Style/ColorGetRed.php';
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* @dataProvider providerColorGetGreen
|
||
|
*/
|
||
|
public function testGetGreen()
|
||
|
{
|
||
|
$args = func_get_args();
|
||
|
$expectedResult = array_pop($args);
|
||
|
$result = call_user_func_array([Color::class, 'getGreen'], $args);
|
||
|
$this->assertEquals($expectedResult, $result);
|
||
|
}
|
||
|
|
||
|
public function providerColorGetGreen()
|
||
|
{
|
||
|
return require 'data/Style/ColorGetGreen.php';
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* @dataProvider providerColorGetBlue
|
||
|
*/
|
||
|
public function testGetBlue()
|
||
|
{
|
||
|
$args = func_get_args();
|
||
|
$expectedResult = array_pop($args);
|
||
|
$result = call_user_func_array([Color::class, 'getBlue'], $args);
|
||
|
$this->assertEquals($expectedResult, $result);
|
||
|
}
|
||
|
|
||
|
public function providerColorGetBlue()
|
||
|
{
|
||
|
return require 'data/Style/ColorGetBlue.php';
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* @dataProvider providerColorChangeBrightness
|
||
|
*/
|
||
|
public function testChangeBrightness()
|
||
|
{
|
||
|
list($args, $expectedResult) = func_get_args();
|
||
|
$result = call_user_func_array([Color::class, 'changeBrightness'], $args);
|
||
|
$this->assertEquals($expectedResult, $result);
|
||
|
}
|
||
|
|
||
|
public function providerColorChangeBrightness()
|
||
|
{
|
||
|
return require 'data/Style/ColorChangeBrightness.php';
|
||
|
}
|
||
|
}
|