From acb109f0c4ad8871c11d6df962a78255b313f463 Mon Sep 17 00:00:00 2001 From: Ondrej Mirtes Date: Mon, 9 Dec 2024 09:56:05 +0100 Subject: [PATCH] Try reproduce a bug locally --- .../Rules/Keywords/RequireFileExistsRuleTest.php | 14 ++++++++++++++ tests/PHPStan/Rules/Keywords/data/bug-12203.php | 6 ++++++ 2 files changed, 20 insertions(+) create mode 100644 tests/PHPStan/Rules/Keywords/data/bug-12203.php diff --git a/tests/PHPStan/Rules/Keywords/RequireFileExistsRuleTest.php b/tests/PHPStan/Rules/Keywords/RequireFileExistsRuleTest.php index 6bd3e1dfd7..6bc5dc45c2 100644 --- a/tests/PHPStan/Rules/Keywords/RequireFileExistsRuleTest.php +++ b/tests/PHPStan/Rules/Keywords/RequireFileExistsRuleTest.php @@ -121,4 +121,18 @@ public function testBug11738(): void $this->analyse([__DIR__ . '/data/bug-11738/bug-11738.php'], []); } + public function testBug12203(): void + { + $this->analyse([__DIR__ . '/data/bug-12203.php'], [ + [ + 'Path in require_once() "../bug-12203-sure-does-not-exist.php" is not a file or it does not exist.', + 5, + ], + [ + 'Path in require_once() "' . __DIR__ . '/data/../bug-12203-sure-does-not-exist.php" is not a file or it does not exist.', + 6, + ], + ]); + } + } diff --git a/tests/PHPStan/Rules/Keywords/data/bug-12203.php b/tests/PHPStan/Rules/Keywords/data/bug-12203.php new file mode 100644 index 0000000000..d64dcc6ebe --- /dev/null +++ b/tests/PHPStan/Rules/Keywords/data/bug-12203.php @@ -0,0 +1,6 @@ +