Makes json expectation usable in Higher Order Tests

This commit is contained in:
Luke Downing
2022-01-23 23:10:14 +00:00
parent d2ca6e630d
commit ead2dfd0a9
3 changed files with 27 additions and 2 deletions

View File

@ -79,6 +79,16 @@ final class HigherOrderExpectation
return $this->expect($value);
}
/**
* Creates a new expectation with the decoded JSON value.
*
* @return self<TOriginalValue, array<string|int, mixed>|bool>
*/
public function json(): self
{
return new self($this->original, $this->expectation->json()->value);
}
/**
* Dynamically calls methods on the class with the given arguments.
*