Now function WebAssert::responseContains does comparison in case-insensitive mode because of usage stripos php function:
|
public function responseContains($text) |
|
{ |
|
$actual = $this->session->getPage()->getContent(); |
|
$message = sprintf('The string "%s" was not found anywhere in the HTML response of the current page.', $text); |
|
|
|
$this->assert(stripos($actual, (string) $text) !== false, $message); |
|
} |
And I see no ways to make case-sensitive comparison. So will be good to add option to enable case-sensitive comparison mode via some option. Or it is already exists, please point me out to the solution.
And will be good to explain that this function does case-sensitive comparison by default, because it is a surprise for many developers. For example, this nuance brings that issue in Drupal module: https://www.drupal.org/project/layout_builder_restrictions/issues/3278651
Now function
WebAssert::responseContainsdoes comparison in case-insensitive mode because of usagestriposphp function:Mink/src/WebAssert.php
Lines 319 to 325 in 34c0ae0
And I see no ways to make case-sensitive comparison. So will be good to add option to enable case-sensitive comparison mode via some option. Or it is already exists, please point me out to the solution.
And will be good to explain that this function does case-sensitive comparison by default, because it is a surprise for many developers. For example, this nuance brings that issue in Drupal module: https://www.drupal.org/project/layout_builder_restrictions/issues/3278651