test nullable pdf params

This commit is contained in:
Yisroel Baum 2026-06-26 10:08:30 +03:00
parent d59d444952
commit 9126b0e968
Signed by: yisroelbaum
GPG key ID: 0FA60884F75520A9
2 changed files with 45 additions and 0 deletions

View file

@ -278,6 +278,28 @@ class ElementControllerTest extends TestCase
);
}
public function testShowPdfReturns400WhenFolderIsMissing(): void
{
$response = $this->controller->showPdf(null, 'baderech.pdf');
$this->assertEquals(400, $response->getStatusCode());
$this->assertSame(
['error' => 'folder is required'],
json_decode($response->getContent(), true),
);
}
public function testShowPdfReturns400WhenFileNameIsMissing(): void
{
$response = $this->controller->showPdf('short', null);
$this->assertEquals(400, $response->getStatusCode());
$this->assertSame(
['error' => 'fileName is required'],
json_decode($response->getContent(), true),
);
}
public function testUpdateWithIconImageReturnsElementPayload(): void
{
$set = $this->createSet(1, 'Baderech');