mirror of
https://github.com/flextype/flextype.git
synced 2025-08-08 06:06:45 +02:00
feat(tests): add tests for MediaFilesMeta delete() method #477
This commit is contained in:
@@ -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']));
|
||||
});
|
||||
|
Reference in New Issue
Block a user