mirror of
https://github.com/pestphp/pest.git
synced 2026-03-06 15:57:21 +01:00
Merge branch 'master' into scoped
# Conflicts: # src/Expectations/HigherOrderExpectation.php # tests/Features/Expect/HigherOrder/methods.php
This commit is contained in:
@ -91,8 +91,20 @@ it('can use the scoped method to lock into the given level for expectations', fu
|
||||
);
|
||||
});
|
||||
|
||||
it('works consistently with the json expectation method', function () {
|
||||
expect(new HasMethods())
|
||||
->jsonString()->json()->id->toBe(1)
|
||||
->jsonString()->json()->name->toBe('Has Methods')->toBeString()
|
||||
->jsonString()->json()->quantity->toBe(20)->toBeInt();
|
||||
});
|
||||
|
||||
class HasMethods
|
||||
{
|
||||
public function jsonString(): string
|
||||
{
|
||||
return '{ "id": 1, "name": "Has Methods", "quantity": 20 }';
|
||||
}
|
||||
|
||||
public function name()
|
||||
{
|
||||
return 'Has Methods';
|
||||
|
||||
Reference in New Issue
Block a user