mirror of
https://github.com/Bubka/2FAuth.git
synced 2025-08-09 21:57:47 +02:00
Update & Complete API controllers tests and Unit tests
This commit is contained in:
@ -7,6 +7,8 @@ use App\Exceptions\InvalidMigrationDataException;
|
||||
use App\Exceptions\UnsupportedMigrationException;
|
||||
use App\Factories\MigratorFactory;
|
||||
use App\Models\TwoFAccount;
|
||||
use App\Models\User;
|
||||
use App\Services\LogoService;
|
||||
use App\Services\Migrators\AegisMigrator;
|
||||
use App\Services\Migrators\GoogleAuthMigrator;
|
||||
use App\Services\Migrators\Migrator;
|
||||
@ -57,7 +59,7 @@ class MigratorTest extends TestCase
|
||||
/**
|
||||
* App\Models\TwoFAccount $GAuthTotpBisTwofaccount
|
||||
*/
|
||||
protected $GAuthTotpBisTwofaccount;
|
||||
protected $GAuthTotpBisTwofaccount, $fakeTwofaccount;
|
||||
|
||||
public function setUp() : void
|
||||
{
|
||||
@ -67,12 +69,15 @@ class MigratorTest extends TestCase
|
||||
$settingService->allows()
|
||||
->get('useEncryption')
|
||||
->andReturn(false);
|
||||
|
||||
$settingService->allows()
|
||||
->get('getOfficialIcons')
|
||||
->andReturn(false);
|
||||
});
|
||||
|
||||
$this->mock(LogoService::class, function (MockInterface $logoService) {
|
||||
$logoService->allows([
|
||||
'getIcon' => null,
|
||||
]);
|
||||
});
|
||||
|
||||
|
||||
$this->totpTwofaccount = new TwoFAccount;
|
||||
$this->totpTwofaccount->legacy_uri = OtpTestData::TOTP_FULL_CUSTOM_URI_NO_IMG;
|
||||
$this->totpTwofaccount->service = OtpTestData::SERVICE;
|
||||
|
Reference in New Issue
Block a user