assertEquals($cookieNames, $handler->getCookieNames()); } public function testLogout() { $request = new Request(); $response = new Response(); $token = $this->getMock('Symfony\Component\Security\Authentication\Token\TokenInterface'); $handler = new CookieClearingLogoutHandler(array('foo', 'foo2')); $this->assertFalse($response->headers->has('Set-Cookie')); $handler->logout($request, $response, $token); $headers = $response->headers->all(); $cookies = $headers['set-cookie']; $this->assertEquals(2, count($cookies)); $cookie = $cookies[0]; $this->assertStringStartsWith('foo=;', $cookie); $cookie = $cookies[1]; $this->assertStringStartsWith('foo2=;', $cookie); } }