address remarks made by MasterOdin

This commit is contained in:
Nicolas CARPi
2023-02-22 18:08:19 +01:00
parent ab76ac71a4
commit 30248a8fb5
3 changed files with 5 additions and 17 deletions
+4 -12
View File
@@ -4,7 +4,6 @@ declare(strict_types=1);
namespace TestsDependency;
use BaconQrCode\Renderer\Image\ImagickImageBackEnd;
use PHPUnit\Framework\TestCase;
use RobThree\Auth\Algorithm;
use RobThree\Auth\Providers\Qr\BaconQrCodeProvider;
@@ -18,19 +17,12 @@ class BaconQRCodeTest extends TestCase
public function testDependency(): void
{
// php < 7.1 will install an older Bacon QR Code
if (!class_exists(ImagickImageBackEnd::class)) {
$this->expectException(RuntimeException::class);
$qr = new BaconQrCodeProvider(1, '#000', '#FFF', 'svg');
$qr = new BaconQrCodeProvider(1, '#000', '#FFF', 'svg');
} else {
$qr = new BaconQrCodeProvider(1, '#000', '#FFF', 'svg');
$tfa = new TwoFactorAuth('Test&Issuer', 6, 30, Algorithm::Sha1, $qr);
$tfa = new TwoFactorAuth('Test&Issuer', 6, 30, Algorithm::Sha1, $qr);
$data = $this->DecodeDataUri($tfa->getQRCodeImageAsDataUri('Test&Label', 'VMR466AB62ZBOKHE'));
$this->assertEquals('image/svg+xml', $data['mimetype']);
}
$data = $this->DecodeDataUri($tfa->getQRCodeImageAsDataUri('Test&Label', 'VMR466AB62ZBOKHE'));
$this->assertEquals('image/svg+xml', $data['mimetype']);
}
public function testBadTextColour(): void