mirror of
https://github.com/Bubka/2FAuth.git
synced 2025-06-04 09:15:38 +02:00
Fix pint issues
This commit is contained in:
parent
fd695c7765
commit
a2328aa46e
@ -227,7 +227,7 @@ class IconStoreService
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($content != $sanitized) {
|
if ($content != $sanitized) {
|
||||||
$content = $sanitized;
|
$content = $sanitized;
|
||||||
$storedToDisk = $this->storeToDisk($name, $content);
|
$storedToDisk = $this->storeToDisk($name, $content);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -42,7 +42,7 @@ class IconControllerTest extends FeatureTestCase
|
|||||||
LogoService::TFA_URL => Http::response(HttpRequestTestData::TFA_JSON_BODY, 200),
|
LogoService::TFA_URL => Http::response(HttpRequestTestData::TFA_JSON_BODY, 200),
|
||||||
]);
|
]);
|
||||||
Http::fake([
|
Http::fake([
|
||||||
OtpTestData::EXTERNAL_IMAGE_URL_DECODED => Http::response((new FileFactory)->image('file.png', 10, 10)->tempFile, 200),
|
OtpTestData::EXTERNAL_IMAGE_URL_DECODED => Http::response((new FileFactory)->image('file.png', 10, 10)->tempFile, 200),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$this->user = User::factory()->create();
|
$this->user = User::factory()->create();
|
||||||
|
@ -241,11 +241,11 @@ class TwoFAccountControllerTest extends FeatureTestCase
|
|||||||
|
|
||||||
Http::preventStrayRequests();
|
Http::preventStrayRequests();
|
||||||
Http::fake([
|
Http::fake([
|
||||||
LogoService::TFA_IMG_URL . '*' => Http::response(HttpRequestTestData::SVG_LOGO_BODY, 200),
|
LogoService::TFA_IMG_URL . '*' => Http::response(HttpRequestTestData::SVG_LOGO_BODY, 200),
|
||||||
LogoService::TFA_URL => Http::response(HttpRequestTestData::TFA_JSON_BODY, 200),
|
LogoService::TFA_URL => Http::response(HttpRequestTestData::TFA_JSON_BODY, 200),
|
||||||
OtpTestData::EXTERNAL_IMAGE_URL_DECODED => Http::response((new FileFactory)->image('file.png', 10, 10)->tempFile, 200),
|
OtpTestData::EXTERNAL_IMAGE_URL_DECODED => Http::response((new FileFactory)->image('file.png', 10, 10)->tempFile, 200),
|
||||||
OtpTestData::EXTERNAL_INFECTED_IMAGE_URL_DECODED => Http::response((new FileFactory)->createWithContent('infected.svg', OtpTestData::ICON_SVG_DATA_INFECTED)->tempFile, 200),
|
OtpTestData::EXTERNAL_INFECTED_IMAGE_URL_DECODED => Http::response((new FileFactory)->createWithContent('infected.svg', OtpTestData::ICON_SVG_DATA_INFECTED)->tempFile, 200),
|
||||||
'example.com/*' => Http::response(null, 400),
|
'example.com/*' => Http::response(null, 400),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$this->user = User::factory()->create();
|
$this->user = User::factory()->create();
|
||||||
|
@ -495,7 +495,7 @@ class IconStoreServiceTest extends FeatureTestCase
|
|||||||
public function test_store_stores_sanitized_svg_content()
|
public function test_store_stores_sanitized_svg_content()
|
||||||
{
|
{
|
||||||
Settings::set('storeIconsInDatabase', true);
|
Settings::set('storeIconsInDatabase', true);
|
||||||
|
|
||||||
$result = $this->iconStore->store(OtpTestData::ICON_SVG, OtpTestData::ICON_SVG_DATA_INFECTED);
|
$result = $this->iconStore->store(OtpTestData::ICON_SVG, OtpTestData::ICON_SVG_DATA_INFECTED);
|
||||||
|
|
||||||
$this->assertTrue($result);
|
$this->assertTrue($result);
|
||||||
@ -504,9 +504,9 @@ class IconStoreServiceTest extends FeatureTestCase
|
|||||||
OtpTestData::ICON_SVG_MALICIOUS_CODE,
|
OtpTestData::ICON_SVG_MALICIOUS_CODE,
|
||||||
Storage::disk('icons')->get(OtpTestData::ICON_SVG)
|
Storage::disk('icons')->get(OtpTestData::ICON_SVG)
|
||||||
);
|
);
|
||||||
|
|
||||||
$dbRecord = DB::table('icons')->where('name', OtpTestData::ICON_SVG)->first();
|
$dbRecord = DB::table('icons')->where('name', OtpTestData::ICON_SVG)->first();
|
||||||
|
|
||||||
$this->assertStringNotContainsString(
|
$this->assertStringNotContainsString(
|
||||||
OtpTestData::ICON_SVG_MALICIOUS_CODE,
|
OtpTestData::ICON_SVG_MALICIOUS_CODE,
|
||||||
$dbRecord->content,
|
$dbRecord->content,
|
||||||
@ -525,7 +525,7 @@ class IconStoreServiceTest extends FeatureTestCase
|
|||||||
public function test_store_deletes_svg_icon_that_cannot_be_sanitized()
|
public function test_store_deletes_svg_icon_that_cannot_be_sanitized()
|
||||||
{
|
{
|
||||||
Settings::set('storeIconsInDatabase', true);
|
Settings::set('storeIconsInDatabase', true);
|
||||||
|
|
||||||
$result = $this->iconStore->store(OtpTestData::ICON_SVG, 'this_will_make_svg_data_invalid' . OtpTestData::ICON_SVG_DATA);
|
$result = $this->iconStore->store(OtpTestData::ICON_SVG, 'this_will_make_svg_data_invalid' . OtpTestData::ICON_SVG_DATA);
|
||||||
|
|
||||||
Storage::disk('icons')->assertMissing(OtpTestData::ICON_SVG);
|
Storage::disk('icons')->assertMissing(OtpTestData::ICON_SVG);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user