Skip to content

Commit

Permalink
Add function existence test in ClampTest
Browse files Browse the repository at this point in the history
This commit adds a new test case in ClampTest.php to check if the 'clamp' function exists. This helps to catch errors caused by the function being undefined or removed inadvertently.
  • Loading branch information
renfordt committed Apr 14, 2024
1 parent 387916b commit 98b347e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tests/ClampTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,8 @@ public function testClampMinMax($value, $min, $max, $expected): void
{
$this->assertSame($expected, clampMinMax($value, $min, $max));
}

public function testIfFunctionExists() {
$this->assertTrue(function_exists('clamp'), 'Function clamp does not exist');
}
}

0 comments on commit 98b347e

Please # to comment.