Skip to content

Commit 5aa0d77

Browse files
committed
test string interpolations
1 parent d91af03 commit 5aa0d77

3 files changed

Lines changed: 10 additions & 0 deletions

File tree

tests/PHPStan/Rules/Keywords/RequireFileExistsRuleNoConstantPathTest.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@ public function testBug12203NoConstantPath(): void
3737
"Path in require_once() __DIR__ . '/' . \$path . '/' . \$file is not a file or it does not exist.",
3838
10,
3939
],
40+
[
41+
'Path in require_once() __DIR__ . "{$path}/{$file}" is not a file or it does not exist.',
42+
12,
43+
],
4044
]);
4145
}
4246

tests/PHPStan/Rules/Keywords/RequireFileExistsRuleTest.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,10 @@ public function testBug12203(): void
140140
"Path in require_once() __DIR__ . '/' . \$path . '/' . \$file is not a file or it does not exist.",
141141
10,
142142
],
143+
[
144+
'Path in require_once() __DIR__ . "{$path}/{$file}" is not a file or it does not exist.',
145+
12,
146+
],
143147
]);
144148
}
145149

tests/PHPStan/Rules/Keywords/data/bug-12203.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,5 @@
88
$path = '..';
99
$file = 'bug-12203-sure-does-not-exist.php';
1010
require_once __DIR__ . '/'. $path .'/'. $file;
11+
12+
require_once __DIR__ . "$path/$file";

0 commit comments

Comments
 (0)