Add test for moving PDF header file
This commit is contained in:
parent
2c3400715c
commit
d5fecfea1a
|
@ -48,6 +48,20 @@ class MoveTest extends TestCase
|
||||||
$this->assertHasFile('pages/testneu-200x300.jpg');
|
$this->assertHasFile('pages/testneu-200x300.jpg');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function testRenamePdfHeaderFile()
|
||||||
|
{
|
||||||
|
Setting::set('folders', ['pages']);
|
||||||
|
Setting::set('sizes', []);
|
||||||
|
Setting::set('breakpoints', []);
|
||||||
|
$this->media->put('/pages/test.pdf', file_get_contents(__DIR__.'/stub/dummy.pdf'));
|
||||||
|
UploadedFile::fake()->image(100, 100)->storeAs('uploads/public/c/pages', 'test-200x300.pdf.jpg', 'local');
|
||||||
|
|
||||||
|
Event::fire('media.file.rename', [null, '/pages/test.pdf', '/pages/testneu.pdf']);
|
||||||
|
|
||||||
|
$this->assertFileCount(1, 'pages');
|
||||||
|
$this->assertHasFile('pages/testneu-200x300.pdf.jpg');
|
||||||
|
}
|
||||||
|
|
||||||
public function testItDoesntMoveOtherFilesInTheSameDirectory()
|
public function testItDoesntMoveOtherFilesInTheSameDirectory()
|
||||||
{
|
{
|
||||||
Cache::tags(['resizer', 'resizer.pages/test.jpg'])->set('resizer.original.pages/test.jpg', 'aa');
|
Cache::tags(['resizer', 'resizer.pages/test.jpg'])->set('resizer.original.pages/test.jpg', 'aa');
|
||||||
|
|
Loading…
Reference in New Issue