From bdd364140ee77ef2934f54eff32735d797debbcb Mon Sep 17 00:00:00 2001 From: Ivan Sidorov Date: Wed, 21 Aug 2024 20:38:59 +0000 Subject: [PATCH] Creating Fail and Fail-Like Tests Failed only "undefinedMixinClassWithPropertyAssignment_WithMagicMethod". Test with data "undefinedMixinClassWithPropertyAssignment_WithMagicMethod_Similar" is passed. Problem: 1) Psalm\Tests\MixinAnnotationTest::testInvalidCodeWithIssues with data set "undefinedMixinClassWithPropertyAssignment_WithMagicMethod" Failed asserting that issue with "UndefinedMagicPropertyAssignment" was emitted. Other issues reported: - UndefinedDocblockClass - src/somefile.php:6:27 - Docblock-defined class, interface or enum named B does not exist Failed asserting that false is true. 2) Psalm\Tests\MixinAnnotationTest::testInvalidCode with data set "undefinedMixinClassWithPropertyAssignment_WithMagicMethod" Failed asserting that exception message 'UndefinedDocblockClass - src/somefile.php:6:27 - Docblock-defined class, interface or enum named B does not exist' matches '/\bUndefinedMagicPropertyAssignment\b/'. --- tests/MixinAnnotationTest.php | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/tests/MixinAnnotationTest.php b/tests/MixinAnnotationTest.php index 824e582cf2e..53f9b9dd9b7 100644 --- a/tests/MixinAnnotationTest.php +++ b/tests/MixinAnnotationTest.php @@ -639,6 +639,34 @@ class A {} (new A)->foo = "bar";', 'error_message' => 'UndefinedPropertyAssignment', ], + 'undefinedMixinClassWithPropertyAssignment_WithMagicMethod' => [ + 'code' => 'foo = "bar";', + 'error_message' => 'UndefinedMagicPropertyAssignment', + ], + 'undefinedMixinClassWithPropertyAssignment_WithMagicMethod_Similar' => [ + 'code' => 'foo = "bar";', + 'error_message' => 'UndefinedMagicPropertyAssignment', + ], 'undefinedMixinClassWithMethodCall' => [ 'code' => '