Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitab23e6f

Browse files
committed
Fixed tests (UsernamePasswordToken without roles is considered unauthenticated)
1 parentc50d6b9 commitab23e6f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public function testUserProvidersNeedToImplementAnInterface()
6363
publicfunctiontestOnKernelResponseWillAddSession()
6464
{
6565
$session =$this->runSessionOnKernelResponse(
66-
newUsernamePasswordToken(newInMemoryUser('test1','pass1'),'phpunit'),
66+
newUsernamePasswordToken(newInMemoryUser('test1','pass1'),'phpunit', ['ROLE_USER']),
6767
null
6868
);
6969

@@ -75,7 +75,7 @@ public function testOnKernelResponseWillAddSession()
7575
publicfunctiontestOnKernelResponseWillReplaceSession()
7676
{
7777
$session =$this->runSessionOnKernelResponse(
78-
newUsernamePasswordToken(newInMemoryUser('test1','pass1'),'phpunit'),
78+
newUsernamePasswordToken(newInMemoryUser('test1','pass1'),'phpunit', ['ROLE_USER']),
7979
'C:10:"serialized"'
8080
);
8181

@@ -107,7 +107,7 @@ public function testOnKernelResponseWillRemoveSessionOnAnonymousToken()
107107
publicfunctiontestOnKernelResponseWithoutSession()
108108
{
109109
$tokenStorage =newTokenStorage();
110-
$tokenStorage->setToken(newUsernamePasswordToken(newInMemoryUser('test1','pass1'),'phpunit'));
110+
$tokenStorage->setToken(newUsernamePasswordToken(newInMemoryUser('test1','pass1'),'phpunit', ['ROLE_USER']));
111111
$request =newRequest();
112112
$request->attributes->set('_security_firewall_run','_security_session');
113113
$session =newSession(newMockArraySessionStorage());

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp