CakeDC\Users\Test\TestCase\Controller\Component\GoogleAuthenticatorComponentTest::testVerifyCode PHP Method

testVerifyCode() public method

Testing code verification in the component
public testVerifyCode ( ) : void
return void
    public function testVerifyCode()
    {
        $this->Controller->GoogleAuthenticator->initialize([]);
        $secret = $this->Controller->GoogleAuthenticator->createSecret();
        $verificationCode = $this->Controller->GoogleAuthenticator->tfa->getCode($secret);
        $verified = $this->Controller->GoogleAuthenticator->verifyCode($secret, $verificationCode);
        $this->assertTrue($verified);
    }