Skip to content

Add test cases for #150 #151

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

Merged
merged 1 commit into from
Nov 3, 2022
Merged

Add test cases for #150 #151

merged 1 commit into from
Nov 3, 2022

Conversation

herndlm
Copy link
Contributor

@herndlm herndlm commented Nov 2, 2022

Closes #150

@herndlm
Copy link
Contributor Author

herndlm commented Nov 2, 2022

Oh, it indeed starts failing with the described error if f4f29ab is reverted. I can only assume that it was fixed by that commit. and that makes sense to me too.
details / state of the current release 1.2.1:

There were 2 failures:

1) PHPStan\Type\WebMozartAssert\AssertTypeSpecifyingExtensionTest::testFileAsserts with data set "/Users/herndlm/Development/source/git-forks/phpstan-webmozart-assert/tests/Type/WebMozartAssert/data/bug-150.php:23" ('type', '/Users/herndlm/Development/so...50.php', PHPStan\Type\Constant\ConstantStringType Object (...), PHPStan\Type\NeverType Object (...), 23)
Expected type class-string<WebmozartAssertBug150\SniffInterface>, got type *NEVER* in /Users/herndlm/Development/source/git-forks/phpstan-webmozart-assert/tests/Type/WebMozartAssert/data/bug-150.php on line 23.
Failed asserting that two strings are identical.
--- Expected
+++ Actual
@@ @@
-'class-string<WebmozartAssertBug150\SniffInterface>'
+'*NEVER*'

phar:///Users/herndlm/Development/source/git-forks/phpstan-webmozart-assert/vendor/phpstan/phpstan/phpstan.phar/src/Testing/TypeInferenceTestCase.php:60
/Users/herndlm/Development/source/git-forks/phpstan-webmozart-assert/tests/Type/WebMozartAssert/AssertTypeSpecifyingExtensionTest.php:35

2) PHPStan\Type\WebMozartAssert\ImpossibleCheckTypeMethodCallRuleTest::testBug150
Failed asserting that two strings are identical.
--- Expected
+++ Actual
@@ @@
-'
+'22: Call to static method Webmozart\Assert\Assert::implementsInterface() with class-string and 'WebmozartAssertBug150\\SniffInterface' will always evaluate to false.
 '

phar:///Users/herndlm/Development/source/git-forks/phpstan-webmozart-assert/vendor/phpstan/phpstan/phpstan.phar/src/Testing/RuleTestCase.php:104
/Users/herndlm/Development/source/git-forks/phpstan-webmozart-assert/tests/Type/WebMozartAssert/ImpossibleCheckTypeMethodCallRuleTest.php:215

@ondrejmirtes ondrejmirtes merged commit 01259f5 into phpstan:1.2.x Nov 3, 2022
@ondrejmirtes
Copy link
Member

Thank you!

@herndlm herndlm deleted the bug-150 branch November 3, 2022 15:42
@VincentLanglet
Copy link

Is it possible to have a new release since the bug exists on the latest release ? :)

@ondrejmirtes
Copy link
Member

Done

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 this pull request may close these issues.

Issue with implementsInterface
3 participants