Skip to content

Commit

Permalink
Add new test case in ColorTest.php
Browse files Browse the repository at this point in the history
A new test case has been added in the ColorTest.php file to ensure the proper functioning of the HexToRGB function when converting the hex color value '#345'. This helps increase the test coverage for the Color class.
  • Loading branch information
renfordt committed Apr 3, 2024
1 parent 14efb9e commit 73eb88d
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/ColorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,14 @@ public function testHexToRGB(): void
$expectedResult = [140, 90, 69];
$actualResult = Color::HexToRGB($hexColor);
$this->assertEquals($expectedResult, $actualResult, 'Case 4 failed: #8c5a45');

// Test case 4: #8c5a45
$hexColor = '#345';
$expectedResult = [51, 68, 85];
$actualResult = Color::HexToRGB($hexColor);
$this->assertEquals($expectedResult, $actualResult, 'Case failed: #345');


}

/**
Expand Down

0 comments on commit 73eb88d

Please # to comment.