Skip to content

Add case-sensitive comparison option to function WebAssert::elementContains #829

Description

@MurzNN

Now function WebAssert::responseContains does comparison in case-insensitive mode because of usage stripos php function:

Mink/src/WebAssert.php

Lines 319 to 325 in 34c0ae0

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions