Add missing Storage & Http facade fakes

This commit is contained in:
Bubka
2024-10-25 14:58:58 +02:00
parent b344f7756f
commit 15ee7d2e24
7 changed files with 49 additions and 38 deletions

View File

@ -235,6 +235,9 @@ class TwoFAccountControllerTest extends FeatureTestCase
Http::fake([
OtpTestData::EXTERNAL_IMAGE_URL_DECODED => Http::response((new FileFactory)->image('file.png', 10, 10)->tempFile, 200),
]);
Http::fake([
'example.com/*' => Http::response(null, 400),
]);
$this->user = User::factory()->create();
$this->userGroupA = Group::factory()->for($this->user)->create();
@ -1193,7 +1196,7 @@ class TwoFAccountControllerTest extends FeatureTestCase
public function test_preview_with_unreachable_image_returns_success_with_no_icon()
{
$this->user['preferences->getOfficialIcons'] = false;
$response = $this->actingAs($this->user, 'api-guard')
->json('POST', '/api/v1/twofaccounts/preview', [
'uri' => OtpTestData::TOTP_URI_WITH_UNREACHABLE_IMAGE,