Skip to content
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

Mock annotations on parent class aren't read correctly #273

Closed
bfeaver opened this issue Apr 16, 2019 · 0 comments · Fixed by #274
Closed

Mock annotations on parent class aren't read correctly #273

bfeaver opened this issue Apr 16, 2019 · 0 comments · Fixed by #274
Assignees

Comments

@bfeaver
Copy link
Collaborator

bfeaver commented Apr 16, 2019

If you have a base class for your tests that use the @Mock annotation and the class is not fully qualified in @var, it will fail to find the correct class.

Having looked into this a bit, some refactoring of how annotations work will likely solve the problem. You can get the ReflectionProperty::getDeclaredClass() to get the class that actually has the annotation and not the class you're specifically trying to mock. However, when we get the properties that have the @Mock annotation, we're only returning the string property names and not an instance of ReflectionProperty. This is the refactoring that would likely help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant