diff --git a/tests/Foundation/Media/MediaFilesMetaTest.php b/tests/Foundation/Media/MediaFilesMetaTest.php index 97b3e9f6..80ebe03a 100644 --- a/tests/Foundation/Media/MediaFilesMetaTest.php +++ b/tests/Foundation/Media/MediaFilesMetaTest.php @@ -27,3 +27,11 @@ test('test add() method', function () { $this->assertTrue(flextype('media_files_meta')->add('foo.txt', 'bar', 'Bar')); $this->assertEquals('Bar', flextype('yaml')->decode(flextype('filesystem')->file(PATH['project'] . '/uploads/.meta/foo.txt.yaml')->get())['bar']); }); + +test('test delete() 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->assertTrue(flextype('media_files_meta')->delete('foo.txt', 'title')); + $this->assertTrue(empty(flextype('yaml')->decode(flextype('filesystem')->file(PATH['project'] . '/uploads/.meta/foo.txt.yaml')->get())['bar'])); +});