From 3601d01bd5dc8e68c60d5cfaea44e804b7a29531 Mon Sep 17 00:00:00 2001 From: Markus Hebenstreit Date: Tue, 8 Mar 2022 10:41:09 +0100 Subject: [PATCH] Added dump helper to Expectation class --- src/Expectation.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/Expectation.php b/src/Expectation.php index 7703ebb8..1099daff 100644 --- a/src/Expectation.php +++ b/src/Expectation.php @@ -76,6 +76,22 @@ final class Expectation return $this->toBeJson()->and($value); } + /** + * Dump the expectation value. + * + * @return self + */ + 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. *