From 075184865b1061cff834f6e822e8501f297ff43a Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Thu, 25 Apr 2024 16:34:22 +0000 Subject: [PATCH] test fixes --- Models/MediaMapper.php | 2 ++ tests/Controller/Api/ApiControllerMediaTrait.php | 2 +- tests/Models/MediaMapperTest.php | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Models/MediaMapper.php b/Models/MediaMapper.php index 9861775..e3235b1 100755 --- a/Models/MediaMapper.php +++ b/Models/MediaMapper.php @@ -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 diff --git a/tests/Controller/Api/ApiControllerMediaTrait.php b/tests/Controller/Api/ApiControllerMediaTrait.php index 59ef8f1..6180223 100755 --- a/tests/Controller/Api/ApiControllerMediaTrait.php +++ b/tests/Controller/Api/ApiControllerMediaTrait.php @@ -192,7 +192,7 @@ trait ApiControllerMediaTrait files: ['test'], account: 1, basePath: '/test', - ) + )->sources ); } diff --git a/tests/Models/MediaMapperTest.php b/tests/Models/MediaMapperTest.php index 3f589e6..51b029c 100755 --- a/tests/Models/MediaMapperTest.php +++ b/tests/Models/MediaMapperTest.php @@ -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); }