mirror of
https://github.com/RobThree/TwoFactorAuth.git
synced 2026-08-17 18:44:30 +00:00
2080319f6f
This change is discussed in #104 Currently, the library defaults to a QR Code Provider using an external service, thus leaking secrets. This change forces the definition of a QR Code Provider in the constructor. It is a breaking change. fixes #104
20 lines
453 B
PHP
20 lines
453 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Tests\Providers\Rng;
|
|
|
|
use PHPUnit\Framework\TestCase;
|
|
use RobThree\Auth\Algorithm;
|
|
use RobThree\Auth\TwoFactorAuth;
|
|
use Tests\Providers\Qr\TestQrProvider;
|
|
|
|
class IRNGProviderTest extends TestCase
|
|
{
|
|
public function testCreateSecret(): void
|
|
{
|
|
$tfa = new TwoFactorAuth(new TestQrProvider(), 'Test', 6, 30, Algorithm::Sha1, null, null);
|
|
$this->assertIsString($tfa->createSecret());
|
|
}
|
|
}
|