From 79bc9e677ffb13d0d03558532c439307a3af23ca Mon Sep 17 00:00:00 2001 From: Thai Nguyen Hung Date: Tue, 22 Aug 2023 10:36:10 +0700 Subject: [PATCH] test: `toHaveCount` with invalid type --- tests/Features/Expect/toHaveCount.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/Features/Expect/toHaveCount.php b/tests/Features/Expect/toHaveCount.php index 726f2c64..153175cf 100644 --- a/tests/Features/Expect/toHaveCount.php +++ b/tests/Features/Expect/toHaveCount.php @@ -1,11 +1,16 @@ toHaveCount(3); }); +test('failures with invalid type', function () { + expect('foo')->toHaveCount(3); +})->throws(InvalidExpectationValue::class, 'Invalid expectation value type. Expected [countable|iterable]'); + test('failures', function () { expect([1, 2, 3])->toHaveCount(4); })->throws(ExpectationFailedException::class);