mirror of
https://github.com/pestphp/pest.git
synced 2026-03-06 15:57:21 +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
|
||||
{
|
||||
Assert::assertIsString($this->value);
|
||||
Assert::assertJson($this->value);
|
||||
|
||||
return new self(json_decode($this->value, true));
|
||||
return $this->toBeJson()->and(json_decode($this->value, true));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user