protected function requestUploadImage(int $communityId, Point $start, Point $end) : RESTRequest { $uri = "/protected/community/{$communityId}/image-upload/crop-start/{$start->getX()}/{$start->getY()}/crop-end/{$end->getX()}/{$end->getY()}/"; $fileName = __DIR__ . '/REST/Resources/grid-example.png'; return $this->request('POST', $uri)->setUploadedFiles(['file' => new UploadedFile($fileName, filesize($fileName), 0)]); }
protected function requestUploadImage(int $collectionId, Point $start, Point $end, string $localFile) : RESTRequest { $uri = sprintf('/protected/collection/%d/image-upload/crop-start/%d/%d/crop-end/%d/%d', $collectionId, $start->getX(), $start->getY(), $end->getX(), $end->getY()); $this->assertTrue(is_readable($localFile)); return $this->request('POST', $uri)->setUploadedFiles(['file' => new UploadedFile($localFile, filesize($localFile), 0)]); }