PhpSpreadsheet/tests/PhpSpreadsheetTests/Style/ColorTest.php

72 lines
1.8 KiB
PHP
Raw Normal View History

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