addded test for save file exif metadata

This commit is contained in:
Milos Holba
2022-01-29 12:48:21 +01:00
parent d16d73680f
commit 2ca42f530b
2 changed files with 34 additions and 9 deletions

View File

@@ -330,4 +330,37 @@ class FileTest extends TestCase
);
});
}
/**
* @test
*/
public function it_store_file_exif_data_after_file_upload()
{
$file = UploadedFile::fake()
->image('fake-image.jpg', 2000, 2000);
$user = User::factory()
->hasSettings()
->create();
$this
->actingAs($user)
->postJson('/api/upload', [
'filename' => $file->name,
'file' => $file,
'parent_id' => null,
'path' => '/' . $file->name,
'is_last' => 'true',
])->assertStatus(201);
$file = File::first();
$this->assertDatabaseHas('exifs', [
'file_id' => $file->id,
'height' => 2000,
'width' => 2000,
]);
}
}