You are here

public function WebAssert::cookieEquals in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/behat/mink/src/WebAssert.php \Behat\Mink\WebAssert::cookieEquals()

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

Parameters

string $name cookie name:

string $value cookie value:

Throws

ExpectationException

File

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

Class

WebAssert
Mink web assertions tool.

Namespace

Behat\Mink

Code

public function cookieEquals($name, $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);
}