Skip to content

Commit d0d23b4

Browse files
committed
Merge branch '5.4' into 6.2
* 5.4: Fix LICENSE CI check fixes retrieving multiple values for extra fields [String] Remove duplicates in fold maps fail with a meaningful error when a needed package is missing [DependencyInjection] Fix combinatory explosion when autowiring union and intersection types Update license years (last time) [Tests] New iteration of removing `$this` occurrences in future static data providers
2 parents 77c95ea + 3b0093b commit d0d23b4

File tree

2 files changed

+14
-7
lines changed

2 files changed

+14
-7
lines changed

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright (c) 2004-2023 Fabien Potencier
1+
Copyright (c) 2004-present Fabien Potencier
22

33
Permission is hereby granted, free of charge, to any person obtaining a copy
44
of this software and associated documentation files (the "Software"), to deal

Tests/Authentication/DefaultAuthenticationSuccessHandlerTest.php

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,26 @@ public function testRequestRedirections(Request $request, $options, $redirectedU
3838
$this->assertSame('http://localhost'.$redirectedUrl, $handler->onAuthenticationSuccess($request, $token)->getTargetUrl());
3939
}
4040

41-
public function getRequestRedirections()
41+
public function testRequestRedirectionsWithTargetPathInSessions()
4242
{
4343
$session = $this->createMock(SessionInterface::class);
4444
$session->expects($this->once())->method('get')->with('_security.admin.target_path')->willReturn('/admin/dashboard');
4545
$session->expects($this->once())->method('remove')->with('_security.admin.target_path');
4646
$requestWithSession = Request::create('/');
4747
$requestWithSession->setSession($session);
4848

49+
$urlGenerator = $this->createMock(UrlGeneratorInterface::class);
50+
$urlGenerator->expects($this->any())->method('generate')->willReturn('http://localhost/login');
51+
$httpUtils = new HttpUtils($urlGenerator);
52+
$token = $this->createMock(TokenInterface::class);
53+
$handler = new DefaultAuthenticationSuccessHandler($httpUtils);
54+
$handler->setFirewallName('admin');
55+
56+
$this->assertSame('http://localhost/admin/dashboard', $handler->onAuthenticationSuccess($requestWithSession, $token)->getTargetUrl());
57+
}
58+
59+
public static function getRequestRedirections()
60+
{
4961
return [
5062
'default' => [
5163
Request::create('/'),
@@ -72,11 +84,6 @@ public function getRequestRedirections()
7284
['target_path_parameter' => '_target_path[value]'],
7385
'/dashboard',
7486
],
75-
'target path in session' => [
76-
$requestWithSession,
77-
[],
78-
'/admin/dashboard',
79-
],
8087
'target path as referer' => [
8188
Request::create('/', 'GET', [], [], [], ['HTTP_REFERER' => 'http://localhost/dashboard']),
8289
['use_referer' => true],

0 commit comments

Comments
 (0)