1
0
mirror of https://github.com/flextype/flextype.git synced 2025-08-08 22:26:46 +02:00

feat(tests): add tests for MediaFiles getFileLocation() method #477

This commit is contained in:
Awilum
2020-10-19 20:20:14 +03:00
parent 909a7f767b
commit 1e87b4435b

View File

@@ -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'));
});