Skip to content

Commit 0543a24

Browse files
Fix tests
1 parent 3b11d00 commit 0543a24

File tree

1 file changed

+20
-9
lines changed

1 file changed

+20
-9
lines changed

tests/PHPStan/Rules/Comparison/StrictComparisonOfDifferentTypesRuleTest.php

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,8 @@ public function testStrictComparison(): void
277277
[
278278
'Strict comparison using === between lowercase-string|false and \'AB\' will always evaluate to false.',
279279
1014,
280-
$tipText,
280+
"• 'AB' is not lowercase.
281+
• Because the type is coming from a PHPDoc, you can turn off this check by setting <fg=cyan>treatPhpDocTypesAsCertain: false</> in your <fg=cyan>%configurationFile%</>.",
281282
],
282283
[
283284
'Strict comparison using === between mixed and null will always evaluate to false.',
@@ -1098,41 +1099,48 @@ public function testLowercaseString(): void
10981099
[
10991100
"Strict comparison using === between lowercase-string and 'AB' will always evaluate to false.",
11001101
10,
1101-
'Because the type is coming from a PHPDoc, you can turn off this check by setting <fg=cyan>treatPhpDocTypesAsCertain: false</> in your <fg=cyan>%configurationFile%</>.',
1102+
"• 'AB' is not lowercase.
1103+
• Because the type is coming from a PHPDoc, you can turn off this check by setting <fg=cyan>treatPhpDocTypesAsCertain: false</> in your <fg=cyan>%configurationFile%</>.",
11021104
],
11031105
[
11041106
"Strict comparison using === between 'AB' and lowercase-string will always evaluate to false.",
11051107
11,
1106-
'Because the type is coming from a PHPDoc, you can turn off this check by setting <fg=cyan>treatPhpDocTypesAsCertain: false</> in your <fg=cyan>%configurationFile%</>.',
1108+
"• 'AB' is not lowercase.
1109+
• Because the type is coming from a PHPDoc, you can turn off this check by setting <fg=cyan>treatPhpDocTypesAsCertain: false</> in your <fg=cyan>%configurationFile%</>.",
11071110
],
11081111
[
11091112
"Strict comparison using !== between 'AB' and lowercase-string will always evaluate to true.",
11101113
12,
1111-
'Because the type is coming from a PHPDoc, you can turn off this check by setting <fg=cyan>treatPhpDocTypesAsCertain: false</> in your <fg=cyan>%configurationFile%</>.',
1114+
"• 'AB' is not lowercase.
1115+
• Because the type is coming from a PHPDoc, you can turn off this check by setting <fg=cyan>treatPhpDocTypesAsCertain: false</> in your <fg=cyan>%configurationFile%</>.",
11121116
],
11131117
[
11141118
"Strict comparison using === between lowercase-string and 'aBc' will always evaluate to false.",
11151119
15,
1116-
'Because the type is coming from a PHPDoc, you can turn off this check by setting <fg=cyan>treatPhpDocTypesAsCertain: false</> in your <fg=cyan>%configurationFile%</>.',
1120+
"• 'aBc' is not lowercase.
1121+
• Because the type is coming from a PHPDoc, you can turn off this check by setting <fg=cyan>treatPhpDocTypesAsCertain: false</> in your <fg=cyan>%configurationFile%</>.",
11171122
],
11181123
[
11191124
"Strict comparison using !== between lowercase-string and 'aBc' will always evaluate to true.",
11201125
16,
1121-
'Because the type is coming from a PHPDoc, you can turn off this check by setting <fg=cyan>treatPhpDocTypesAsCertain: false</> in your <fg=cyan>%configurationFile%</>.',
1126+
"• 'aBc' is not lowercase.
1127+
• Because the type is coming from a PHPDoc, you can turn off this check by setting <fg=cyan>treatPhpDocTypesAsCertain: false</> in your <fg=cyan>%configurationFile%</>.",
11221128
],
11231129
];
11241130

11251131
if (PHP_VERSION_ID < 80000) {
11261132
$errors[] = [
11271133
"Strict comparison using === between lowercase-string|false and 'AB' will always evaluate to false.",
11281134
28,
1129-
'Because the type is coming from a PHPDoc, you can turn off this check by setting <fg=cyan>treatPhpDocTypesAsCertain: false</> in your <fg=cyan>%configurationFile%</>.',
1135+
"• 'AB' is not lowercase.
1136+
• Because the type is coming from a PHPDoc, you can turn off this check by setting <fg=cyan>treatPhpDocTypesAsCertain: false</> in your <fg=cyan>%configurationFile%</>.",
11301137
];
11311138
} else {
11321139
$errors[] = [
11331140
"Strict comparison using === between lowercase-string and 'AB' will always evaluate to false.",
11341141
28,
1135-
'Because the type is coming from a PHPDoc, you can turn off this check by setting <fg=cyan>treatPhpDocTypesAsCertain: false</> in your <fg=cyan>%configurationFile%</>.',
1142+
"• 'AB' is not lowercase.
1143+
• Because the type is coming from a PHPDoc, you can turn off this check by setting <fg=cyan>treatPhpDocTypesAsCertain: false</> in your <fg=cyan>%configurationFile%</>.",
11361144
];
11371145
}
11381146

@@ -1153,15 +1161,18 @@ public function testHashing(): void
11531161
[
11541162
"Strict comparison using === between lowercase-string&non-falsy-string and 'ABC' will always evaluate to false.",
11551163
9,
1164+
"'ABC' is not lowercase.",
11561165
],
11571166
[
11581167
"Strict comparison using === between (lowercase-string&non-falsy-string)|false and 'ABC' will always evaluate to false.",
11591168
12,
1169+
"'ABC' is not lowercase.",
11601170
],
11611171
[
11621172
"Strict comparison using === between (lowercase-string&non-falsy-string)|(non-falsy-string&numeric-string) and 'A' will always evaluate to false.",
11631173
31,
1164-
'Because the type is coming from a PHPDoc, you can turn off this check by setting <fg=cyan>treatPhpDocTypesAsCertain: false</> in your <fg=cyan>%configurationFile%</>.',
1174+
"• 'A' is not lowercase.
1175+
• Because the type is coming from a PHPDoc, you can turn off this check by setting <fg=cyan>treatPhpDocTypesAsCertain: false</> in your <fg=cyan>%configurationFile%</>.",
11651176
],
11661177
]);
11671178
}

0 commit comments

Comments
 (0)