File tree Expand file tree Collapse file tree 3 files changed +4
-3
lines changed Expand file tree Collapse file tree 3 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -69,7 +69,7 @@ protected function fileName(): Attribute
6969 return Attribute::make (
7070 set: function ($ value ) {
7171 $ fileName = sha1 ($ value .microtime ());
72- $ ext = pathinfo ($ value , PATHINFO_EXTENSION );
72+ $ ext = strtolower ( pathinfo ($ value , PATHINFO_EXTENSION ) );
7373
7474 return "$ fileName. $ ext " ;
7575 },
Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ protected function setUp(): void
3636
3737 $ this ->fileStorage = new FileStorage ($ config );
3838
39- $ path = __DIR__ .'/TestSupport/assets/avatar.jpg ' ;
39+ $ path = __DIR__ .'/TestSupport/assets/avatar.JPG ' ;
4040 $ this ->testFile = UploadedFile::fake ()->create ($ path , file_get_contents ($ path ));
4141
4242 Queue::fake ();
@@ -54,6 +54,7 @@ public function testCreateMedia(): void
5454
5555 $ this ->assertNull ($ media ->preview );
5656 $ this ->assertSame ($ media ->type , TestDocumentType::AVATAR ->value );
57+ $ this ->assertSame ('jpg ' , pathinfo ($ media ->file_name , PATHINFO_EXTENSION ));
5758
5859 Queue::assertPushedWithChain (OptimizeImage::class, [
5960 GeneratePreview::class,
@@ -66,7 +67,7 @@ public function testUpdateMedia(): void
6667 $ originalMedia = Media::factory ()->create ([
6768 'model_type ' => 'App/Models/User ' ,
6869 'model_id ' => 1 ,
69- 'file_name ' => 'fake-file.jpg ' ,
70+ 'file_name ' => 'fake-file.JPG ' ,
7071 'type ' => TestDocumentType::AVATAR ,
7172 ]);
7273
File renamed without changes.
You can’t perform that action at this time.
0 commit comments