Added dump helper to Expectation class

This commit is contained in:
Markus Hebenstreit
2022-03-08 10:41:09 +01:00
parent 74470ec96d
commit 3601d01bd5

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.
*