mirror of
https://github.com/pestphp/pest.git
synced 2026-03-12 02:37:22 +01:00
Refactoring to use toBeJson()
Refactoring according to @lukeraymonddowning suggestion
This commit is contained in:
@ -65,10 +65,7 @@ final class Expectation
|
|||||||
*/
|
*/
|
||||||
public function json(): Expectation
|
public function json(): Expectation
|
||||||
{
|
{
|
||||||
Assert::assertIsString($this->value);
|
return $this->toBeJson()->and(json_decode($this->value, true));
|
||||||
Assert::assertJson($this->value);
|
|
||||||
|
|
||||||
return new self(json_decode($this->value, true));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user