mirror of
https://github.com/pestphp/pest.git
synced 2026-03-06 15:57:21 +01:00
remove the warning
This commit is contained in:
@ -197,7 +197,6 @@ final class Expectation
|
|||||||
|
|
||||||
$subject = $subject();
|
$subject = $subject();
|
||||||
$keys = array_keys($expressions);
|
$keys = array_keys($expressions);
|
||||||
$matched = false;
|
|
||||||
|
|
||||||
if (in_array($subject, ['0', '1', false, true], true)) {
|
if (in_array($subject, ['0', '1', false, true], true)) {
|
||||||
$subject = (int) $subject;
|
$subject = (int) $subject;
|
||||||
@ -208,8 +207,6 @@ final class Expectation
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
$matched = true;
|
|
||||||
|
|
||||||
if (is_callable($callback)) {
|
if (is_callable($callback)) {
|
||||||
$callback(new self($this->value));
|
$callback(new self($this->value));
|
||||||
continue;
|
continue;
|
||||||
@ -220,10 +217,6 @@ final class Expectation
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$matched) {
|
|
||||||
test()->addWarning('No item found matching "' . $subject . '".');
|
|
||||||
}
|
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -39,16 +39,6 @@ it('failures', function () {
|
|||||||
);
|
);
|
||||||
})->throws(ExpectationFailedException::class, 'true is false');
|
})->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 () {
|
it('runs with truthy', function () {
|
||||||
expect('foo')
|
expect('foo')
|
||||||
->match(1, [
|
->match(1, [
|
||||||
|
|||||||
Reference in New Issue
Block a user