Skip to content

Commit 5d36ee9

Browse files
committed
Another test
1 parent ae7f2ad commit 5d36ee9

File tree

2 files changed

+23
-1
lines changed

2 files changed

+23
-1
lines changed

tests/PHPStan/Rules/Functions/CallToNonExistentFunctionRuleTest.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,13 @@ public function testBug10003(): void
260260

261261
public function testRememberFunctionExistsFromConstructor(): void
262262
{
263-
$this->analyse([__DIR__ . '/data/remember-function-exists-from-constructor.php'], []);
263+
$this->analyse([__DIR__ . '/data/remember-function-exists-from-constructor.php'], [
264+
[
265+
'Function another_unknown_function not found.',
266+
32,
267+
'Learn more at https://phpstan.org/user-guide/discovering-symbols',
268+
]
269+
]);
264270
}
265271

266272
}

tests/PHPStan/Rules/Functions/data/remember-function-exists-from-constructor.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,19 @@ public function doFoo(): void
1717
}
1818

1919
}
20+
21+
class FooUser
22+
{
23+
public function __construct(
24+
) {
25+
if (!function_exists('another_unknown_function')) {
26+
echo 'Function another_unknown_function does not exist';
27+
}
28+
}
29+
30+
public function doFoo(): void
31+
{
32+
another_unknown_function();
33+
}
34+
35+
}

0 commit comments

Comments
 (0)