-
Notifications
You must be signed in to change notification settings - Fork 5
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
Issue #19 non-public functionality #84
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.
Nice one!
I'm against this change. There's a reason why private/public/protected signatures exist. Making this kind of change will violate encapsulation in OOP. I would find the specific points trying to access and provide Getters for them. |
@Guergeiro, so you don't see a use case to test non public methods? |
I would have to disagree with @Guergeiro, it's not as if private/protected methods are accessible all the time - you'd have to directly explicitly use rhum to do this - plus, we can't count on other API's having getters and setters. |
Testing private methods should be done with Reflection and not with a method that changes the class itself. |
so should we mimic a reflection API? |
That method is an API for the end user... That's the issue. An API shouldn't expose everything to the user, specially something which is related to the framework internal behaviour and not useful in anyway besides framework maintainers. |
Yeah i guess i see your point - i mean we take that approach with drashland modules already (or any code) |
Breno makes a good point. we will add documentation on how to reflect classes to test non-public members, but we will not be exposing an API to do it for users. |
Fixes #19
Description
getNonPublicPropertyValue()
invokeNonPublicMethod()