Skip to content

Commit cbeb5be

Browse files
committed
fix strpos empty needle
1 parent b814750 commit cbeb5be

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/Handler/SpecHandler/Comparer/ContainsComparer.php

+3
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ public function compare(?string $pattern, ?string $actual): bool
1414
if (is_null($pattern) || is_null($actual)) {
1515
return false;
1616
}
17+
if ($pattern === '') {
18+
return true;
19+
}
1720
return strpos($actual, $pattern) !== false;
1821
}
1922
}

0 commit comments

Comments
 (0)