Merge pull request #496 from hebinet/dump-for-expections

[1.x] Add `dump` helper to Expectation class
This commit is contained in:
Nuno Maduro
2022-03-08 10:24:56 +00:00
committed by GitHub

View File

@ -76,6 +76,22 @@ final class Expectation
return $this->toBeJson()->and($value);
}
/**
* Dump the expectation value.
*
* @return self<TValue>
*/
public function dump(mixed ...$arguments): self
{
if (function_exists('dump')) {
dump($this->value, ...$arguments);
} else {
var_dump($this->value);
}
return $this;
}
/**
* Dump the expectation value and end the script.
*