X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/9af636bd48f5c7cec7f73746307800b9572d2644..refs/pull/3406/head:/tests/Uploads/UsesImages.php diff --git a/tests/Uploads/UsesImages.php b/tests/Uploads/UsesImages.php index 24c253802..b55572248 100644 --- a/tests/Uploads/UsesImages.php +++ b/tests/Uploads/UsesImages.php @@ -1,7 +1,10 @@ -getTestImage($name, $testDataFileName); + return $this->withHeader('Content-Type', $contentType) ->call('POST', '/images/gallery', ['uploaded_to' => $uploadedTo], [], ['file' => $file], []); } @@ -75,8 +83,10 @@ trait UsesImages * Upload a new gallery image. * Returns the image name. * Can provide a page to relate the image to. + * * @param Page|null $page - * @return array + * + * @return array{name: string, path: string, page: Page, response: stdClass} */ protected function uploadGalleryImage(Page $page = null, ?string $testDataFileName = null) { @@ -90,10 +100,11 @@ trait UsesImages $upload = $this->uploadImage($imageName, $page->id, 'image/png', $testDataFileName); $upload->assertStatus(200); + return [ - 'name' => $imageName, - 'path' => $relPath, - 'page' => $page, + 'name' => $imageName, + 'path' => $relPath, + 'page' => $page, 'response' => json_decode($upload->getContent()), ]; } @@ -108,5 +119,4 @@ trait UsesImages unlink($path); } } - -} \ No newline at end of file +}