-
-
Notifications
You must be signed in to change notification settings - Fork 896
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
Question on ClassInfoTrait #475
Comments
Traits are easily testable? I don't see any benefit to remove the trait for adding a static method. 👎 for me. |
With a private method it requires to have create a test class using this trait and having a public method calling it directly. Doable but slightly more annoying. In any case I will add a test for it, but I really don't see the advantage of using a trait in this case (well, it's not like I'm fond of static calls either meh). |
You can use the |
Ah nice one.
Didn't make my opinion on it yet :p
It is don't worry |
Anyway will just take care of adding a test for it then |
I'm of the opinion that we don't need a test for this. It'll only be testing Doctrine's method, or |
Fair enough. Anyway we need to get phpspec/prophecy#263 or phpspec/prophecy#264 merged for proper unit testing 😞 |
ClassInfoTrait
Is there any point to have it as a trait? It only has the following method:
IMO this could be a public static function instead: having it as a trait only duplicate the method on which classes using it and it does only PHP function calls or static calls, so be it a private method in a trait or a public static method, it doesn't change anything in terms of testability (for the class using it), while make this util testable.
The text was updated successfully, but these errors were encountered: