phpstan / phpstan-webmozart-assert

PHPStan extension for webmozart/assert
160 stars 27 forks source link

Add test cases for #150 #151

Closed herndlm closed 1 year ago

herndlm commented 1 year ago

Closes #150

herndlm commented 1 year ago

Oh, it indeed starts failing with the described error if f4f29ab2cc0bc1d2851c2758ff45cb2d65a271e5 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 commented 1 year ago

Thank you!

VincentLanglet commented 1 year ago

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

ondrejmirtes commented 1 year ago

Done