Skip to content

Commit

Permalink
Merge pull request #1 from ajgarlag/pull-35944
Browse files Browse the repository at this point in the history
Test to prevent a future regression
  • Loading branch information
thlbaut committed Mar 6, 2020
2 parents 3d9ef9b + 7c39669 commit 573600a
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
Expand Up @@ -320,10 +320,6 @@ private function hasUserChanged(UserInterface $user): bool
$currentUserRoles = array_map('strval', (array) $this->user->getRoles());
$userRoles = array_map('strval', (array) $user->getRoles());

if ($this instanceof SwitchUserToken) {
$userRoles[] = 'ROLE_PREVIOUS_ADMIN';
}

if (\count($userRoles) !== \count($currentUserRoles) || \count($userRoles) !== \count(array_intersect($userRoles, $currentUserRoles))) {
return true;
}
Expand Down
Expand Up @@ -238,7 +238,7 @@ public function getUserChangesAdvancedUser()
*/
public function testSetUserDoesNotSetAuthenticatedToFalseWhenUserDoesNotChange($user)
{
$token = new ConcreteToken();
$token = new ConcreteToken(['ROLE_FOO']);
$token->setAuthenticated(true);
$this->assertTrue($token->isAuthenticated());

Expand Down

0 comments on commit 573600a

Please sign in to comment.