minkphp / minkphp/Mink

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

Open
#829 5 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
PHP
Stars
1.6k
Forks
286
PR merge metrics
No merged PRs in 30d

Description

Now function WebAssert::responseContains does comparison in case-insensitive mode because of usage stripos php function:
https://github.com/minkphp/Mink/blob/34c0ae0dff39b0ebfc3b028e66b60943e1bed4ce/src/WebAssert.php#L319-L325

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in src/WebAssert.php at the responseContains implementation linked in the issue, and compare it with the elementContains naming in the title. Trace how the current comparison is selected and identify the relevant documentation or tests before defining the requested option. Done means the case-sensitive behavior is available and the default comparison behavior is clearly explained.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
testing
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.