mirror of
https://github.com/RobThree/TwoFactorAuth.git
synced 2026-08-18 10:12:41 +00:00
24 lines
726 B
PHP
24 lines
726 B
PHP
<?php declare(strict_types=1);
|
|
|
|
namespace TestsDependency;
|
|
|
|
use PHPUnit\Framework\TestCase;
|
|
use RobThree\Auth\Providers\Qr\EndroidQrCodeProvider;
|
|
use RobThree\Auth\Providers\Qr\HandlesDataUri;
|
|
use RobThree\Auth\TwoFactorAuth;
|
|
|
|
class EndroidQRCodeTest extends TestCase
|
|
{
|
|
use HandlesDataUri;
|
|
|
|
public function testDependency()
|
|
{
|
|
$qr = new EndroidQrCodeProvider();
|
|
$tfa = new TwoFactorAuth('Test&Issuer', 6, 30, 'sha1', $qr);
|
|
$data = $this->DecodeDataUri($tfa->getQRCodeImageAsDataUri('Test&Label', 'VMR466AB62ZBOKHE'));
|
|
$this->assertEquals('image/png', $data['mimetype']);
|
|
$this->assertEquals('base64', $data['encoding']);
|
|
$this->assertNotEmpty($data['data']);
|
|
}
|
|
}
|