public function get($locale, $filter = [], $limit = null, $offset = null)
{
$media = [];
$mediaEntities = $this->mediaRepository->findMedia($filter, $limit, $offset, $this->getCurrentUser(), $this->permissions[PermissionTypes::VIEW]);
$this->count = $this->mediaRepository->count($filter);
foreach ($mediaEntities as $mediaEntity) {
$media[] = $this->addFormatsAndUrl(new Media($mediaEntity, $locale, null));
}
return $media;
}
public function testGetWithoutToken() { $this->tokenStorage->getToken()->willReturn(null); $this->mediaRepository->findMedia(Argument::cetera())->willReturn([])->shouldBeCalled(); $this->mediaRepository->count(Argument::cetera())->shouldBeCalled(); $this->mediaManager->get(1); }