test unified uploads
This commit is contained in:
parent
a2c3ffad8b
commit
b6da71ecd2
6 changed files with 144 additions and 27 deletions
|
|
@ -42,11 +42,6 @@ class ElementControllerTest extends TestCase
|
|||
new UpdateRichText($this->elementRepo),
|
||||
new UpdatePdfPath($this->elementRepo),
|
||||
new UpdateYoutubeUrl($this->elementRepo),
|
||||
$this->elementRepo,
|
||||
);
|
||||
$this->controller = new ElementController(
|
||||
$getElement,
|
||||
$updateElement,
|
||||
new UpdateElementIconImage(
|
||||
$this->elementRepo,
|
||||
$this->fileUploader,
|
||||
|
|
@ -55,6 +50,11 @@ class ElementControllerTest extends TestCase
|
|||
$this->elementRepo,
|
||||
$this->fileUploader,
|
||||
),
|
||||
$this->elementRepo,
|
||||
);
|
||||
$this->controller = new ElementController(
|
||||
$getElement,
|
||||
$updateElement,
|
||||
$this->fileUploader,
|
||||
);
|
||||
}
|
||||
|
|
@ -155,7 +155,7 @@ class ElementControllerTest extends TestCase
|
|||
);
|
||||
}
|
||||
|
||||
public function testUploadIconImageReturnsElementPayload(): void
|
||||
public function testUpdateWithIconImageReturnsElementPayload(): void
|
||||
{
|
||||
$set = $this->createSet(1, 'Baderech');
|
||||
$element = $this->createElement(
|
||||
|
|
@ -168,9 +168,7 @@ class ElementControllerTest extends TestCase
|
|||
null,
|
||||
null,
|
||||
);
|
||||
$fixturePath = __DIR__
|
||||
. '/../../../../frontend/rabbi_gerzi/public/assets/'
|
||||
. 'baderech-haavodah-icon.png';
|
||||
$fixturePath = __DIR__ . '/../../fixtures/icon.png';
|
||||
$request = new Request([], [], [], [], [
|
||||
'iconImage' => new UploadedFile(
|
||||
$fixturePath,
|
||||
|
|
@ -181,7 +179,7 @@ class ElementControllerTest extends TestCase
|
|||
),
|
||||
]);
|
||||
|
||||
$response = $this->controller->uploadIconImage(
|
||||
$response = $this->controller->update(
|
||||
$element->getId(),
|
||||
$request,
|
||||
);
|
||||
|
|
@ -199,7 +197,7 @@ class ElementControllerTest extends TestCase
|
|||
);
|
||||
}
|
||||
|
||||
public function testUploadPdfReturnsElementPayload(): void
|
||||
public function testUpdateWithPdfReturnsElementPayload(): void
|
||||
{
|
||||
$set = $this->createSet(1, 'Baderech');
|
||||
$element = $this->createElement(
|
||||
|
|
@ -212,9 +210,7 @@ class ElementControllerTest extends TestCase
|
|||
null,
|
||||
null,
|
||||
);
|
||||
$fixturePath = __DIR__
|
||||
. '/../../../../frontend/rabbi_gerzi/public/assets/pdfs/'
|
||||
. 'baderech.pdf';
|
||||
$fixturePath = __DIR__ . '/../../fixtures/baderech.pdf';
|
||||
$request = new Request([], [], [], [], [
|
||||
'pdf' => new UploadedFile(
|
||||
$fixturePath,
|
||||
|
|
@ -225,7 +221,7 @@ class ElementControllerTest extends TestCase
|
|||
),
|
||||
]);
|
||||
|
||||
$response = $this->controller->uploadPdf(
|
||||
$response = $this->controller->update(
|
||||
$element->getId(),
|
||||
$request,
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue