forked from symfony/symfony
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* 5.4: fix merge [HttpClient] mark test transient [Mime] Fix test [Translation] Fix TranslationPullCommand with ICU translations [PropertyInfo] Fix phpstan extractor issues Allow package-versions-deprecated plugin Update security.lb.xlf [Notifier] Use correct factory for the msteams transport Fix SessionListener without session in request Remove direct dependency on composer/package-versions-deprecated Remove the unused dependency on composer/package-versions-deprecated [Security/Http] Fix cookie clearing on logout [HttpClient] fix checking for recent curl consts
- Loading branch information
Showing
21 changed files
with
236 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/Symfony/Component/Security/Core/Resources/translations/security.lb.xlf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
56 changes: 56 additions & 0 deletions
56
src/Symfony/Component/Security/Http/Tests/EventListener/CookieClearingLogoutListenerTest.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the Symfony package. | ||
* | ||
* (c) Fabien Potencier <[email protected]> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Symfony\Component\Security\Http\Tests\EventListener; | ||
|
||
use PHPUnit\Framework\TestCase; | ||
use Symfony\Component\HttpFoundation\Cookie; | ||
use Symfony\Component\HttpFoundation\Request; | ||
use Symfony\Component\HttpFoundation\Response; | ||
use Symfony\Component\HttpFoundation\ResponseHeaderBag; | ||
use Symfony\Component\Security\Http\Event\LogoutEvent; | ||
use Symfony\Component\Security\Http\EventListener\CookieClearingLogoutListener; | ||
|
||
class CookieClearingLogoutListenerTest extends TestCase | ||
{ | ||
public function testLogout() | ||
{ | ||
$response = new Response(); | ||
$event = new LogoutEvent(new Request(), null); | ||
$event->setResponse($response); | ||
|
||
$listener = new CookieClearingLogoutListener(['foo' => ['path' => '/foo', 'domain' => 'foo.foo', 'secure' => true, 'samesite' => Cookie::SAMESITE_STRICT], 'foo2' => ['path' => null, 'domain' => null]]); | ||
|
||
$cookies = $response->headers->getCookies(); | ||
$this->assertCount(0, $cookies); | ||
|
||
$listener->onLogout($event); | ||
|
||
$cookies = $response->headers->getCookies(ResponseHeaderBag::COOKIES_ARRAY); | ||
$this->assertCount(2, $cookies); | ||
|
||
$cookie = $cookies['foo.foo']['/foo']['foo']; | ||
$this->assertEquals('foo', $cookie->getName()); | ||
$this->assertEquals('/foo', $cookie->getPath()); | ||
$this->assertEquals('foo.foo', $cookie->getDomain()); | ||
$this->assertEquals(Cookie::SAMESITE_STRICT, $cookie->getSameSite()); | ||
$this->assertTrue($cookie->isSecure()); | ||
$this->assertTrue($cookie->isCleared()); | ||
|
||
$cookie = $cookies['']['/']['foo2']; | ||
$this->assertStringStartsWith('foo2', $cookie->getName()); | ||
$this->assertEquals('/', $cookie->getPath()); | ||
$this->assertNull($cookie->getDomain()); | ||
$this->assertNull($cookie->getSameSite()); | ||
$this->assertFalse($cookie->isSecure()); | ||
$this->assertTrue($cookie->isCleared()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.