mirror of
https://github.com/danog/psalm.git
synced 2024-11-30 04:39:00 +01:00
added testcases with undefined constant concatination
This commit is contained in:
parent
8f98539e0a
commit
a9b9d386a9
@ -489,6 +489,30 @@ class BinaryOperationTest extends TestCase
|
|||||||
foobar($foo . $bar);
|
foobar($foo . $bar);
|
||||||
',
|
',
|
||||||
],
|
],
|
||||||
|
'concatenateNonFalsyStringWithUndefinedConstant' => [
|
||||||
|
'code' => '<?php
|
||||||
|
/**
|
||||||
|
* @param non-falsy-string $arg
|
||||||
|
* @return non-falsy-string
|
||||||
|
*/
|
||||||
|
function foo( $arg ) {
|
||||||
|
/** @psalm-suppress UndefinedConstant */
|
||||||
|
return FOO . $arg;
|
||||||
|
}
|
||||||
|
',
|
||||||
|
],
|
||||||
|
'concatenateNonEmptyStringWithUndefinedConstant' => [
|
||||||
|
'code' => '<?php
|
||||||
|
/**
|
||||||
|
* @param non-empty-string $arg
|
||||||
|
* @return non-empty-string
|
||||||
|
*/
|
||||||
|
function foo( $arg ) {
|
||||||
|
/** @psalm-suppress UndefinedConstant */
|
||||||
|
return FOO . $arg;
|
||||||
|
}
|
||||||
|
',
|
||||||
|
],
|
||||||
'possiblyInvalidAdditionOnBothSides' => [
|
'possiblyInvalidAdditionOnBothSides' => [
|
||||||
'code' => '<?php
|
'code' => '<?php
|
||||||
function foo(string $s) : int {
|
function foo(string $s) : int {
|
||||||
|
Loading…
Reference in New Issue
Block a user