diff --git a/testsDependency/BaconQRCodeTest.php b/testsDependency/BaconQRCodeTest.php index 1ceeb53..321378b 100644 --- a/testsDependency/BaconQRCodeTest.php +++ b/testsDependency/BaconQRCodeTest.php @@ -4,6 +4,7 @@ namespace TestsDependency; use BaconQrCode\Renderer\Image\ImagickImageBackEnd; use PHPUnit\Framework\TestCase; +use RobThree\Auth\Algorithm; use RobThree\Auth\Providers\Qr\BaconQrCodeProvider; use RobThree\Auth\Providers\Qr\HandlesDataUri; use RobThree\Auth\TwoFactorAuth; @@ -13,7 +14,7 @@ class BaconQRCodeTest extends TestCase { use HandlesDataUri; - public function testDependency() + public function testDependency(): void { // php < 7.1 will install an older Bacon QR Code if (!class_exists(ImagickImageBackEnd::class)) { @@ -23,35 +24,35 @@ class BaconQRCodeTest extends TestCase } else { $qr = new BaconQrCodeProvider(1, '#000', '#FFF', 'svg'); - $tfa = new TwoFactorAuth('Test&Issuer', 6, 30, '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']); } } - public function testBadTextColour() + public function testBadTextColour(): void { $this->expectException(RuntimeException::class); new BaconQrCodeProvider(1, 'not-a-colour', '#FFF'); } - public function testBadBackgroundColour() + public function testBadBackgroundColour(): void { $this->expectException(RuntimeException::class); new BaconQrCodeProvider(1, '#000', 'not-a-colour'); } - public function testBadTextColourHexRef() + public function testBadTextColourHexRef(): void { $this->expectException(RuntimeException::class); new BaconQrCodeProvider(1, '#AAAA', '#FFF'); } - public function testBadBackgroundColourHexRef() + public function testBadBackgroundColourHexRef(): void { $this->expectException(RuntimeException::class); diff --git a/testsDependency/EndroidQRCodeTest.php b/testsDependency/EndroidQRCodeTest.php index 0534b45..f5f4d6b 100644 --- a/testsDependency/EndroidQRCodeTest.php +++ b/testsDependency/EndroidQRCodeTest.php @@ -3,6 +3,7 @@ namespace TestsDependency; use PHPUnit\Framework\TestCase; +use RobThree\Auth\Algorithm; use RobThree\Auth\Providers\Qr\EndroidQrCodeProvider; use RobThree\Auth\Providers\Qr\HandlesDataUri; use RobThree\Auth\TwoFactorAuth; @@ -11,10 +12,10 @@ class EndroidQRCodeTest extends TestCase { use HandlesDataUri; - public function testDependency() + public function testDependency(): void { $qr = new EndroidQrCodeProvider(); - $tfa = new TwoFactorAuth('Test&Issuer', 6, 30, 'sha1', $qr); + $tfa = new TwoFactorAuth('Test&Issuer', 6, 30, Algorithm::Sha1, $qr); $data = $this->DecodeDataUri($tfa->getQRCodeImageAsDataUri('Test&Label', 'VMR466AB62ZBOKHE')); $this->assertEquals('image/png', $data['mimetype']); $this->assertEquals('base64', $data['encoding']);