Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. WebAssert.php

function WebAssert::cookieEquals

Checks that specified cookie exists and its value equals to a given one.

Parameters

string $name cookie name:

string $value cookie value:

Return value

void

Throws

ExpectationException

File

vendor/behat/mink/src/WebAssert.php, line 106

Class

WebAssert
Mink web assertions tool.

Namespace

Behat\Mink

Code

public function cookieEquals(string $name, string $value) {
    $this->cookieExists($name);
    $actualValue = $this->session
        ->getCookie($name);
    $message = sprintf('Cookie "%s" value is "%s", but should be "%s".', $name, $actualValue, $value);
    $this->assert($actualValue == $value, $message);
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal