From 671f3df115bcf5bcba67c59ed3a635abe0ebf755 Mon Sep 17 00:00:00 2001 From: freek Date: Wed, 28 Jul 2021 01:00:19 +0200 Subject: [PATCH] fix tests --- src/Expectation.php | 6 +++--- tests/Features/Expect/toBeIn.php | 5 +++++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/Expectation.php b/src/Expectation.php index e32a8683..e76a30bd 100644 --- a/src/Expectation.php +++ b/src/Expectation.php @@ -374,11 +374,11 @@ final class Expectation /** * Asserts that the value is one of the given values. * - * @param array $possibleValues + * @param iterable $values */ - public function toBeIn(array $possibleValues): Expectation + public function toBeIn(iterable $values): Expectation { - Assert::assertContains($this->value, $possibleValues); + Assert::assertContains($this->value, $values); return $this; } diff --git a/tests/Features/Expect/toBeIn.php b/tests/Features/Expect/toBeIn.php index 3d34f46a..6636a51b 100644 --- a/tests/Features/Expect/toBeIn.php +++ b/tests/Features/Expect/toBeIn.php @@ -4,8 +4,13 @@ use PHPUnit\Framework\ExpectationFailedException; test('passes', function () { expect('a')->toBeIn(['a', 'b', 'c']); + expect('d')->not->toBeIn(['a', 'b', 'c']); }); test('failures', function () { expect('d')->toBeIn(['a', 'b', 'c']); })->throws(ExpectationFailedException::class); + +test('not failures', function () { + expect('a')->not->toBeIn(['a', 'b', 'c']); +})->throws(ExpectationFailedException::class);