test fixes

This commit is contained in:
Dennis Eichhorn 2024-04-25 16:34:22 +00:00
parent 3c2420c8f4
commit 075184865b
3 changed files with 4 additions and 2 deletions

View File

@ -182,6 +182,8 @@ class MediaMapper extends DataMapperFactory
/**
* Get parent collection
*
* WARNING: THIS IS NOT RETURNING THE COLLECTION OF A MEDIA OBJECT BUT ITS PARENT!!!
*
* @param string $path Virtual path
*
* @return ReadMapper

View File

@ -192,7 +192,7 @@ trait ApiControllerMediaTrait
files: ['test'],
account: 1,
basePath: '/test',
)
)->sources
);
}

View File

@ -167,7 +167,7 @@ final class MediaMapperTest extends \PHPUnit\Framework\TestCase
self::assertGreaterThan(0, $media->id);
self::assertEquals($idMedia, $media->id);
$collectionR = MediaMapper::getParentCollection($media->getVirtualPath())->execute();
$collectionR = MediaMapper::getParentCollection($collection->virtualPath . '/sub/file.txt')->execute();
self::assertEquals($idCollection, $collectionR->id);
self::assertEquals($collection->name, $collectionR->name);
}