+ protected function uploadImage($name, $uploadedTo = 0, $contentType = 'image/png', ?string $testDataFileName = null)
+ {
+ $file = $this->getTestImage($name, $testDataFileName);
+
+ return $this->withHeader('Content-Type', $contentType)
+ ->call('POST', '/images/gallery', ['uploaded_to' => $uploadedTo], [], ['file' => $file], []);
+ }
+
+ /**
+ * Upload a new gallery image.
+ * Returns the image name.
+ * Can provide a page to relate the image to.
+ *
+ * @param Page|null $page
+ *
+ * @return array{name: string, path: string, page: Page, response: stdClass}
+ */
+ protected function uploadGalleryImage(Page $page = null, ?string $testDataFileName = null)