You are here

protected function BigPipeTest::assertCookieExists in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/big_pipe/tests/src/Functional/BigPipeTest.php \Drupal\Tests\big_pipe\Functional\BigPipeTest::assertCookieExists()

Asserts whether a cookie exists on the client or not.

2 calls to BigPipeTest::assertCookieExists()
BigPipeTest::assertBigPipeNoJsCookieExists in core/modules/big_pipe/tests/src/Functional/BigPipeTest.php
Asserts whether a BigPipe no-JS cookie exists or not.
BigPipeTest::assertSessionCookieExists in core/modules/big_pipe/tests/src/Functional/BigPipeTest.php
Asserts whether a session cookie exists or not.

File

core/modules/big_pipe/tests/src/Functional/BigPipeTest.php, line 462

Class

BigPipeTest
Tests BigPipe's no-JS detection & response delivery (with and without JS).

Namespace

Drupal\Tests\big_pipe\Functional

Code

protected function assertCookieExists($cookie_name, $expected, $cookie_label) {
  $this
    ->assertEquals($expected, !empty($this
    ->getSession()
    ->getCookie($cookie_name)), $expected ? "{$cookie_label} cookie exists." : "{$cookie_label} cookie does not exist.");
}