From 3f7be1097f1a4af7e87835034fd8935cd85cda19 Mon Sep 17 00:00:00 2001 From: Abdul Malik Ikhsan Date: Sat, 28 Dec 2024 20:18:43 +0700 Subject: [PATCH] Fix message --- src/Assert/Filter.php | 2 +- tests/FilterTest.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Assert/Filter.php b/src/Assert/Filter.php index 1a46930..b87964a 100644 --- a/src/Assert/Filter.php +++ b/src/Assert/Filter.php @@ -24,7 +24,7 @@ public static function boolean(callable $filter): void $reflection = new ReflectionMethod($filter, '__invoke'); } else { throw new InvalidArgumentException( - sprintf('Expected Closure or invokable object, %s given', gettype($filter)) + sprintf('Expected Closure or invokable object on callable filter, %s given', gettype($filter)) ); } diff --git a/tests/FilterTest.php b/tests/FilterTest.php index ccebcd7..f4360a0 100644 --- a/tests/FilterTest.php +++ b/tests/FilterTest.php @@ -26,7 +26,7 @@ public function __invoke(int $datum): bool public function testOnceWithStringFilter(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Expected Closure or invokable object, string given'); + $this->expectExceptionMessage('Expected Closure or invokable object on callable filter, string given'); $data = [1, 'f']; $filter = 'is_string';