From da258fa89f0f2f78f472ed39e0ed42d1f2b6868d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mert=20A=C5=9Fan?= Date: Fri, 24 Sep 2021 13:55:16 +0300 Subject: [PATCH] remove the warning --- src/Expectation.php | 7 ------- tests/Features/Expect/matchExpectation.php | 10 ---------- 2 files changed, 17 deletions(-) diff --git a/src/Expectation.php b/src/Expectation.php index 1d8403ac..f903bbd6 100644 --- a/src/Expectation.php +++ b/src/Expectation.php @@ -197,7 +197,6 @@ final class Expectation $subject = $subject(); $keys = array_keys($expressions); - $matched = false; if (in_array($subject, ['0', '1', false, true], true)) { $subject = (int) $subject; @@ -208,8 +207,6 @@ final class Expectation continue; } - $matched = true; - if (is_callable($callback)) { $callback(new self($this->value)); continue; @@ -220,10 +217,6 @@ final class Expectation break; } - if (!$matched) { - test()->addWarning('No item found matching "' . $subject . '".'); - } - return $this; } diff --git a/tests/Features/Expect/matchExpectation.php b/tests/Features/Expect/matchExpectation.php index ba397b11..f577cedc 100644 --- a/tests/Features/Expect/matchExpectation.php +++ b/tests/Features/Expect/matchExpectation.php @@ -39,16 +39,6 @@ it('failures', function () { ); })->throws(ExpectationFailedException::class, 'true is false'); -it('adds a warning if no match is found', function () { - expect(true) - ->match('bar', [ - 'foo' => function ($value) { - return $value->toBeFalse(); - }, - ] - ); -}); - it('runs with truthy', function () { expect('foo') ->match(1, [