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