PhpSpreadsheet/tests/PhpSpreadsheetTests/Style/ColorTest.php

74 lines
1.7 KiB
PHP
Raw Normal View History

<?php
namespace PhpOffice\PhpSpreadsheetTests\Style;
use PhpOffice\PhpSpreadsheet\Style\Color;
use PHPUnit_Framework_TestCase;
class ColorTest extends PHPUnit_Framework_TestCase
{
/**
* @dataProvider providerColorGetRed
*
* @param mixed $expectedResult
*/
public function testGetRed($expectedResult, ...$args)
2015-05-17 13:00:02 +00:00
{
$result = Color::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
*
* @param mixed $expectedResult
*/
public function testGetGreen($expectedResult, ...$args)
2015-05-17 13:00:02 +00:00
{
$result = Color::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
*
* @param mixed $expectedResult
*/
public function testGetBlue($expectedResult, ...$args)
2015-05-17 13:00:02 +00:00
{
$result = Color::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
*
* @param mixed $expectedResult
*/
public function testChangeBrightness($expectedResult, ...$args)
2015-05-17 13:00:02 +00:00
{
$result = Color::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
}
}