You are here

public function ResponseHeaderBagTest::testRemoveCookieWithNullRemove in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/symfony/http-foundation/Tests/ResponseHeaderBagTest.php \Symfony\Component\HttpFoundation\Tests\ResponseHeaderBagTest::testRemoveCookieWithNullRemove()

File

vendor/symfony/http-foundation/Tests/ResponseHeaderBagTest.php, line 211

Class

ResponseHeaderBagTest

Namespace

Symfony\Component\HttpFoundation\Tests

Code

public function testRemoveCookieWithNullRemove() {
  $bag = new ResponseHeaderBag();
  $bag
    ->setCookie(new Cookie('foo', 'bar', 0));
  $bag
    ->setCookie(new Cookie('bar', 'foo', 0));
  $cookies = $bag
    ->getCookies(ResponseHeaderBag::COOKIES_ARRAY);
  $this
    ->assertTrue(isset($cookies['']['/']));
  $bag
    ->removeCookie('foo', null);
  $cookies = $bag
    ->getCookies(ResponseHeaderBag::COOKIES_ARRAY);
  $this
    ->assertFalse(isset($cookies['']['/']['foo']));
  $bag
    ->removeCookie('bar', null);
  $cookies = $bag
    ->getCookies(ResponseHeaderBag::COOKIES_ARRAY);
  $this
    ->assertFalse(isset($cookies['']['/']['bar']));
}