Skip to content

Commit

Permalink
Fixed a confusing test
Browse files Browse the repository at this point in the history
Apply suggestions from code review.

Co-authored-by: Bruce Weirdan <weirdan@gmail.com>
  • Loading branch information
issidorov and weirdan committed Feb 14, 2024
1 parent b7a2080 commit 662fe82
Showing 1 changed file with 29 additions and 4 deletions.
33 changes: 29 additions & 4 deletions tests/MagicMethodAnnotationTest.php
Expand Up @@ -952,16 +952,41 @@ function consumeInt(int $i): void {}
consumeInt(B::bar());',
],
'magicStaticMethodInheritanceWithoutCallStatic' => [
'code' => '<?php
'code' => <<<'PHP'
<?php
/**
* @method static int bar()
*/
class A {}
class B extends A {}
function consumeInt(int $i): void {}
/** @psalm-suppress UndefinedMethod */
consumeInt(B::bar());',
$a = B::bar();
PHP,
'assertions' => [
'$a===' => 'int',
],
'ignored_issues' => [
'UndefinedMethod',
],
],
'magicStaticMethodInheritanceWithoutCallStatic_AndWithManyArgs' => [
'code' => <<<'PHP'
<?php
/**
* @method static int bar()
*/
class A {}
class B extends A {}
$a = B::bar(123, "whatever");
PHP,
'assertions' => [
'$a===' => 'int',
],
'ignored_issues' => [
'UndefinedMethod',
'TooManyArguments',
],
],
'callUsingParent' => [
'code' => '<?php
Expand Down

0 comments on commit 662fe82

Please sign in to comment.