Skip to content

Commit 8c38f6e

Browse files
committed
fixes
1 parent c4bd582 commit 8c38f6e

File tree

3 files changed

+12
-7
lines changed

3 files changed

+12
-7
lines changed

src/Symfony/Component/Security/Http/Firewall/ContextListener.php

+4-2
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ protected function refreshUser(TokenInterface $token)
150150
return $token;
151151
}
152152

153-
$exceptions = [];
153+
$exceptions = array();
154154
foreach ($this->userProviders as $provider) {
155155
try {
156156
$refreshedUser = $provider->refreshUser($user);
@@ -165,7 +165,7 @@ protected function refreshUser(TokenInterface $token)
165165
// let's try the next user provider
166166
} catch (UsernameNotFoundException $notFound) {
167167
// let's try the next user provider
168-
$exceptions[] = [$notFound, $provider];
168+
$exceptions[] = array($notFound, $provider);
169169
}
170170
}
171171

@@ -179,6 +179,8 @@ protected function refreshUser(TokenInterface $token)
179179
$this->logger->warning('Username could not be found in the selected user provider.', array('username' => $notFound->getUsername(), 'provider' => get_class($provider)));
180180
}
181181
}
182+
183+
return;
182184
}
183185

184186
throw new \RuntimeException(sprintf('There is no user provider for user "%s".', get_class($user)));

src/Symfony/Component/Security/Http/Tests/Firewall/ContextListenerTest.php

+4-2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
use Symfony\Component\EventDispatcher\EventDispatcher;
2525
use Symfony\Component\Security\Core\User\InMemoryUserProvider;
2626
use Symfony\Component\Security\Http\Firewall\ContextListener;
27-
use Symfony\Component\Security\Tests\Fixtures\Core\SimpleSecurityContext;
27+
use Symfony\Component\Security\Http\Tests\Fixtures\SimpleSecurityContext;
2828

2929
class ContextListenerTest extends TestCase
3030
{
@@ -254,7 +254,9 @@ public function testCanRefreshUserWithIdenticalSupportedProviders()
254254
$session = new Session(new MockArraySessionStorage());
255255

256256
/** @var \Symfony\Component\HttpFoundation\Request $request */
257-
$request = $this->getMock('Symfony\Component\HttpFoundation\Request');
257+
$request = $this->getMockBuilder('Symfony\Component\HttpFoundation\Request')
258+
->disableOriginalConstructor()
259+
->getMock();
258260
$request->expects($this->any())->method('hasPreviousSession')->will($this->returnValue(true));
259261
$request->expects($this->any())->method('getSession')->will($this->returnValue($session));
260262

src/Symfony/Component/Security/Tests/Fixtures/Core/SimpleSecurityContext.php renamed to src/Symfony/Component/Security/Http/Tests/Fixtures/SimpleSecurityContext.php

+4-3
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,13 @@
99
* file that was distributed with this source code.
1010
*/
1111

12-
namespace Symfony\Component\Security\Tests\Fixtures\Core;
12+
namespace Symfony\Component\Security\Http\Tests\Fixtures;
1313

14+
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
1415
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
15-
use Symfony\Component\Security\Core\SecurityContextInterface;
16+
use Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface;
1617

17-
class SimpleSecurityContext implements SecurityContextInterface
18+
class SimpleSecurityContext implements AuthorizationCheckerInterface, TokenStorageInterface
1819
{
1920
protected $token;
2021

0 commit comments

Comments
 (0)