Skip to content

Commit 39d559d

Browse files
Add tests
1 parent 7cc7b73 commit 39d559d

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

tests/PHPStan/Analyser/nsrt/bug-12312.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ public function sayLowercase(string $s): void
1414
if ($s != '') {
1515
assertType('lowercase-string&non-empty-string', $s);
1616
}
17+
if ('' != $s) {
18+
assertType('lowercase-string&non-empty-string', $s);
19+
}
1720
assertType('lowercase-string', $s);
1821
}
1922

@@ -25,6 +28,9 @@ public function sayUppercase(string $s): void
2528
if ($s != '') {
2629
assertType('non-empty-string&uppercase-string', $s);
2730
}
31+
if ('' != $s) {
32+
assertType('non-empty-string&uppercase-string', $s);
33+
}
2834
assertType('uppercase-string', $s);
2935
}
3036

@@ -36,6 +42,9 @@ public function sayBoth(string $s): void
3642
if ($s != '') {
3743
assertType('lowercase-string&non-empty-string&uppercase-string', $s);
3844
}
45+
if ('' != $s) {
46+
assertType('lowercase-string&non-empty-string&uppercase-string', $s);
47+
}
3948
assertType('lowercase-string&uppercase-string', $s);
4049
}
4150
}

0 commit comments

Comments
 (0)