OTPHP\HOTP::setCounter PHP 메소드

setCounter() 개인적인 메소드

private setCounter ( integer $counter )
$counter integer
    private function setCounter($counter)
    {
        Assertion::integer($counter, 'Counter must be at least 0.');
        Assertion::greaterOrEqualThan($counter, 0, 'Counter must be at least 0.');
        $this->setParameter('counter', $counter);
    }

Usage Example

예제 #1
0
 /**
  * @expectedException \InvalidArgumentException
  * @expectedExceptionMessage Counter must be at least 0.
  */
 public function testCounterIsNot1OrMore()
 {
     $otp = new HOTP();
     $otp->setCounter(-500);
 }