From 1e87b4435b084015b1ffce4d0eef394c896ea67c Mon Sep 17 00:00:00 2001 From: Awilum Date: Mon, 19 Oct 2020 20:20:14 +0300 Subject: [PATCH] feat(tests): add tests for MediaFiles getFileLocation() method #477 --- tests/Foundation/Media/MediaFilesTest.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/Foundation/Media/MediaFilesTest.php b/tests/Foundation/Media/MediaFilesTest.php index 4602c280..e37bd79c 100644 --- a/tests/Foundation/Media/MediaFilesTest.php +++ b/tests/Foundation/Media/MediaFilesTest.php @@ -70,3 +70,9 @@ test('test has() method', function () { $this->assertTrue(flextype('media_files')->has('foo.txt')); $this->assertFalse(flextype('media_files')->has('bar.txt')); }); + +test('test getFileLocation() method', function () { + flextype('filesystem')->file(PATH['project'] . '/uploads/foo.txt')->put('foo'); + flextype('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' => []])); + $this->assertStringContainsString('foo.txt', flextype('media_files')->getFileLocation('foo.txt')); +});