mirror of
https://github.com/pestphp/pest.git
synced 2026-03-10 09:47:23 +01:00
Fixes bug with json method call in Higher Order Expectations.
This commit is contained in:
@ -74,8 +74,19 @@ it('works with higher order tests')
|
||||
->name()->toEqual('Has Methods')
|
||||
->books()->each->toBeArray;
|
||||
|
||||
it('can call the json method in higher order expectations', function () {
|
||||
expect(new HasMethods())
|
||||
->getJsonContent()->json()->id->toBe(1)->toBeGreaterThan(0)
|
||||
->getJsonContent()->json()->email->toBe('amenophis@leherpeur.net');
|
||||
});
|
||||
|
||||
class HasMethods
|
||||
{
|
||||
public function getJsonContent(): string
|
||||
{
|
||||
return '{"id":1,"username":"amenophis","email":"amenophis@leherpeur.net"}';
|
||||
}
|
||||
|
||||
public function name()
|
||||
{
|
||||
return 'Has Methods';
|
||||
|
||||
Reference in New Issue
Block a user