Scheb\TwoFactorBundle\Security\TwoFactor\Trusted\TrustedComputerManager::isTrustedComputer PHP Метод

isTrustedComputer() публичный Метод

Validate a trusted computer token for a user.
public isTrustedComputer ( mixed $user, string $token ) : boolean
$user mixed
$token string
Результат boolean
    public function isTrustedComputer($user, $token)
    {
        if ($user instanceof TrustedComputerInterface) {
            return $user->isTrustedComputer($token);
        }
        return false;
    }

Usage Example

 /**
  * @test
  * @dataProvider getIsTrustedComputerReturnValues
  */
 public function isTrustedComputer_supportsTrustedComputerInterface_returnResult($userReturnValue)
 {
     $user = $this->createMock('Scheb\\TwoFactorBundle\\Model\\TrustedComputerInterface');
     $user->expects($this->any())->method('isTrustedComputer')->with('trustedToken')->willReturn($userReturnValue);
     $returnValue = $this->trustedComputerManager->isTrustedComputer($user, 'trustedToken');
     $this->assertEquals($userReturnValue, $returnValue);
 }