SwitchUserRoleTest.php 886 B

123456789101112131415161718192021222324252627282930
  1. <?php
  2. /*
  3. * This file is part of the Symfony package.
  4. * (c) Fabien Potencier <fabien.potencier@symfony-project.com>
  5. *
  6. * For the full copyright and license information, please view the LICENSE
  7. * file that was distributed with this source code.
  8. */
  9. namespace Symfony\Tests\Component\Security\Role;
  10. use Symfony\Component\Security\Role\SwitchUserRole;
  11. class SwitchUserRoleTest extends \PHPUnit_Framework_TestCase
  12. {
  13. public function testGetSource()
  14. {
  15. $role = new SwitchUserRole('FOO', $token = $this->getMock('Symfony\Component\Security\Authentication\Token\TokenInterface'));
  16. $this->assertSame($token, $role->getSource());
  17. }
  18. public function testGetRole()
  19. {
  20. $role = new SwitchUserRole('FOO', $this->getMock('Symfony\Component\Security\Authentication\Token\TokenInterface'));
  21. $this->assertEquals('FOO', $role->getRole());
  22. }
  23. }