Skip to content

responseHeaderEquals() can no longer be used to check for existence #862

@longwave

Description

@longwave

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.

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