Skip to content

Commit 69fa81b

Browse files
committed
Merge branch '7.0' into 7.1
* 7.0: fix tests fix tests [Console] Fix color support
2 parents e0ec7d3 + b6cbcff commit 69fa81b

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

Tests/EventListener/CookieClearingLogoutListenerTest.php

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,9 @@ public function testLogout()
4343
$this->assertEquals('foo.foo', $cookie->getDomain());
4444
$this->assertEquals(Cookie::SAMESITE_STRICT, $cookie->getSameSite());
4545
$this->assertTrue($cookie->isSecure());
46-
$this->assertTrue($cookie->isPartitioned());
46+
if (self::doesResponseHeaderBagClearChipsCookies()) {
47+
$this->assertTrue($cookie->isPartitioned());
48+
}
4749
$this->assertTrue($cookie->isCleared());
4850

4951
$cookie = $cookies['']['/']['foo2'];
@@ -52,7 +54,20 @@ public function testLogout()
5254
$this->assertNull($cookie->getDomain());
5355
$this->assertNull($cookie->getSameSite());
5456
$this->assertFalse($cookie->isSecure());
55-
$this->assertFalse($cookie->isPartitioned());
57+
if (self::doesResponseHeaderBagClearChipsCookies()) {
58+
$this->assertFalse($cookie->isPartitioned());
59+
}
5660
$this->assertTrue($cookie->isCleared());
5761
}
62+
63+
/**
64+
* Checks if the patch from https://github.com/symfony/symfony/pull/53703 is available.
65+
*/
66+
private static function doesResponseHeaderBagClearChipsCookies(): bool
67+
{
68+
$bag = new ResponseHeaderBag();
69+
$bag->clearCookie('foo', '/', null, false, true, null, true);
70+
71+
return $bag->getCookies()[0]->isPartitioned();
72+
}
5873
}

0 commit comments

Comments
 (0)