Add slash test
This commit is contained in:
parent
acf891f47a
commit
b36455ff46
|
@ -48,6 +48,22 @@ class ResizerTest extends TestCase
|
|||
$this->assertHasFile('pages/test-500x600.jpg');
|
||||
}
|
||||
|
||||
public function testCopyOriginalFileWithoutSizesWhenFilenameDoesntBeginWithASlash(): void
|
||||
{
|
||||
Setting::set('folders', [['folder' => '/pages']]);
|
||||
Setting::set('sizes', []);
|
||||
Setting::set('breakpoints', []);
|
||||
|
||||
$file = UploadedFile::fake()->image('test.jpg', 500, 600);
|
||||
$media = MediaLibrary::instance();
|
||||
$media->put('/pages/test.jpg', $file->get());
|
||||
Event::fire('media.file.upload', [null, 'pages/test.jpg', null]);
|
||||
|
||||
$this->assertFileCount(2, 'pages');
|
||||
$this->assertHasFile('pages/test.jpg');
|
||||
$this->assertHasFile('pages/test-500x600.jpg');
|
||||
}
|
||||
|
||||
public function testCopyTwoDirectoriesDeepButNotAnotherDirectory(): void
|
||||
{
|
||||
Setting::set('folders', [['folder' => '/pages']]);
|
||||
|
|
Loading…
Reference in New Issue