mirror of
https://github.com/Karaka-Management/phpOMS.git
synced 2026-01-11 17:58:41 +00:00
48 lines
1.0 KiB
PHP
Executable File
48 lines
1.0 KiB
PHP
Executable File
<?php
|
|
/**
|
|
* Jingga
|
|
*
|
|
* PHP Version 8.1
|
|
*
|
|
* @package tests
|
|
* @copyright Dennis Eichhorn
|
|
* @license OMS License 2.0
|
|
* @version 1.0.0
|
|
* @link https://jingga.app
|
|
*/
|
|
declare(strict_types=1);
|
|
|
|
namespace phpOMS\tests\Utils;
|
|
|
|
require_once __DIR__ . '/../Autoloader.php';
|
|
|
|
use phpOMS\Utils\ColorUtils;
|
|
|
|
/**
|
|
* @testdox phpOMS\tests\Utils\ColorUtilsTest: Color utilities
|
|
*
|
|
* @internal
|
|
*/
|
|
final class ColorUtilsTest extends \PHPUnit\Framework\TestCase
|
|
{
|
|
/**
|
|
* @testdox A integer can be converted to rgb
|
|
* @covers phpOMS\Utils\ColorUtils
|
|
* @group framework
|
|
*/
|
|
public function testIntToRgb() : void
|
|
{
|
|
self::assertEquals(['r' => 0xbc, 'g' => 0x39, 'b' => 0x6c], ColorUtils::intToRgb(12335468));
|
|
}
|
|
|
|
/**
|
|
* @testdox Rgb can be converted to a integer
|
|
* @covers phpOMS\Utils\ColorUtils
|
|
* @group framework
|
|
*/
|
|
public function testRgbToInt() : void
|
|
{
|
|
self::assertEquals(12335468, ColorUtils::rgbToInt(['r' => 0xbc, 'g' => 0x39, 'b' => 0x6c]));
|
|
}
|
|
}
|