/** * @NoAdminRequired * @NoCSRFRequired * @CORS * * Generates thumbnails * * @see PreviewController::getThumbnails() * * @param string $ids the ID of the files of which we need thumbnail previews of * @param bool $square * @param double $scale * * @return array<string,array|string|null> */ public function getThumbnails($ids, $square, $scale) { $idsArray = explode(';', $ids); foreach ($idsArray as $id) { // Casting to integer here instead of using array_map to extract IDs from the URL list($thumbnail, $status) = $this->getThumbnail((int) $id, $square, $scale); $thumbnail['fileid'] = $id; $thumbnail['status'] = $status; $this->eventSource->send('preview', $thumbnail); } $this->eventSource->close(); $this->exitController(); }
private function mockEventSourceSend($event, $data, $message) { $this->eventSource->expects($this->once())->method('send')->with($event, $data)->willReturn($message); }