Scheb\TwoFactorBundle\Security\TwoFactor\AuthenticationContext::getUser PHP Method

getUser() public method

{@inheritDoc}
public getUser ( )
    public function getUser()
    {
        if (is_object($user = $this->token->getUser())) {
            return $user;
        }
        return null;
    }

Usage Example

コード例 #1
0
 /**
  * @test
  * @dataProvider dataProvider_getToken
  */
 public function getUser_objectInitialized_returnValid($userObject, $expectedReturnValue)
 {
     //Mock the TokenInterface
     $this->token->expects($this->once())->method('getUser')->will($this->returnValue($userObject));
     $returnValue = $this->authContext->getUser();
     $this->assertEquals($expectedReturnValue, $returnValue);
 }
All Usage Examples Of Scheb\TwoFactorBundle\Security\TwoFactor\AuthenticationContext::getUser