Skip to content

Commit

Permalink
Creating Fail and Fail-Like Tests
Browse files Browse the repository at this point in the history
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/'.
  • Loading branch information
issidorov committed Aug 21, 2024
1 parent 2cbd8b0 commit bdd3641
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions tests/MixinAnnotationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -639,6 +639,34 @@ class A {}
(new A)->foo = "bar";',
'error_message' => 'UndefinedPropertyAssignment',
],
'undefinedMixinClassWithPropertyAssignment_WithMagicMethod' => [
'code' => '<?php
/**
* @property string $baz
* @mixin B
*/
class A {
public function __set(string $name, string $value) {}
}
(new A)->foo = "bar";',
'error_message' => 'UndefinedMagicPropertyAssignment',
],
'undefinedMixinClassWithPropertyAssignment_WithMagicMethod_Similar' => [
'code' => '<?php
/**
* @property string $baz
* @mixin B
*/
class A {
public function __set(string $name, string $value) {}
}
/* this is difference */
$a = new A();
$a->foo = "bar";',
'error_message' => 'UndefinedMagicPropertyAssignment',
],
'undefinedMixinClassWithMethodCall' => [
'code' => '<?php
/** @mixin B */
Expand Down

0 comments on commit bdd3641

Please sign in to comment.