diff --git a/tests/fn.assertFunction.wrongNumberOfArguments.phpt b/tests/fn.assertFunction.wrongNumberOfArguments.phpt index 198a8673d5ee705834366697f745c97f51d4ff79..da9e242d0657336e534f12e3a2053d8e5c6ff661 100644 --- a/tests/fn.assertFunction.wrongNumberOfArguments.phpt +++ b/tests/fn.assertFunction.wrongNumberOfArguments.phpt @@ -4,15 +4,23 @@ require __DIR__ . '/bootstrap.php'; require __DIR__ . '/testClasses.php'; use function Grifart\AssertFunction\{assertFunction, optional, parameters}; use Tester\Assert; - +$position = 'assert-function-signature/tests/fn.assertFunction.wrongNumberOfArguments.phpt:9'; $f1 = function(T1 $t1, T2 $t2): T3 {return new T3;}; // Wrong number of arguments -Assert::exception(function () use ($f1) { - assertFunction($f1, parameters(T1::class), T3::class); -}, \AssertionError::class); +Assert::exception( + function () use ($f1) { + assertFunction($f1, parameters(T1::class), T3::class); + }, + \AssertionError::class, + "$position Given wrong number of parameters. Expected 1, 2 given." +); -Assert::exception(function () use ($f1) { - assertFunction($f1, parameters(T1::class, T2::class, T1::class), T3::class); -}, \AssertionError::class); +Assert::exception( + function () use ($f1) { + assertFunction($f1, parameters(T1::class, T2::class, T1::class), T3::class); + }, + \AssertionError::class, + "$position Given wrong number of parameters. Expected 3, 2 given." +);