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

Unspecific assert methods not detected when called on Assert class directly #46

Closed
Majkl578 opened this issue May 10, 2019 · 4 comments · Fixed by #47
Closed

Unspecific assert methods not detected when called on Assert class directly #46

Majkl578 opened this issue May 10, 2019 · 4 comments · Fixed by #47

Comments

@Majkl578
Copy link
Contributor

The following is detected inside a test and assertNull is suggested:

$this->assertSame(null, $foo);
self::assertSame(null, $foo);

However the following is not:

Assert::assertSame(null, $foo);
@ondrejmirtes
Copy link
Member

This line should become a union of TestCase and Assert and it will start working... https://github.com/phpstan/phpstan-phpunit/blob/master/src/Rules/PHPUnit/AssertRuleHelper.php#L14

@Majkl578
Copy link
Contributor Author

Maybe it could be only Assert since TestCase extends Assert? 😅

@ondrejmirtes
Copy link
Member

ondrejmirtes commented May 10, 2019 via email

@github-actions
Copy link

github-actions bot commented May 1, 2021

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 1, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants