PhpSpreadsheet/tests/PhpSpreadsheet/Style/ColorTest.php

70 lines
2.0 KiB
PHP
Raw Normal View History

<?php
namespace PhpSpreadsheet\Tests\Style;
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(array('\\PHPExcel\\Style\\Color','getRed'), $args);
2015-05-17 13:00:02 +00:00
$this->assertEquals($expectedResult, $result);
}
public function providerColorGetRed()
{
return new \PhpSpreadsheet\Tests\TestDataFileIterator('rawTestData/Style/ColorGetRed.data');
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(array('\\PHPExcel\\Style\\Color','getGreen'), $args);
2015-05-17 13:00:02 +00:00
$this->assertEquals($expectedResult, $result);
}
public function providerColorGetGreen()
{
return new \PhpSpreadsheet\Tests\TestDataFileIterator('rawTestData/Style/ColorGetGreen.data');
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(array('\\PHPExcel\\Style\\Color','getBlue'), $args);
2015-05-17 13:00:02 +00:00
$this->assertEquals($expectedResult, $result);
}
public function providerColorGetBlue()
{
return new \PhpSpreadsheet\Tests\TestDataFileIterator('rawTestData/Style/ColorGetBlue.data');
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(array('\\PHPExcel\\Style\\Color','changeBrightness'), $args);
2015-05-17 13:00:02 +00:00
$this->assertEquals($expectedResult, $result);
}
public function providerColorChangeBrightness()
{
return new \PhpSpreadsheet\Tests\TestDataFileIteratorJson('rawTestData/Style/ColorChangeBrightness.json');
2015-05-17 13:00:02 +00:00
}
}