From d5c3fc75a16be36768c3dd968fce16fba0e407b4 Mon Sep 17 00:00:00 2001 From: Awilum Date: Thu, 17 Dec 2020 20:27:49 +0300 Subject: [PATCH] feat(media): we should have `media` instead of `uploads` folder Media API #515 --- src/flextype/Endpoints/images.php | 2 +- src/flextype/Foundation/Media/MediaFiles.php | 14 ++++---- .../Foundation/Media/MediaFilesMeta.php | 2 +- .../Foundation/Media/MediaFolders.php | 6 ++-- .../Foundation/Media/MediaFoldersMeta.php | 2 +- src/flextype/dependencies.php | 2 +- .../Entries/Fields/MediaFieldTest.php | 16 +++++----- tests/Foundation/Media/MediaFilesMetaTest.php | 26 +++++++-------- tests/Foundation/Media/MediaFilesTest.php | 32 +++++++++---------- .../Foundation/Media/MediaFoldersMetaTest.php | 4 +-- tests/Foundation/Media/MediaFoldersTest.php | 4 +-- 11 files changed, 55 insertions(+), 55 deletions(-) diff --git a/src/flextype/Endpoints/images.php b/src/flextype/Endpoints/images.php index f0700759..cf01757a 100644 --- a/src/flextype/Endpoints/images.php +++ b/src/flextype/Endpoints/images.php @@ -70,7 +70,7 @@ flextype()->get('/api/images/{path:.+}', function (Request $request, Response $r // Update calls counter filesystem()->file($delivery_images_token_file_path)->put(flextype('yaml')->encode(array_replace_recursive($delivery_images_token_file_data, ['calls' => $delivery_images_token_file_data['calls'] + 1]))); - if (filesystem()->file(PATH['project'] . '/uploads/entries/' . $args['path'])->exists()) { + if (filesystem()->file(PATH['project'] . '/media/entries/' . $args['path'])->exists()) { return flextype('images')->getImageResponse($args['path'], $_GET); } diff --git a/src/flextype/Foundation/Media/MediaFiles.php b/src/flextype/Foundation/Media/MediaFiles.php index 4efd9b1b..cea0df80 100644 --- a/src/flextype/Foundation/Media/MediaFiles.php +++ b/src/flextype/Foundation/Media/MediaFiles.php @@ -62,8 +62,8 @@ class MediaFiles */ public function upload(array $file, string $folder) { - $uploadFolder = PATH['project'] . '/uploads/' . $folder . '/'; - $uploadMetadataFolder = PATH['project'] . '/uploads/.meta/' . $folder . '/'; + $uploadFolder = PATH['project'] . '/media/' . $folder . '/'; + $uploadMetadataFolder = PATH['project'] . '/media/.meta/' . $folder . '/'; if (! filesystem()->directory($uploadFolder)->exists()) { filesystem()->directory($uploadFolder)->create(0755, true); @@ -232,7 +232,7 @@ class MediaFiles $result[$basename]['basename'] = explode('.', basename(flextype('media_files_meta')->getFileMetaLocation($basename)))[0]; $result[$basename]['extension'] = ltrim(strstr($basename, '.'), '.'); $result[$basename]['dirname'] = pathinfo(str_replace('/.meta', '', $file->getPathname()))['dirname']; - $result[$basename]['url'] = 'project/uploads/' . $id . '/' . $basename; + $result[$basename]['url'] = 'project/media/' . $id . '/' . $basename; if (flextype('registry')->has('flextype.settings.url') && flextype('registry')->get('flextype.settings.url') !== '') { $fullUrl = flextype('registry')->get('flextype.settings.url'); @@ -240,7 +240,7 @@ class MediaFiles $fullUrl = Uri::createFromEnvironment(new Environment($_SERVER))->getBaseUrl(); } - $result[$basename]['full_url'] = $fullUrl . '/project/uploads/' . $id . '/' . $basename; + $result[$basename]['full_url'] = $fullUrl . '/project/media/' . $id . '/' . $basename; } $result = filter($result, $options); @@ -257,7 +257,7 @@ class MediaFiles $result['extension'] = ltrim(strstr($id, '.'), '.'); $result['dirname'] = pathinfo(str_replace('/.meta', '', flextype('media_files_meta')->getFileMetaLocation($id)))['dirname']; - $result['url'] = 'project/uploads/' . $id; + $result['url'] = 'project/media/' . $id; if (flextype('registry')->has('flextype.settings.url') && flextype('registry')->get('flextype.settings.url') !== '') { $fullUrl = flextype('registry')->get('flextype.settings.url'); @@ -265,7 +265,7 @@ class MediaFiles $fullUrl = Uri::createFromEnvironment(new Environment($_SERVER))->getBaseUrl(); } - $result['full_url'] = $fullUrl . '/project/uploads/' . $id; + $result['full_url'] = $fullUrl . '/project/media/' . $id; } $result = filter($result, $options); @@ -358,7 +358,7 @@ class MediaFiles */ public function getFileLocation(string $id): string { - return PATH['project'] . '/uploads/' . $id; + return PATH['project'] . '/media/' . $id; } /** diff --git a/src/flextype/Foundation/Media/MediaFilesMeta.php b/src/flextype/Foundation/Media/MediaFilesMeta.php index 2142cc48..f9027642 100644 --- a/src/flextype/Foundation/Media/MediaFilesMeta.php +++ b/src/flextype/Foundation/Media/MediaFilesMeta.php @@ -101,6 +101,6 @@ class MediaFilesMeta */ public function getFileMetaLocation(string $id): string { - return PATH['project'] . '/uploads/.meta/' . $id . '.yaml'; + return PATH['project'] . '/media/.meta/' . $id . '.yaml'; } } diff --git a/src/flextype/Foundation/Media/MediaFolders.php b/src/flextype/Foundation/Media/MediaFolders.php index 7408f8c2..9e382666 100644 --- a/src/flextype/Foundation/Media/MediaFolders.php +++ b/src/flextype/Foundation/Media/MediaFolders.php @@ -46,7 +46,7 @@ class MediaFolders if (filesystem()->directory(flextype('media_folders_meta')->getDirectoryMetaLocation($id))->exists()) { $result['path'] = $id; $result['full_path'] = str_replace('/.meta', '', flextype('media_folders_meta')->getDirectoryMetaLocation($id)); - $result['url'] = 'project/uploads/' . $id; + $result['url'] = 'project/media/' . $id; if (flextype('registry')->has('flextype.settings.url') && flextype('registry')->get('flextype.settings.url') !== '') { $fullUrl = flextype('registry')->get('flextype.settings.url'); @@ -54,7 +54,7 @@ class MediaFolders $fullUrl = Uri::createFromEnvironment(new Environment($_SERVER))->getBaseUrl(); } - $result['full_url'] = $fullUrl . '/project/uploads/' . $id; + $result['full_url'] = $fullUrl . '/project/media/' . $id; } $result = filter($result, $options); @@ -179,6 +179,6 @@ class MediaFolders */ public function getDirectoryLocation(string $id): string { - return PATH['project'] . '/uploads/' . $id; + return PATH['project'] . '/media/' . $id; } } diff --git a/src/flextype/Foundation/Media/MediaFoldersMeta.php b/src/flextype/Foundation/Media/MediaFoldersMeta.php index 1266fe73..60bbabec 100644 --- a/src/flextype/Foundation/Media/MediaFoldersMeta.php +++ b/src/flextype/Foundation/Media/MediaFoldersMeta.php @@ -26,6 +26,6 @@ class MediaFoldersMeta */ public function getDirectoryMetaLocation(string $id): string { - return PATH['project'] . '/uploads/.meta/' . $id; + return PATH['project'] . '/media/.meta/' . $id; } } diff --git a/src/flextype/dependencies.php b/src/flextype/dependencies.php index 8b0063f4..8682a846 100644 --- a/src/flextype/dependencies.php +++ b/src/flextype/dependencies.php @@ -269,7 +269,7 @@ flextype()->container()['images'] = static function () { // Set source filesystem $source = new Flysystem( - new Local(PATH['project'] . '/uploads/entries/') + new Local(PATH['project'] . '/media/entries/') ); // Set cache filesystem diff --git a/tests/Foundation/Entries/Fields/MediaFieldTest.php b/tests/Foundation/Entries/Fields/MediaFieldTest.php index 9f8d4799..533643aa 100644 --- a/tests/Foundation/Entries/Fields/MediaFieldTest.php +++ b/tests/Foundation/Entries/Fields/MediaFieldTest.php @@ -5,23 +5,23 @@ use Flextype\Component\Filesystem\Filesystem; beforeEach(function() { filesystem()->directory(PATH['project'] . '/entries')->create(); filesystem()->directory(PATH['project'] . '/uploads')->create(0755, true); - filesystem()->directory(PATH['project'] . '/uploads/.meta')->create(0755, true); - filesystem()->directory(PATH['project'] . '/uploads/foo')->create(0755, true); - filesystem()->directory(PATH['project'] . '/uploads/.meta/foo')->create(0755, true); + filesystem()->directory(PATH['project'] . '/media/.meta')->create(0755, true); + filesystem()->directory(PATH['project'] . '/media/foo')->create(0755, true); + filesystem()->directory(PATH['project'] . '/media/.meta/foo')->create(0755, true); }); afterEach(function (): void { - filesystem()->directory(PATH['project'] . '/uploads/.meta')->delete(); + filesystem()->directory(PATH['project'] . '/media/.meta')->delete(); filesystem()->directory(PATH['project'] . '/uploads')->delete(); filesystem()->directory(PATH['project'] . '/entries')->delete(); }); test('test media_files field', function () { - filesystem()->file(PATH['project'] . '/uploads/foo.txt')->put('foo'); - filesystem()->file(PATH['project'] . '/uploads/.meta/foo.txt.yaml')->put(flextype('yaml')->encode(['title' => 'Foo', 'description' => '', 'type' => 'text/plain', 'filesize' => 3, 'uploaded_on' => 1603090370, 'exif' => []])); - filesystem()->file(PATH['project'] . '/uploads/bar.txt')->put('foo'); - filesystem()->file(PATH['project'] . '/uploads/.meta/bar.txt.yaml')->put(flextype('yaml')->encode(['title' => 'Bar', 'description' => '', 'type' => 'text/plain', 'filesize' => 3, 'uploaded_on' => 1603090370, 'exif' => []])); + filesystem()->file(PATH['project'] . '/media/foo.txt')->put('foo'); + filesystem()->file(PATH['project'] . '/media/.meta/foo.txt.yaml')->put(flextype('yaml')->encode(['title' => 'Foo', 'description' => '', 'type' => 'text/plain', 'filesize' => 3, 'uploaded_on' => 1603090370, 'exif' => []])); + filesystem()->file(PATH['project'] . '/media/bar.txt')->put('foo'); + filesystem()->file(PATH['project'] . '/media/.meta/bar.txt.yaml')->put(flextype('yaml')->encode(['title' => 'Bar', 'description' => '', 'type' => 'text/plain', 'filesize' => 3, 'uploaded_on' => 1603090370, 'exif' => []])); flextype('entries')->create('media', flextype('frontmatter')->decode(filesystem()->file(ROOT_DIR . '/tests/Foundation/Entries/Fields/fixtures/entries/media/entry.md')->get())); diff --git a/tests/Foundation/Media/MediaFilesMetaTest.php b/tests/Foundation/Media/MediaFilesMetaTest.php index 6d2bde19..ad3e5b11 100644 --- a/tests/Foundation/Media/MediaFilesMetaTest.php +++ b/tests/Foundation/Media/MediaFilesMetaTest.php @@ -4,41 +4,41 @@ declare(strict_types=1); beforeEach(function() { filesystem()->directory(PATH['project'] . '/uploads')->create(0755, true); - filesystem()->directory(PATH['project'] . '/uploads/.meta')->create(0755, true); + filesystem()->directory(PATH['project'] . '/media/.meta')->create(0755, true); }); afterEach(function (): void { - filesystem()->directory(PATH['project'] . '/uploads/.meta')->delete(); + filesystem()->directory(PATH['project'] . '/media/.meta')->delete(); filesystem()->directory(PATH['project'] . '/uploads')->delete(); }); test('test update() method', function () { - filesystem()->file(PATH['project'] . '/uploads/foo.txt')->put('foo'); - filesystem()->file(PATH['project'] . '/uploads/.meta/foo.txt.yaml')->put(flextype('yaml')->encode(['title' => 'Foo', 'description' => '', 'type' => 'text/plain', 'filesize' => 3, 'uploaded_on' => 1603090370, 'exif' => []])); + filesystem()->file(PATH['project'] . '/media/foo.txt')->put('foo'); + filesystem()->file(PATH['project'] . '/media/.meta/foo.txt.yaml')->put(flextype('yaml')->encode(['title' => 'Foo', 'description' => '', 'type' => 'text/plain', 'filesize' => 3, 'uploaded_on' => 1603090370, 'exif' => []])); $this->assertTrue(flextype('media_files_meta')->update('foo.txt', 'description', 'Foo description')); - $this->assertEquals('Foo description', flextype('yaml')->decode(filesystem()->file(PATH['project'] . '/uploads/.meta/foo.txt.yaml')->get())['description']); + $this->assertEquals('Foo description', flextype('yaml')->decode(filesystem()->file(PATH['project'] . '/media/.meta/foo.txt.yaml')->get())['description']); }); test('test add() method', function () { - filesystem()->file(PATH['project'] . '/uploads/foo.txt')->put('foo'); - filesystem()->file(PATH['project'] . '/uploads/.meta/foo.txt.yaml')->put(flextype('yaml')->encode(['title' => 'Foo', 'description' => '', 'type' => 'text/plain', 'filesize' => 3, 'uploaded_on' => 1603090370, 'exif' => []])); + filesystem()->file(PATH['project'] . '/media/foo.txt')->put('foo'); + filesystem()->file(PATH['project'] . '/media/.meta/foo.txt.yaml')->put(flextype('yaml')->encode(['title' => 'Foo', 'description' => '', 'type' => 'text/plain', 'filesize' => 3, 'uploaded_on' => 1603090370, 'exif' => []])); $this->assertTrue(flextype('media_files_meta')->add('foo.txt', 'bar', 'Bar')); - $this->assertEquals('Bar', flextype('yaml')->decode(filesystem()->file(PATH['project'] . '/uploads/.meta/foo.txt.yaml')->get())['bar']); + $this->assertEquals('Bar', flextype('yaml')->decode(filesystem()->file(PATH['project'] . '/media/.meta/foo.txt.yaml')->get())['bar']); }); test('test delete() method', function () { - filesystem()->file(PATH['project'] . '/uploads/foo.txt')->put('foo'); - filesystem()->file(PATH['project'] . '/uploads/.meta/foo.txt.yaml')->put(flextype('yaml')->encode(['title' => 'Foo', 'description' => '', 'type' => 'text/plain', 'filesize' => 3, 'uploaded_on' => 1603090370, 'exif' => []])); + filesystem()->file(PATH['project'] . '/media/foo.txt')->put('foo'); + filesystem()->file(PATH['project'] . '/media/.meta/foo.txt.yaml')->put(flextype('yaml')->encode(['title' => 'Foo', 'description' => '', 'type' => 'text/plain', 'filesize' => 3, 'uploaded_on' => 1603090370, 'exif' => []])); $this->assertTrue(flextype('media_files_meta')->delete('foo.txt', 'title')); - $this->assertTrue(empty(flextype('yaml')->decode(filesystem()->file(PATH['project'] . '/uploads/.meta/foo.txt.yaml')->get())['bar'])); + $this->assertTrue(empty(flextype('yaml')->decode(filesystem()->file(PATH['project'] . '/media/.meta/foo.txt.yaml')->get())['bar'])); }); test('test getFileMetaLocation() method', function () { - filesystem()->file(PATH['project'] . '/uploads/foo.txt')->put('foo'); - filesystem()->file(PATH['project'] . '/uploads/.meta/foo.txt.yaml')->put(flextype('yaml')->encode(['title' => 'Foo', 'description' => '', 'type' => 'text/plain', 'filesize' => 3, 'uploaded_on' => 1603090370, 'exif' => []])); + filesystem()->file(PATH['project'] . '/media/foo.txt')->put('foo'); + filesystem()->file(PATH['project'] . '/media/.meta/foo.txt.yaml')->put(flextype('yaml')->encode(['title' => 'Foo', 'description' => '', 'type' => 'text/plain', 'filesize' => 3, 'uploaded_on' => 1603090370, 'exif' => []])); $this->assertStringContainsString('foo.txt.yaml', flextype('media_files_meta')->getFileMetaLocation('foo.txt')); }); diff --git a/tests/Foundation/Media/MediaFilesTest.php b/tests/Foundation/Media/MediaFilesTest.php index 2343eb44..3f08a5bb 100644 --- a/tests/Foundation/Media/MediaFilesTest.php +++ b/tests/Foundation/Media/MediaFilesTest.php @@ -4,19 +4,19 @@ declare(strict_types=1); beforeEach(function() { filesystem()->directory(PATH['project'] . '/uploads')->create(0755, true); - filesystem()->directory(PATH['project'] . '/uploads/.meta')->create(0755, true); + filesystem()->directory(PATH['project'] . '/media/.meta')->create(0755, true); }); afterEach(function (): void { - filesystem()->directory(PATH['project'] . '/uploads/.meta')->delete(); + filesystem()->directory(PATH['project'] . '/media/.meta')->delete(); filesystem()->directory(PATH['project'] . '/uploads')->delete(); }); test('test fetch() method', function () { - filesystem()->file(PATH['project'] . '/uploads/foo.txt')->put('foo'); - filesystem()->file(PATH['project'] . '/uploads/.meta/foo.txt.yaml')->put(flextype('yaml')->encode(['title' => 'Foo', 'description' => '', 'type' => 'text/plain', 'filesize' => 3, 'uploaded_on' => 1603090370, 'exif' => []])); - filesystem()->file(PATH['project'] . '/uploads/bar.txt')->put('foo'); - filesystem()->file(PATH['project'] . '/uploads/.meta/bar.txt.yaml')->put(flextype('yaml')->encode(['title' => 'Bar', 'description' => '', 'type' => 'text/plain', 'filesize' => 3, 'uploaded_on' => 1603090370, 'exif' => []])); + filesystem()->file(PATH['project'] . '/media/foo.txt')->put('foo'); + filesystem()->file(PATH['project'] . '/media/.meta/foo.txt.yaml')->put(flextype('yaml')->encode(['title' => 'Foo', 'description' => '', 'type' => 'text/plain', 'filesize' => 3, 'uploaded_on' => 1603090370, 'exif' => []])); + filesystem()->file(PATH['project'] . '/media/bar.txt')->put('foo'); + filesystem()->file(PATH['project'] . '/media/.meta/bar.txt.yaml')->put(flextype('yaml')->encode(['title' => 'Bar', 'description' => '', 'type' => 'text/plain', 'filesize' => 3, 'uploaded_on' => 1603090370, 'exif' => []])); $this->assertTrue(count(flextype('media_files')->fetch('foo.txt')) > 0); $this->assertEquals('Foo', flextype('media_files')->fetch('foo.txt')['title']); @@ -26,8 +26,8 @@ test('test fetch() method', function () { }); test('test move() method', function () { - filesystem()->file(PATH['project'] . '/uploads/foo.txt')->put('foo'); - filesystem()->file(PATH['project'] . '/uploads/.meta/foo.txt.yaml')->put(flextype('yaml')->encode(['title' => 'Foo', 'description' => '', 'type' => 'text/plain', 'filesize' => 3, 'uploaded_on' => 1603090370, 'exif' => []])); + filesystem()->file(PATH['project'] . '/media/foo.txt')->put('foo'); + filesystem()->file(PATH['project'] . '/media/.meta/foo.txt.yaml')->put(flextype('yaml')->encode(['title' => 'Foo', 'description' => '', 'type' => 'text/plain', 'filesize' => 3, 'uploaded_on' => 1603090370, 'exif' => []])); $this->assertTrue(flextype('media_files')->move('foo.txt', 'bar.txt')); $this->assertTrue(flextype('media_files')->move('bar.txt', 'foo.txt')); @@ -38,8 +38,8 @@ test('test copy() method', function () { $this->assertTrue(flextype('media_folders')->create('foo')); $this->assertTrue(flextype('media_folders')->create('bar')); - filesystem()->file(PATH['project'] . '/uploads/foo/foo.txt')->put('foo'); - filesystem()->file(PATH['project'] . '/uploads/.meta/foo/foo.txt.yaml')->put(flextype('yaml')->encode(['title' => 'Foo', 'description' => '', 'type' => 'text/plain', 'filesize' => 3, 'uploaded_on' => 1603090370, 'exif' => []])); + filesystem()->file(PATH['project'] . '/media/foo/foo.txt')->put('foo'); + filesystem()->file(PATH['project'] . '/media/.meta/foo/foo.txt.yaml')->put(flextype('yaml')->encode(['title' => 'Foo', 'description' => '', 'type' => 'text/plain', 'filesize' => 3, 'uploaded_on' => 1603090370, 'exif' => []])); $this->assertTrue(flextype('media_files')->copy('foo/foo.txt', 'bar/foo.txt')); $this->assertTrue(flextype('media_files')->copy('foo/foo.txt', 'bar/bar.txt')); @@ -47,22 +47,22 @@ test('test copy() method', function () { }); test('test has() method', function () { - filesystem()->file(PATH['project'] . '/uploads/foo.txt')->put('foo'); - filesystem()->file(PATH['project'] . '/uploads/.meta/foo.txt.yaml')->put(flextype('yaml')->encode(['title' => 'Foo', 'description' => '', 'type' => 'text/plain', 'filesize' => 3, 'uploaded_on' => 1603090370, 'exif' => []])); + filesystem()->file(PATH['project'] . '/media/foo.txt')->put('foo'); + filesystem()->file(PATH['project'] . '/media/.meta/foo.txt.yaml')->put(flextype('yaml')->encode(['title' => 'Foo', 'description' => '', 'type' => 'text/plain', 'filesize' => 3, 'uploaded_on' => 1603090370, 'exif' => []])); $this->assertTrue(flextype('media_files')->has('foo.txt')); $this->assertFalse(flextype('media_files')->has('bar.txt')); }); test('test getFileLocation() method', function () { - filesystem()->file(PATH['project'] . '/uploads/foo.txt')->put('foo'); - filesystem()->file(PATH['project'] . '/uploads/.meta/foo.txt.yaml')->put(flextype('yaml')->encode(['title' => 'Foo', 'description' => '', 'type' => 'text/plain', 'filesize' => 3, 'uploaded_on' => 1603090370, 'exif' => []])); + filesystem()->file(PATH['project'] . '/media/foo.txt')->put('foo'); + filesystem()->file(PATH['project'] . '/media/.meta/foo.txt.yaml')->put(flextype('yaml')->encode(['title' => 'Foo', 'description' => '', 'type' => 'text/plain', 'filesize' => 3, 'uploaded_on' => 1603090370, 'exif' => []])); $this->assertStringContainsString('foo.txt', flextype('media_files')->getFileLocation('foo.txt')); }); test('test delete() method', function () { - filesystem()->file(PATH['project'] . '/uploads/foo.txt')->put('foo'); - filesystem()->file(PATH['project'] . '/uploads/.meta/foo.txt.yaml')->put(flextype('yaml')->encode(['title' => 'Foo', 'description' => '', 'type' => 'text/plain', 'filesize' => 3, 'uploaded_on' => 1603090370, 'exif' => []])); + filesystem()->file(PATH['project'] . '/media/foo.txt')->put('foo'); + filesystem()->file(PATH['project'] . '/media/.meta/foo.txt.yaml')->put(flextype('yaml')->encode(['title' => 'Foo', 'description' => '', 'type' => 'text/plain', 'filesize' => 3, 'uploaded_on' => 1603090370, 'exif' => []])); $this->assertTrue(flextype('media_files')->delete('foo.txt')); $this->assertFalse(flextype('media_files')->delete('foo.txt')); }); diff --git a/tests/Foundation/Media/MediaFoldersMetaTest.php b/tests/Foundation/Media/MediaFoldersMetaTest.php index d37cf861..a0904121 100644 --- a/tests/Foundation/Media/MediaFoldersMetaTest.php +++ b/tests/Foundation/Media/MediaFoldersMetaTest.php @@ -4,11 +4,11 @@ declare(strict_types=1); beforeEach(function() { filesystem()->directory(PATH['project'] . '/uploads')->create(0755, true); - filesystem()->directory(PATH['project'] . '/uploads/.meta')->create(0755, true); + filesystem()->directory(PATH['project'] . '/media/.meta')->create(0755, true); }); afterEach(function (): void { - filesystem()->directory(PATH['project'] . '/uploads/.meta')->delete(); + filesystem()->directory(PATH['project'] . '/media/.meta')->delete(); filesystem()->directory(PATH['project'] . '/uploads')->delete(); }); diff --git a/tests/Foundation/Media/MediaFoldersTest.php b/tests/Foundation/Media/MediaFoldersTest.php index 6b3cba7a..aaf2b528 100644 --- a/tests/Foundation/Media/MediaFoldersTest.php +++ b/tests/Foundation/Media/MediaFoldersTest.php @@ -4,11 +4,11 @@ declare(strict_types=1); beforeEach(function() { filesystem()->directory(PATH['project'] . '/uploads')->create(0755, true); - filesystem()->directory(PATH['project'] . '/uploads/.meta')->create(0755, true); + filesystem()->directory(PATH['project'] . '/media/.meta')->create(0755, true); }); afterEach(function (): void { - filesystem()->directory(PATH['project'] . '/uploads/.meta')->delete(); + filesystem()->directory(PATH['project'] . '/media/.meta')->delete(); filesystem()->directory(PATH['project'] . '/uploads')->delete(); });