-
Notifications
You must be signed in to change notification settings - Fork 11.7k
[JSON:API] add tests for type, included merge and id in attributes #57589
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: json-api-resource
Are you sure you want to change the base?
Conversation
|
|
||
| public function testResourceTypeIsPickedFromMorph() | ||
| { | ||
| Relation::morphMap([JsonApiModel::class => 'json-api-model']); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, yeah, that's what I get for doing it during work break. Will get back to this in a bit 👍
…-resource Signed-off-by: Mior Muhammad Zaki <crynobone@gmail.com>
| 'email' => 'deputy@example.com', | ||
| ], | ||
| ], $responseData['included'][0]); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@timacdonald need your input on this and how it should be affected, especially when the resource (e.g., UserResource) needs id, name, and email values to be available, but the relationship only loads partial values.

Added failing test to assert that:
I'm unsure how the intended way will be to test the data so picked what I found around other tests.