/**
* @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());
}
}