getProvisioningUri() public method

public getProvisioningUri ( )
 /**
  * @dataProvider testProvisioningURIData
  */
 public function testProvisioningURI($secret, $label, $counter, $issuer, $expectedResult, $exception = null, $message = null)
 {
     $hotp = new HOTP($secret);
     try {
         $hotp->setLabel($label);
         $hotp->setIssuer($issuer);
         $hotp->setInitialCount($counter);
         $this->assertEquals($expectedResult, $hotp->getProvisioningUri());
         if ($exception !== null) {
             $this->fail("The expected exception '{$exception}' was not thrown");
         }
     } catch (\Exception $e) {
         if (!$exception || !$e instanceof $exception) {
             throw $e;
         }
         $this->assertEquals($message, $e->getMessage());
     }
 }
Ejemplo n.º 2
0
 /**
  * @expectedException \InvalidArgumentException
  * @expectedExceptionMessage No label defined.
  */
 public function testLabelNotDefined()
 {
     $otp = new HOTP();
     $otp->getProvisioningUri();
 }