test unified uploads
This commit is contained in:
parent
a2c3ffad8b
commit
b6da71ecd2
6 changed files with 144 additions and 27 deletions
|
|
@ -122,7 +122,7 @@ class ElementsEndpointTest extends TestCase
|
|||
parentElement: null,
|
||||
));
|
||||
|
||||
$response = $this->patchJson("/api/elements/{$element->getId()}", [
|
||||
$response = $this->postJson("/api/elements/{$element->getId()}", [
|
||||
'title' => 'Updated title',
|
||||
'description' => 'Updated description',
|
||||
'iconImageUrl' => '/assets/updated-icon.png',
|
||||
|
|
@ -162,7 +162,7 @@ class ElementsEndpointTest extends TestCase
|
|||
|
||||
$response = $this->withCredentials()
|
||||
->withUnencryptedCookie('auth_token', 'valid-token')
|
||||
->patchJson("/api/elements/{$element->getId()}", [
|
||||
->postJson("/api/elements/{$element->getId()}", [
|
||||
'title' => 'Updated title',
|
||||
'description' => 'Updated description',
|
||||
'iconImageUrl' => '/assets/updated-icon.png',
|
||||
|
|
@ -212,7 +212,7 @@ class ElementsEndpointTest extends TestCase
|
|||
));
|
||||
|
||||
$response = $this->post(
|
||||
"/api/elements/{$element->getId()}/icon-image",
|
||||
"/api/elements/{$element->getId()}",
|
||||
['iconImage' => $this->iconImageUpload()],
|
||||
);
|
||||
|
||||
|
|
@ -247,7 +247,7 @@ class ElementsEndpointTest extends TestCase
|
|||
$response = $this->withCredentials()
|
||||
->withUnencryptedCookie('auth_token', 'valid-token')
|
||||
->post(
|
||||
"/api/elements/{$element->getId()}/icon-image",
|
||||
"/api/elements/{$element->getId()}",
|
||||
['iconImage' => $this->iconImageUpload()],
|
||||
);
|
||||
|
||||
|
|
@ -290,7 +290,7 @@ class ElementsEndpointTest extends TestCase
|
|||
));
|
||||
|
||||
$response = $this->post(
|
||||
"/api/elements/{$element->getId()}/pdf",
|
||||
"/api/elements/{$element->getId()}",
|
||||
['pdf' => $this->pdfUpload()],
|
||||
);
|
||||
|
||||
|
|
@ -325,7 +325,7 @@ class ElementsEndpointTest extends TestCase
|
|||
$response = $this->withCredentials()
|
||||
->withUnencryptedCookie('auth_token', 'valid-token')
|
||||
->post(
|
||||
"/api/elements/{$element->getId()}/pdf",
|
||||
"/api/elements/{$element->getId()}",
|
||||
['pdf' => $this->pdfUpload()],
|
||||
);
|
||||
|
||||
|
|
@ -369,9 +369,7 @@ class ElementsEndpointTest extends TestCase
|
|||
|
||||
private function iconImageUpload(): UploadedFile
|
||||
{
|
||||
$fixturePath = __DIR__
|
||||
. '/../../../frontend/rabbi_gerzi/public/assets/'
|
||||
. 'baderech-haavodah-icon.png';
|
||||
$fixturePath = __DIR__ . '/../fixtures/icon.png';
|
||||
|
||||
return new UploadedFile(
|
||||
$fixturePath,
|
||||
|
|
@ -384,9 +382,7 @@ class ElementsEndpointTest extends TestCase
|
|||
|
||||
private function pdfUpload(): UploadedFile
|
||||
{
|
||||
$fixturePath = __DIR__
|
||||
. '/../../../frontend/rabbi_gerzi/public/assets/pdfs/'
|
||||
. 'baderech.pdf';
|
||||
$fixturePath = __DIR__ . '/../fixtures/baderech.pdf';
|
||||
|
||||
return new UploadedFile(
|
||||
$fixturePath,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue