Skip to content

Commit

Permalink
feat: add some variants of getting value
Browse files Browse the repository at this point in the history
  • Loading branch information
chipslays committed Feb 7, 2023
1 parent 18cb4f7 commit a4417d2
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tests/PayloadTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,11 @@
it('event data', function () use ($payload) {
expect($payload->data['firstname'])->toEqual('John');
expect($payload->data->firstname)->toEqual('John');
expect($payload->data->get('firstname'))->toEqual('John');
expect($payload->data->get('ThisFirstnameNotExists', 'John'))->toEqual('John');

// nested
expect($payload->data->photo['xl'])->toEqual('image-xl.jpg');
expect($payload->data['photo']['xl'])->toEqual('image-xl.jpg');
expect($payload->data->get('photo.xl'))->toEqual('image-xl.jpg');
});

0 comments on commit a4417d2

Please sign in to comment.