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

Support for inline data providers declaration #38

Closed
Luxian opened this issue Nov 13, 2019 · 1 comment · Fixed by #40
Closed

Support for inline data providers declaration #38

Luxian opened this issue Nov 13, 2019 · 1 comment · Fixed by #40

Comments

@Luxian
Copy link

Luxian commented Nov 13, 2019

I'm getting UndefinedMethod and PossiblyUnusedMethod false positives when I declare my data providers like this:

/** @dataProvider getTestCases */

Because the parser adds an extra space a the end of the method name.
This can be fixed by changing the following line:

-$apparent_provider_method_name = $class_storage->name . '::' . (string) $provider;
+$apparent_provider_method_name = $class_storage->name . '::' . trim((string) $provider);

But this doesn't fix the PossiblyUnusedMethod error for that constructor.

Any ideas how to properly fix this?

PS: I wanted to send a PR with a test, but I can't get composer test to run without errors on my machine before doing my changes. Is this a known issue (test failing) that I can ignore or am I doing something wrong?

@weirdan
Copy link
Member

weirdan commented Nov 17, 2019

There are issues with tests, some of them are fixed in #39 .

weirdan added a commit to weirdan/phpunit-psalm-plugin that referenced this issue Nov 17, 2019
weirdan added a commit to weirdan/phpunit-psalm-plugin that referenced this issue Nov 27, 2019
@weirdan weirdan mentioned this issue Nov 27, 2019
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.

2 participants