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

Appearance settings

Commit eaca085

Browse filesBrowse files
[SecurityBundle] fix failing test
1 parent 83a1061 commit eaca085
Copy full SHA for eaca085

File tree

1 file changed

+5
-1
lines changed
Filter options

1 file changed

+5
-1
lines changed

‎src/Symfony/Bundle/SecurityBundle/Tests/Functional/SwitchUserTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/SecurityBundle/Tests/Functional/SwitchUserTest.php
+5-1Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ public function testSwitchUser($originalUser, $targetUser, $expectedUser, $expec
2525

2626
$client->request('GET', '/profile?_switch_user='.$targetUser);
2727

28+
if ('user_does_not_exist' === $targetUser && 403 === $expectedStatus && 500 === $client->getResponse()->getStatusCode()) {
29+
$expectedStatus = 500; // 403 is generated by Symfony >= 4.3.8
30+
}
31+
2832
$this->assertEquals($expectedStatus, $client->getResponse()->getStatusCode());
2933
$this->assertEquals($expectedUser, $client->getProfile()->getCollector('security')->getUser());
3034
}
@@ -68,7 +72,7 @@ public function getTestParameters()
6872
return [
6973
'unauthorized_user_cannot_switch' => ['user_cannot_switch_1', 'user_cannot_switch_1', 'user_cannot_switch_1', 403],
7074
'authorized_user_can_switch' => ['user_can_switch', 'user_cannot_switch_1', 'user_cannot_switch_1', 200],
71-
'authorized_user_cannot_switch_to_non_existent' => ['user_can_switch', 'user_does_not_exist', 'user_can_switch', 500],
75+
'authorized_user_cannot_switch_to_non_existent' => ['user_can_switch', 'user_does_not_exist', 'user_can_switch', 403],
7276
'authorized_user_can_switch_to_himself' => ['user_can_switch', 'user_can_switch', 'user_can_switch', 200],
7377
];
7478
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.