fixed CS
This commit is contained in:
parent
8b636ef18e
commit
6c4ab8942e
@ -1619,7 +1619,7 @@ class FilesystemTest extends FilesystemTestCase
|
||||
|
||||
$this->filesystem->dumpFile($filename, 'foo');
|
||||
|
||||
$this->filesystem->appendToFile($filename, array('bar'));
|
||||
$this->filesystem->appendToFile($filename, ['bar']);
|
||||
|
||||
$this->assertFileExists($filename);
|
||||
$this->assertStringEqualsFile($filename, 'foobar');
|
||||
|
@ -36,15 +36,15 @@ class RoleHierarchyTest extends TestCase
|
||||
|
||||
public function testGetReachableRoleNames()
|
||||
{
|
||||
$role = new RoleHierarchy(array(
|
||||
'ROLE_ADMIN' => array('ROLE_USER'),
|
||||
'ROLE_SUPER_ADMIN' => array('ROLE_ADMIN', 'ROLE_FOO'),
|
||||
));
|
||||
$role = new RoleHierarchy([
|
||||
'ROLE_ADMIN' => ['ROLE_USER'],
|
||||
'ROLE_SUPER_ADMIN' => ['ROLE_ADMIN', 'ROLE_FOO'],
|
||||
]);
|
||||
|
||||
$this->assertEquals(array('ROLE_USER'), $role->getReachableRoleNames(array('ROLE_USER')));
|
||||
$this->assertEquals(array('ROLE_FOO'), $role->getReachableRoleNames(array('ROLE_FOO')));
|
||||
$this->assertEquals(array('ROLE_ADMIN', 'ROLE_USER'), $role->getReachableRoleNames(array('ROLE_ADMIN')));
|
||||
$this->assertEquals(array('ROLE_FOO', 'ROLE_ADMIN', 'ROLE_USER'), $role->getReachableRoleNames(array('ROLE_FOO', 'ROLE_ADMIN')));
|
||||
$this->assertEquals(array('ROLE_SUPER_ADMIN', 'ROLE_ADMIN', 'ROLE_FOO', 'ROLE_USER'), $role->getReachableRoleNames(array('ROLE_SUPER_ADMIN')));
|
||||
$this->assertEquals(['ROLE_USER'], $role->getReachableRoleNames(['ROLE_USER']));
|
||||
$this->assertEquals(['ROLE_FOO'], $role->getReachableRoleNames(['ROLE_FOO']));
|
||||
$this->assertEquals(['ROLE_ADMIN', 'ROLE_USER'], $role->getReachableRoleNames(['ROLE_ADMIN']));
|
||||
$this->assertEquals(['ROLE_FOO', 'ROLE_ADMIN', 'ROLE_USER'], $role->getReachableRoleNames(['ROLE_FOO', 'ROLE_ADMIN']));
|
||||
$this->assertEquals(['ROLE_SUPER_ADMIN', 'ROLE_ADMIN', 'ROLE_FOO', 'ROLE_USER'], $role->getReachableRoleNames(['ROLE_SUPER_ADMIN']));
|
||||
}
|
||||
}
|
||||
|
@ -17,7 +17,6 @@ use Symfony\Component\HttpKernel\Controller\ArgumentResolver;
|
||||
use Symfony\Component\HttpKernel\Controller\ArgumentResolver\DefaultValueResolver;
|
||||
use Symfony\Component\HttpKernel\ControllerMetadata\ArgumentMetadata;
|
||||
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorage;
|
||||
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
|
||||
use Symfony\Component\Security\Core\Authentication\Token\UsernamePasswordToken;
|
||||
use Symfony\Component\Security\Core\User\UserInterface;
|
||||
use Symfony\Component\Security\Http\Controller\UserValueResolver;
|
||||
|
@ -113,8 +113,8 @@ class SwitchUserListenerTest extends TestCase
|
||||
*/
|
||||
public function testExitUserBasedOnSwitchUserRoleUpdatesToken()
|
||||
{
|
||||
$originalToken = new UsernamePasswordToken('username', '', 'key', array());
|
||||
$this->tokenStorage->setToken(new UsernamePasswordToken('username', '', 'key', array(new SwitchUserRole('ROLE_PREVIOUS', $originalToken, false)), $originalToken));
|
||||
$originalToken = new UsernamePasswordToken('username', '', 'key', []);
|
||||
$this->tokenStorage->setToken(new UsernamePasswordToken('username', '', 'key', [new SwitchUserRole('ROLE_PREVIOUS', $originalToken, false)], $originalToken));
|
||||
|
||||
$this->request->query->set('_switch_user', SwitchUserListener::EXIT_VALUE);
|
||||
|
||||
|
@ -16,7 +16,6 @@ use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\RequestStack;
|
||||
use Symfony\Component\Security\Core\Authentication\Token\AnonymousToken;
|
||||
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorage;
|
||||
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
|
||||
use Symfony\Component\Security\Core\Authentication\Token\UsernamePasswordToken;
|
||||
use Symfony\Component\Security\Http\Logout\LogoutUrlGenerator;
|
||||
|
||||
|
@ -5,10 +5,8 @@ namespace Symfony\Component\Workflow\Tests\EventListener;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use Symfony\Component\Security\Core\Authentication\AuthenticationTrustResolverInterface;
|
||||
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
|
||||
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
|
||||
use Symfony\Component\Security\Core\Authentication\Token\UsernamePasswordToken;
|
||||
use Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface;
|
||||
use Symfony\Component\Security\Core\Role\Role;
|
||||
use Symfony\Component\Validator\Validator\ValidatorInterface;
|
||||
use Symfony\Component\Workflow\Event\GuardEvent;
|
||||
use Symfony\Component\Workflow\EventListener\ExpressionLanguage;
|
||||
|
Reference in New Issue
Block a user