SwitchUserRoleTest.php 889 B

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