responseHeaderEquals() can no longer be used to check for existence
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 35/100
Research direction
Start by examining responseHeaderEquals() and getResponseHeader(), focusing on the typed $value parameter and the behavior when a header is absent. Reproduce the NULL case in the existing assertion tests, then make the supported absence check work and verify both existing-header and missing-header behavior.
Written by the indexing model from the issue text.
Description
Previously in Drupal we used responseHeaderEquals() to check for the non-existence of a header by looking for NULL:
$this->assertSession()->responseHeaderEquals('Access-Control-Allow-Origin', NULL);
Since Mink 1.11 this no longer works as $value is typed as string, although getResponseHeader() can still return NULL:
public function responseHeaderEquals(string $name, string $value)
{
$actual = $this->session->getResponseHeader($name);
There appears to be no supported way to check that a header does not exist. We had in fact already added responseHeader[Not]Exists() helper methods to Drupal, but after upgrading to Mink 1.11 we found we had not converted all cases to use them.
- Dominant language
- PHP
- Stars
- 1.6k
- Forks
- 286
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from minkphp/Mink
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 42/100
-
Difficulty 5/5 Over a week Newbie friendliness 28/100
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
getgrav/grav-plugin-api#45 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
RSS-Bridge/rss-bridge#5098 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
phingofficial/phing#2025 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
silverstripe/developer-docs#911 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100