-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Add test for the $hidden
property
#2687
Add test for the $hidden
property
#2687
Conversation
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.
Just a minor suggestion for consistency, but LGTM other than that.
tests/Models/Animal.php
Outdated
* @method static Builder truncate() | ||
* @method static Eloquent sole(...$parameters) | ||
*/ | ||
final class Animal extends Eloquent |
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.
I don't see what is tested with this model class. Hidden fields and the toArray
feature are tested with HiddenAnimal
.
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.
The idea of the two classes is that one has the hidden property and another doesn't. As to prove the working of the hidden property.
Or do you suggest to have one class and use different fields to test?
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.
IMHO, the test on HiddenAnimal already covers the feature.
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.
Fair enough, will remove this class and its usage
Co-authored-by: Andreas Braun <[email protected]>
Thank you @Treggats |
As requested in #1119
closes #1119
This adds a test which covers the working of the
$hidden
property.