2FAuth/tests/Feature/Services/QrCodeServiceTest.php
2024-05-29 09:27:56 +02:00

60 lines
16 KiB
PHP

<?php
namespace Tests\Feature\Services;
use App\Facades\QrCode;
use App\Services\QrCodeService;
use PHPUnit\Framework\Attributes\CoversClass;
use Tests\Classes\LocalFile;
use Tests\FeatureTestCase;
/**
* QrCodeServiceTest test class
*/
#[CoversClass(QrCodeService::class)]
#[CoversClass(QrCode::class)]
class QrCodeServiceTest extends FeatureTestCase
{
private const STRING_TO_ENCODE = 'stringToEncode';
private const STRING_ENCODED = 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGNsYXNzPSJxci1zdmcgcXJjb2RlIiB2aWV3Qm94PSIwIDAgMjUgMjUiIHByZXNlcnZlQXNwZWN0UmF0aW89InhNaWRZTWlkIj4KPHBhdGggY2xhc3M9InFyLWRhdGEgbGlnaHQgcXJjb2RlIiBmaWxsPSIjZmZmIiBkPSJNMTIgMiBoMSB2MSBoLTFaIE0xMyAyIGgxIHYxIGgtMVogTTEyIDMgaDEgdjEgaC0xWiBNMTMgMyBoMSB2MSBoLTFaIE0xMSA0IGgxIHYxIGgtMVogTTEzIDQgaDEgdjEgaC0xWiBNMTEgNSBoMSB2MSBoLTFaIE0xMiA1IGgxIHYxIGgtMVogTTE0IDUgaDEgdjEgaC0xWiBNMTQgNiBoMSB2MSBoLTFaIE0xMSA3IGgxIHYxIGgtMVogTTEyIDcgaDEgdjEgaC0xWiBNMTMgNyBoMSB2MSBoLTFaIE0xNCA3IGgxIHYxIGgtMVogTTEzIDkgaDEgdjEgaC0xWiBNMTQgOSBoMSB2MSBoLTFaIE0xMSAxMCBoMSB2MSBoLTFaIE0xNCAxMCBoMSB2MSBoLTFaIE0yIDExIGgxIHYxIGgtMVogTTMgMTEgaDEgdjEgaC0xWiBNNSAxMSBoMSB2MSBoLTFa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xIGgtMVogTTUgMjAgaDEgdjEgaC0xWiBNNiAyMCBoMSB2MSBoLTFaIi8+Cjwvc3ZnPgo=';
private const DECODED_IMAGE = 'otpauth://totp/test@test.com?secret=A4GRFHVIRBGY7UIW';
/**
* @test
*/
public function setUp() : void
{
parent::setUp();
}
/**
* @test
*/
public function test_encode_returns_correct_value()
{
$this->assertEquals(self::STRING_ENCODED, QrCode::encode(self::STRING_TO_ENCODE));
}
/**
* @test
*/
public function test_decode_valid_image_returns_correct_value()
{
$file = LocalFile::fake()->validQrcode();
$this->assertEquals(self::DECODED_IMAGE, QrCode::decode($file));
}
/**
* @test
*/
public function test_decode_invalid_image_returns_correct_value()
{
$this->expectException(\App\Exceptions\InvalidQrCodeException::class);
QrCode::decode(LocalFile::fake()->invalidQrcode());
}
}