Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
VincentLanglet committed Nov 19, 2024
1 parent 3b11d00 commit d012b6a
Showing 1 changed file with 20 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,8 @@ public function testStrictComparison(): void
[
'Strict comparison using === between lowercase-string|false and \'AB\' will always evaluate to false.',
1014,
$tipText,
"• 'AB' is not lowercase
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%</>.",
],
[
'Strict comparison using === between mixed and null will always evaluate to false.',
Expand Down Expand Up @@ -1098,41 +1099,48 @@ public function testLowercaseString(): void
[
"Strict comparison using === between lowercase-string and 'AB' will always evaluate to false.",
10,
'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%</>.',
"• 'AB' is not lowercase.
• 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%</>.",
],
[
"Strict comparison using === between 'AB' and lowercase-string will always evaluate to false.",
11,
'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%</>.',
"• 'AB' is not lowercase.
• 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%</>.",
],
[
"Strict comparison using !== between 'AB' and lowercase-string will always evaluate to true.",
12,
'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%</>.',
"• 'AB' is not lowercase.
• 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%</>.",
],
[
"Strict comparison using === between lowercase-string and 'aBc' will always evaluate to false.",
15,
'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%</>.',
"• 'aBc' is not lowercase.
• 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%</>.",
],
[
"Strict comparison using !== between lowercase-string and 'aBc' will always evaluate to true.",
16,
'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%</>.',
"• 'aBc' is not lowercase.
• 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%</>.",
],
];

if (PHP_VERSION_ID < 80000) {
$errors[] = [
"Strict comparison using === between lowercase-string|false and 'AB' will always evaluate to false.",
28,
'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%</>.',
"• 'AB' is not lowercase.
• 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%</>.",
];
} else {
$errors[] = [
"Strict comparison using === between lowercase-string and 'AB' will always evaluate to false.",
28,
'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%</>.',
"• 'AB' is not lowercase.
• 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%</>.",
];
}

Expand All @@ -1153,15 +1161,18 @@ public function testHashing(): void
[
"Strict comparison using === between lowercase-string&non-falsy-string and 'ABC' will always evaluate to false.",
9,
"'ABC' is not lowercase.",
],
[
"Strict comparison using === between (lowercase-string&non-falsy-string)|false and 'ABC' will always evaluate to false.",
12,
"'ABC' is not lowercase.",
],
[
"Strict comparison using === between (lowercase-string&non-falsy-string)|(non-falsy-string&numeric-string) and 'A' will always evaluate to false.",
31,
'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%</>.',
"• 'A' is not lowercase.
• 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%</>.",
],
]);
}
Expand Down

0 comments on commit d012b6a

Please sign in to comment.